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