69 if (a <= 0 || x <= 0)
return 0;
71 if (x < (a+1))
return GamSer(a,x);
72 else return GamCf(a,x);
88 double fpmin = 1.e-30;
90 if (a <= 0 || x <= 0)
return 0;
98 for (
int i=1; i<=itmax; i++) {
99 an = double(-i)*(double(i)-
a);
102 if (
Abs(d) < fpmin) d = fpmin;
104 if (
Abs(c) < fpmin) c = fpmin;
108 if (
Abs(del-1) <
eps)
break;
111 double v =
Exp(-x+a*
Log(x)-gln)*h;
129 if (a <= 0 || x <= 0)
return 0;
135 for (
int n=1;
n<=itmax;
n++) {
142 double v = sum*
Exp(-x+a*
Log(x)-gln);
163 double c[7] = { 2.5066282746310005, 76.18009172947146, -86.50532032941677
164 ,24.01409824083091, -1.231739572450155, 0.1208650973866179e-2
165 ,-0.5395239384953e-5};
170 tmp = (x+0.5)*
Log(tmp)-tmp;
171 double ser = 1.000000000190015;
172 for (
int i=1; i<7; i++) {
176 double v = tmp+
Log(c[0]*ser/x);
static const G4double eps
static short Abs(short d)
double GamCf(double a, double x)
static double Exp(double x)
double GamSer(double a, double x)
static double Log(double x)
static double LnGamma(double z)