2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-25 04:22:15 +00:00

Fix FE_INVALID in non-central t CDF

[ci skip]
This commit is contained in:
Matt Borland
2022-12-04 11:25:09 -08:00
parent 6dc45d223d
commit 0ec83bcb3a
3 changed files with 56 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ namespace boost
T term = beta * pois;
sum += term;
// Don't terminate on first term in case we "fixed" k above:
if((fabs(last_term) > fabs(term)) && fabs(term/sum) < errtol)
if(((fabs(last_term) > fabs(term)) && fabs(term/sum) < errtol) || (v == 2 && i == 0))
break;
last_term = term;
pois *= (i + 0.5f) / d2;