Skip to content

Commit f3d2103

Browse files
authoredMar 16, 2023
Improve fix from PR3924 (#3941)
* compare denominator against DBL_MIN rather than a somewhat arbitrary small number near it
1 parent 8d6813e commit f3d2103

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎lapack/getf2/getf2_k.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
/*********************************************************************/
3838

3939
#include <stdio.h>
40+
#include <float.h>
4041
#include "common.h"
4142

4243
static FLOAT dp1 = 1.;
@@ -100,7 +101,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
100101
temp1 = *(b + jp);
101102

102103
//if (temp1 != ZERO) {
103-
if (fabs(temp1) > 1.e-305) {
104+
if (fabs(temp1) >= DBL_MIN ) {
104105
temp1 = dp1 / temp1;
105106

106107
if (jp != j) {

‎lapack/getf2/zgetf2_k.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
/*********************************************************************/
3838

3939
#include <stdio.h>
40+
#include <float.h>
4041
#include "common.h"
4142

4243
double fabs(double);
@@ -106,7 +107,7 @@ blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa,
106107
temp2 = *(b + jp * 2 + 1);
107108

108109
// if ((temp1 != ZERO) || (temp2 != ZERO)) {
109-
if ((fabs(temp1) > 1.e-305) || (fabs(temp2) > 1.e-305)) {
110+
if ((fabs(temp1) >= DBL_MIN) && (fabs(temp2) >= DBL_MIN)) {
110111

111112
if (jp != j) {
112113
SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda,

0 commit comments

Comments
 (0)
Please sign in to comment.