4#include "CLHEP/GenericFunctions/IncompleteGamma.hh"
14const int IncompleteGamma::ITMAX =100;
15const double IncompleteGamma::EPS =3.0E-7;
16const double IncompleteGamma::FPMIN =1.0e-30;
32 assert(x>=0.0 && _a.
getValue() > 0.0);
46double IncompleteGamma::_gamser(
double xa,
double x,
double logGamma)
const {
52 for (n=1;n<ITMAX;n++) {
56 if (fabs(del) < fabs(sum)*EPS)
return sum*exp(-x + xa*log(x) - logGamma);
65double IncompleteGamma::_gammcf(
double xa,
double x,
double logGamma)
const {
67 double an,b,c,d,del,h;
74 for (i=1;i<ITMAX;i++) {
78 if (fabs(d) < FPMIN) d = FPMIN;
80 if (fabs(c) < FPMIN) c = FPMIN;
84 if (fabs(del-1.0) < EPS)
return exp(-x+xa*log(x)-logGamma)*h;
#define FUNCTION_OBJECT_IMP(classname)
virtual double operator()(double argument) const override
virtual ~IncompleteGamma()
virtual double getValue() const