Gamma function

Gamma functions for real and complex values.

Defined via the analytic continuation of the Gamma function.

boring_math.special_functions.gamma_family.gamma.gamma(z: complex) complex

Gamma function

Valid for all complex values of z.

Note

Lanczos approximation of Gamma using g = 7 with n = 9 terms.

The values of g and n were chosen to balance accuracy with speed. Typically accurate to 13 correct decimal places.

Code modified from the Wikipedia Lanczos approximate article.

param z:

Complex argument.

returns:

Value of the analytic continuation of gamma(z). Uses inf + infj to represent a single complex infinity.

boring_math.special_functions.gamma_family.gamma.gamma_real(x: float) float

Gamma function

Valid for all finite real values of x.

param x:

Floating point argument.

returns:

Value of gamma(x).