Browse Source

Improve fix from PR3924 (#3941)

* compare denominator against DBL_MIN rather than a somewhat arbitrary small number near it
tags/v0.3.22^2
Martin Kroeker GitHub 2 years ago
parent
commit
f3d21039ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      lapack/getf2/getf2_k.c
  2. +2
    -1
      lapack/getf2/zgetf2_k.c

+ 2
- 1
lapack/getf2/getf2_k.c View File

@@ -37,6 +37,7 @@
/*********************************************************************/ /*********************************************************************/


#include <stdio.h> #include <stdio.h>
#include <float.h>
#include "common.h" #include "common.h"


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


//if (temp1 != ZERO) { //if (temp1 != ZERO) {
if (fabs(temp1) > 1.e-305) {
if (fabs(temp1) >= DBL_MIN ) {
temp1 = dp1 / temp1; temp1 = dp1 / temp1;


if (jp != j) { if (jp != j) {


+ 2
- 1
lapack/getf2/zgetf2_k.c View File

@@ -37,6 +37,7 @@
/*********************************************************************/ /*********************************************************************/


#include <stdio.h> #include <stdio.h>
#include <float.h>
#include "common.h" #include "common.h"


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


// if ((temp1 != ZERO) || (temp2 != ZERO)) { // if ((temp1 != ZERO) || (temp2 != ZERO)) {
if ((fabs(temp1) > 1.e-305) || (fabs(temp2) > 1.e-305)) {
if ((fabs(temp1) >= DBL_MIN) && (fabs(temp2) >= DBL_MIN)) {
if (jp != j) { if (jp != j) {
SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda, SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda,


Loading…
Cancel
Save