2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-28 07:22:12 +00:00

Fix some corner cases in the non-central distros.

This commit is contained in:
jzmaddock
2015-07-18 16:41:28 +01:00
parent 637bde7580
commit e973194d55
2 changed files with 6 additions and 2 deletions

View File

@@ -515,7 +515,11 @@ namespace boost
T non_central_beta_pdf(T a, T b, T lam, T x, T y, const Policy& pol)
{
BOOST_MATH_STD_USING
using namespace boost::math;
//
// Special cases:
//
if((x == 0) || (y == 0))
return 0;
//
// Variables come first:
//

View File

@@ -90,7 +90,7 @@ namespace boost
betaf -= xtermf;
T term = poisf * betaf;
sum += term;
if((fabs(last_term) > fabs(term)) && (fabs(term/sum) < errtol))
if((fabs(last_term) >= fabs(term)) && (fabs(term/sum) < errtol))
break;
last_term = term;
++count;