2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Fix FE_INVALID in quantile

This commit is contained in:
Matt Borland
2022-12-04 12:52:52 -08:00
parent 0ec83bcb3a
commit 5c1392176c
2 changed files with 3 additions and 2 deletions

View File

@@ -183,7 +183,8 @@ namespace boost
term += beta * pois;
pois *= (j + 0.5f) / d2;
beta -= xterm;
xterm *= (j) / (x * (v / 2 + j - 1));
if(!(v == 2 && j == 0))
xterm *= (j) / (x * (v / 2 + j - 1));
}
sum += term;

View File

@@ -43,7 +43,7 @@ int main()
}
const auto quantile1 = boost::math::quantile(nct1, 0.5);
//CHECK_ULP_CLOSE(quantile1, 2.33039025947198741, 20);
CHECK_ULP_CLOSE(quantile1, 2.33039025947198741, 20);
if (std::fetestexcept(FE_INVALID) || std::fetestexcept(FE_DIVBYZERO))
{