mirror of
https://github.com/OpenMathLib/OpenBLAS
synced 2026-05-31 00:45:48 +08:00
Improve fix from PR3924 (#3941)
* compare denominator against DBL_MIN rather than a somewhat arbitrary small number near it
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user