35 QL_REQUIRE(a>0.0,
"non-positive a is not allowed");
42 accuracy, maxIteration);
46 accuracy, maxIteration);
55 if (x==0.0)
return 0.0;
65 if (std::fabs(del) < std::fabs(sum)*accuracy) {
66 return sum*std::exp(-x+a*std::log(x)-gln);
69 QL_FAIL(
"accuracy not reached");
83 for (i=1; i<=maxIteration; i++) {
93 if (std::fabs(del-1.0) < accuracy) {
94 return std::exp(-x+a*std::log(x)-gln)*h;
98 QL_FAIL(
"accuracy not reached");
Real logValue(Real x) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
ext::function< Real(Real)> b
QL_INTEGER Integer
integer number
Incomplete Gamma function.
Real incompleteGammaFunctionSeriesRepr(Real a, Real x, Real accuracy, Integer maxIteration)
Real incompleteGammaFunction(Real a, Real x, Real accuracy, Integer maxIteration)
Incomplete Gamma function.
Real incompleteGammaFunctionContinuedFractionRepr(Real a, Real x, Real accuracy, Integer maxIteration)