CMS 3D CMS Logo

IncompleteGammaComplement.cc
Go to the documentation of this file.
5 
7 
8 #include <iostream>
9 #include <cmath>
10 
11 float IncompleteGammaComplement::value(float a, float x) {
12  if (x < 0.0 || a <= 0.0)
13  edm::LogInfo("IncompleteGammaComplement") << "IncompleteGammaComplement::invalid arguments";
14  if (x < (a + 1.0))
15  // take the complement of the series representation
16  return 1. - GammaSeries(a, x) * (exp(-x + a * log(x) - GammaLn(a)));
17  else
18  // use the continued fraction representation
19  return GammaContinuedFraction(a, x) * (exp(-x + a * log(x) - GammaLn(a)));
20 }
21 
22 float IncompleteGammaComplement::ln(float a, float x) {
23  if (x < 0.0 || a <= 0.0)
24  edm::LogInfo("IncompleteGammaComplement") << "IncompleteGammaComplement::invalid arguments";
25  if (x < (a + 1.0))
26  // take the complement of the series representation
27  return log(1. - GammaSeries(a, x) * (exp(-x + a * log(x) - GammaLn(a))));
28  else
29  // use the continued fraction representation
30  return log(GammaContinuedFraction(a, x)) - x + a * log(x) - GammaLn(a);
31 }
GammaSeries.h
IncompleteGammaComplement::value
static float value(float a, float x)
Definition: IncompleteGammaComplement.cc:11
MessageLogger.h
GammaContinuedFraction.h
edm::LogInfo
Definition: MessageLogger.h:254
GammaSeries
float GammaSeries(float a, float x)
Definition: GammaSeries.cc:8
DDAxes::x
vertices_cff.x
x
Definition: vertices_cff.py:29
IncompleteGammaComplement.h
a
double a
Definition: hdecay.h:119
GammaLn
float GammaLn(float z)
Definition: GammaLn.cc:4
GammaLn.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
IncompleteGammaComplement::ln
static float ln(float a, float x)
Definition: IncompleteGammaComplement.cc:22
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
GammaContinuedFraction
float GammaContinuedFraction(float a, float x)
Definition: GammaContinuedFraction.cc:9