test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IncompleteGammaComplement.cc
Go to the documentation of this file.
5 
7 
8 
9 #include <iostream>
10 #include <cmath>
11 
13 {
14  if( x < 0.0 || a <= 0.0 )
15  edm::LogInfo("IncompleteGammaComplement")<< "IncompleteGammaComplement::invalid arguments";
16  if( x < (a+1.0) )
17  // take the complement of the series representation
18  return 1.-GammaSeries(a,x)*(exp(-x + a*log(x) - GammaLn(a)));
19  else
20  // use the continued fraction representation
21  return GammaContinuedFraction(a,x)*(exp(-x + a*log(x) - GammaLn(a)));
22 }
23 
24 
25 float IncompleteGammaComplement::ln(float a, float x)
26 {
27  if( x < 0.0 || a <= 0.0 )
28 edm::LogInfo("IncompleteGammaComplement")<< "IncompleteGammaComplement::invalid arguments";
29  if( x < (a+1.0) )
30  // take the complement of the series representation
31  return log(1.-GammaSeries(a,x)*(exp(-x + a*log(x) - GammaLn(a))));
32  else
33  // use the continued fraction representation
34  return log(GammaContinuedFraction(a,x)) -x + a*log(x) - GammaLn(a);
35 }
float GammaLn(float z)
Definition: GammaLn.cc:5
float GammaContinuedFraction(float a, float x)
double a
Definition: hdecay.h:121
static float value(float a, float x)
float GammaSeries(float a, float x)
Definition: GammaSeries.cc:8
Definition: DDAxes.h:10
static float ln(float a, float x)