Improve fix from PR3924 (#3941)

* compare denominator against DBL_MIN rather than a somewhat arbitrary small number near it
This commit is contained in:
Martin Kroeker 2023-03-16 15:09:32 +01:00 committed by GitHub
parent 8d6813ec41
commit f3d21039ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -37,6 +37,7 @@
/*********************************************************************/
#include <stdio.h>
#include <float.h>
#include "common.h"
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);
//if (temp1 != ZERO) {
if (fabs(temp1) > 1.e-305) {
if (fabs(temp1) >= DBL_MIN ) {
temp1 = dp1 / temp1;
if (jp != j) {

View File

@ -37,6 +37,7 @@
/*********************************************************************/
#include <stdio.h>
#include <float.h>
#include "common.h"
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);
// 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) {
SWAP_K(j + 1, 0, 0, ZERO, ZERO, a + j * 2, lda,