26 static double kBig = 4.503599627370496e15;
27 static double kBiginv = 2.22044604925031308085e-16;
30 static double LS2PI = 0.91893853320467274178;
54 double ans, ax, c, yc,
r, t,
y,
z;
55 double pk, pkm1, pkm2, qk, qkm1, qkm2;
59 if (a <= 0)
return 0.0;
61 if (x <= 0)
return 1.0;
63 if( (x < 1.0) || (x < a) )
64 return( 1.0 -
igam(a,x) );
88 pk = pkm1 * z - pkm2 * yc;
89 qk = qkm1 * z - qkm2 * yc;
93 t = std::abs( (ans - r)/r );
102 if( std::abs(pk) > kBig )
129 double ans, ax, c,
r;
133 if (a <= 0)
return 1.0;
135 if (x <= 0)
return 0.0;
137 if( (x > 1.0) && (x > a ) )
138 return( 1.0 -
igamc(a,x) );
160 return( ans * ax/a );
170 static double A[] = {
171 8.11614167470508450300E-4,
172 -5.95061904284301438324E-4,
173 7.93650340457716943945E-4,
174 -2.77777777730099687205E-3,
175 8.33333333333331927722E-2
178 static double B[] = {
179 -1.37825152569120859100E3,
180 -3.88016315134637840924E4,
181 -3.31612992738871184744E5,
182 -1.16237097492762307383E6,
183 -1.72173700820839662146E6,
184 -8.53555664245765465627E5
187 static double C[] = {
189 -3.51815701436523470549E2,
190 -1.70642106651881159223E4,
191 -2.20528590553854454839E5,
192 -1.13933444367982507207E6,
193 -2.53252307177582951285E6,
194 -2.01889141433532773231E6
199 double p,
q, u, w,
z;
204 if (x >= std::numeric_limits<double>::infinity())
205 return(std::numeric_limits<double>::infinity());
213 return (std::numeric_limits<double>::infinity());
227 return (std::numeric_limits<double>::infinity());
247 return (std::numeric_limits<double>::infinity());
268 return( sgngam * std::numeric_limits<double>::infinity() );
276 q += (( 7.9365079365079365079365e-4 * p
277 - 2.7777777777777777777778e-3) *p
278 + 0.0833333333333333333333) /
x;
285 static double P[] = {
286 1.60119522476751861407E-4,
287 1.19135147006586384913E-3,
288 1.04213797561761569935E-2,
289 4.76367800457137231464E-2,
290 2.07448227648435975150E-1,
291 4.94214826801497100753E-1,
292 9.99999999999999996796E-1
294 static double Q[] = {
295 -2.31581873324120129819E-5,
296 5.39605580493303397842E-4,
297 -4.45641913851797240494E-3,
298 1.18139785222060435552E-2,
299 3.58236398605498653373E-2,
300 -2.34591795718243348568E-1,
301 7.14304917030273074085E-2,
302 1.00000000000000000320E0
307 7.87311395793093628397E-4,
308 -2.29549961613378126380E-4,
309 -2.68132617805781232825E-3,
310 3.47222221605458667310E-3,
311 8.33333333333482257126E-2,
314 #define SQTPI std::sqrt(2*ROOT::Math::Pi()) 328 v =
pow( x, 0.5 * x - 0.25 );
333 y =
pow( x, x - 0.5 ) /
y;
346 if (x >=std::numeric_limits<double>::infinity())
358 return( sgngam * std::numeric_limits<double>::infinity());
372 return( sgngam * std::numeric_limits<double>::infinity());
381 return( sgngam * z );
417 return( std::numeric_limits<double>::infinity() );
419 return( z/((1.0 + 0.5772156649015329 * x) * x) );
484 double incbet(
double aa,
double bb,
double xx )
486 double a,
b, t,
x, xc, w,
y;
489 if( aa <= 0.0 || bb <= 0.0 )
493 if (xx <= 0.0)
return( 0.0 );
494 if ( xx >= 1.0)
return( 1.0 );
510 if( xx > (aa/(aa+bb)) )
526 if( flag == 1 && (b * x) <= 1.0 && x <= 0.95)
533 y = x * (a+b-2.0) - (a-1.0);
537 w =
incbd( a, b, x ) / xc;
583 double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
584 double k1, k2, k3, k4, k5, k6, k7, k8;
585 double r, t, ans, thresh;
608 xk = -( x * k1 * k2 )/( k3 * k4 );
609 pk = pkm1 + pkm2 * xk;
610 qk = qkm1 + qkm2 * xk;
616 xk = ( x * k5 * k6 )/( k7 * k8 );
617 pk = pkm1 + pkm2 * xk;
618 qk = qkm1 + qkm2 * xk;
628 t = std::abs( (ans - r)/r );
646 if( (std::abs(qk) + std::abs(pk)) > kBig )
653 if( (std::abs(qk) < kBiginv) || (std::abs(pk) < kBiginv) )
676 double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
677 double k1, k2, k3, k4, k5, k6, k7, k8;
678 double r, t, ans,
z, thresh;
702 xk = -( z * k1 * k2 )/( k3 * k4 );
703 pk = pkm1 + pkm2 * xk;
704 qk = qkm1 + qkm2 * xk;
710 xk = ( z * k5 * k6 )/( k7 * k8 );
711 pk = pkm1 + pkm2 * xk;
712 qk = qkm1 + qkm2 * xk;
722 t = std::abs( (ans - r)/r );
740 if( (std::abs(qk) + std::abs(pk)) > kBig )
747 if( (std::abs(qk) < kBiginv) || (std::abs(pk) < kBiginv) )
768 double s, t, u,
v,
n,
t1,
z, ai;
778 while( std::abs(v) >
z )
793 s = s * t *
pow(x,a);
814 2.46196981473530512524E-10,
815 5.64189564831068821977E-1,
816 7.46321056442269912687E0,
817 4.86371970985681366614E1,
818 1.96520832956077098242E2,
819 5.26445194995477358631E2,
820 9.34528527171957607540E2,
821 1.02755188689515710272E3,
822 5.57535335369399327526E2
826 1.32281951154744992508E1,
827 8.67072140885989742329E1,
828 3.54937778887819891062E2,
829 9.75708501743205489753E2,
830 1.82390916687909736289E3,
831 2.24633760818710981792E3,
832 1.65666309194161350182E3,
833 5.57535340817727675546E2
836 5.64189583547755073984E-1,
837 1.27536670759978104416E0,
838 5.01905042251180477414E0,
839 6.16021097993053585195E0,
840 7.40974269950448939160E0,
841 2.97886665372100240670E0
845 2.26052863220117276590E0,
846 9.39603524938001434673E0,
847 1.20489539808096656605E1,
848 1.70814450747565897222E1,
849 9.60896809063285878198E0,
850 3.36907645100081516050E0
853 9.60497373987051638749E0,
854 9.00260197203842689217E1,
855 2.23200534594684319226E3,
856 7.00332514112805075473E3,
857 5.55923013010394962768E4
861 3.35617141647503099647E1,
862 5.21357949780152679795E2,
863 4.59432382970980127987E3,
864 2.26290000613890934246E4,
865 4.92673942608635921086E4
930 if( std::abs(x) > 1.0 )
953 if (N==0)
return a[0];
957 for (
unsigned int i=1; i <=
N; i++)
969 if (N==0)
return a[0];
972 double pom = x + a[0];
973 for (
unsigned int i=1; i <
N; i++)
double pseries(double a, double b, double x)
double igam(double a, double x)
static double stirf(double x)
Namespace for new ROOT classes and functions.
double pow(double, double)
double Polynomial1eval(double x, double *a, unsigned int N)
double incbd(double a, double b, double x)
double Polynomialeval(double x, double *a, unsigned int N)
double Pi()
Mathematical constants.
double incbet(double aa, double bb, double xx)
DESCRIPTION:
double igamc(double a, double x)
incomplete complementary gamma function igamc(a, x) = 1 - igam(a, x)
double beta(double z, double w)
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Namespace for new Math classes and functions.
you should not use this method at all Int_t Int_t z
double incbcf(double a, double b, double x)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b