fix another corner case involving infinity

This commit is contained in:
Martin Kroeker 2024-05-31 01:06:58 +02:00 committed by GitHub
parent b9a1c9a06c
commit ad2b5c67c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -278,7 +278,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
temp0 = NAN;
else
temp0 = -da_i * x[i+1];
x[i+1] = da_i * x[i];
if (!isinf(x[i+1]))
x[i+1] = da_i * x[i];
else x[i+1] = NAN;
x[i] = temp0;
i += inc_x ;
j++;
@ -412,7 +414,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i,
temp0 = -da_i * x[i+1];
if (isinf(x[i]))
temp0 = NAN;
x[i+1] = da_i * x[i];
if (!isinf(x[i+1]))
x[i+1] = da_i * x[i];
else x[i+1] = NAN;
if ( x[i] == x[i]) //preserve NaN
x[i] = temp0;
i += 2 ;