20#include <ql/math/beta.hpp>
37 Real d = 1.0-qab*x/qap;
44 for (m=1; m<=maxIteration; m++) {
46 aa=m*(b-m)*x/((qam+m2)*(a+m2));
53 aa = -(a+m)*(qab+m)*x/((a+m2)*(qap+m2));
61 if (std::fabs(del-1.0) < accuracy)
64 QL_FAIL(
"a or b too big, or maxIteration too small in betacf");
71 QL_REQUIRE(a > 0.0,
"a must be greater than zero");
72 QL_REQUIRE(b > 0.0,
"b must be greater than zero");
80 QL_REQUIRE(x>0.0 && x<1.0,
"x must be in [0,1]");
84 a*std::log(x) + b*std::log(1.0-x));
86 if (x < (a+1.0)/(a+b+2.0))
QL_INTEGER Integer
integer number
Real betaContinuedFraction(Real a, Real b, Real x, Real accuracy, Integer maxIteration)
Real incompleteBetaFunction(Real a, Real b, Real x, Real accuracy, Integer maxIteration)
Incomplete Beta function.