Skip to content

Commit c5e8f1e

Browse files
author
camilo
committed
SA fixes
1 parent cca92ed commit c5e8f1e

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/ffmath.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ float ffmath::assoc_laguerre( unsigned int n,
12011201
const float alpha = static_cast<float>( m );
12021202
const float N = static_cast<float>( n );
12031203
/*cstat +CERT-FLP36-C*/
1204-
if ( ( x < 0.0f ) || ffmath::isNan( x ) ) {
1204+
if ( ( x < 0.0F ) || ffmath::isNan( x ) ) {
12051205
y = ffmath::getNan();
12061206
}
12071207
else if ( 0U == n ) {
@@ -1357,10 +1357,9 @@ static float ellint_rf( float x,
13571357
float result;
13581358

13591359

1360-
if ( ( x < 0.0F ) || ( y < 0.0F ) || ( z < 0.0F ) ) {
1361-
result = ffmath::getNan();
1362-
}
1363-
else if ( ( ( x + y ) < loLim ) || ( ( x + z ) < loLim ) || ( ( y + z) < loLim ) ) {
1360+
if ( ( x < 0.0F ) || ( y < 0.0F ) || ( z < 0.0F ) ||
1361+
( ( x + y ) < loLim ) || ( ( x + z ) < loLim ) || ( ( y + z) < loLim )
1362+
) {
13641363
result = ffmath::getNan();
13651364
}
13661365
else {
@@ -1421,10 +1420,7 @@ static float ellint_rd( float x,
14211420
constexpr float loLim = 4.103335708781587555782386855921935e-26F;
14221421
float result;
14231422

1424-
if ( ( x < 0.0F ) || ( y < 0.0F ) ) {
1425-
result = ffmath::getNan();
1426-
}
1427-
else if ( ( ( x + y ) < loLim ) || ( z < loLim ) ) {
1423+
if ( ( x < 0.0F ) || ( y < 0.0F ) || ( ( x + y ) < loLim ) || ( z < loLim ) ) {
14281424
result = ffmath::getNan();
14291425
}
14301426
else {
@@ -1531,10 +1527,9 @@ static float ellint_rj( float x,
15311527
constexpr float loLim = 4.103335708781587555782386855921935e-26F;
15321528
constexpr float errTol = 0.049606282877419791144113503378321F;
15331529

1534-
if ( ( x < 0.0F ) || ( y < 0.0F ) || ( z < 0.0F ) ) {
1535-
result = ffmath::getNan();
1536-
}
1537-
else if ( ( ( x + y ) < loLim ) || ( ( x + z ) < loLim ) || ( ( y + z) < loLim )|| ( p < loLim ) ) {
1530+
if ( ( x < 0.0F ) || ( y < 0.0F ) || ( z < 0.0F ) ||
1531+
( ( x + y ) < loLim ) || ( ( x + z ) < loLim ) || ( ( y + z) < loLim )|| ( p < loLim )
1532+
) {
15381533
result = ffmath::getNan();
15391534
}
15401535
else {
@@ -1642,15 +1637,12 @@ float ffmath::comp_ellint_3( float k,
16421637
float y;
16431638
const float abs_k = absolute( k );
16441639

1645-
if ( ffmath::isNan( k ) || ffmath::isNan( nu ) ) {
1640+
if ( ffmath::isNan( k ) || ffmath::isNan( nu ) || ( abs_k > 1.0F ) ) {
16461641
y = ffmath::getNan();
16471642
}
16481643
else if ( ffmath::isEqual( 1.0F, nu ) ) {
16491644
y = ffmath::getInf();
16501645
}
1651-
else if ( abs_k > 1.0F ) {
1652-
y = ffmath::getNan();
1653-
}
16541646
else {
16551647
const float kk = k*k;
16561648
const float one_m_kk = 1.0F - kk;

0 commit comments

Comments
 (0)