Browse Source

fix other corner cases where x=INF

tags/v0.3.28^2
Martin Kroeker GitHub 1 year ago
parent
commit
8c05765a5a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      kernel/mips/zscal.c

+ 9
- 3
kernel/mips/zscal.c 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 )


Loading…
Cancel
Save