fix other corner cases where x=INF

This commit is contained in:
Martin Kroeker 2024-05-31 18:06:36 +02:00 committed by GitHub
parent 516743f7dc
commit 8c05765a5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

View File

@ -48,7 +48,9 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
{
temp = - da_i * x[ip+1] ;
if (isnan(x[ip]) || isinf(x[ip])) temp = NAN;
x[ip+1] = da_i * x[ip] ;
if (!isinf(x[ip+1]))
x[ip+1] = da_i * x[ip] ;
else x[ip+1] = NAN;
}
}
else
@ -56,12 +58,16 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
if ( da_i == 0.0 )
{
temp = da_r * x[ip] ;
x[ip+1] = da_r * x[ip+1];
if (!isinf(x[ip+1]))
x[ip+1] = da_r * x[ip+1];
else x[ip+1] = NAN;
}
else
{
temp = da_r * x[ip] - da_i * x[ip+1] ;
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
if (!isinf(x[ip+1]))
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ;
else x[ip+1] = NAN;
}
}
if ( da_r != da_r )