Gamma
index
/Users/amos/Documents/Database/Mental/Programming/python/lib/avatar/Personal2/www.amos/Python/lib/mathlib/Gamma.py

the Gamma functions: complete and incomplete

 
Functions
       
Gamma(x)
Returns Gamma(x).
 
If x is a positive integer then Gamma(x) = (x-1)!
 
>>> [int(round(Gamma(n))) for n in range(1,12)]
[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]
IGamma(a, x)
Returns the incomplete gamma function P(a, x).
 
Follows _Numerical Recipes in C_, pp 216-219, section 6.2.
IGammaCF(a, x)
IGammaSeries(a, x)
InverseIGamma(a, y, xEpsilon=9.9999999999999995e-08)
LnGamma(x)
Returns ln(Gamma(x)).
 
Follows _Numerical Recipes in C_, pp 213-214, but fixes a couple of errors.
"You can see that this is sort of a take-off on Stirling's approximation, but with a series of corrections that take into account the first few poles in the left complex plane."
add(...)
add(a, b) -- Same as a + b.
div(...)
div(a, b) -- Same as a / b when __future__.division is not in effect.
exp(...)
exp(x)
 
Return e raised to the power of x.
fabs(...)
fabs(x)
 
Return the absolute value of the float x.
log(...)
log(x[, base]) -> the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.