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:
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user