Content deleted Content added
Explain how the result was obtained. Tags: Visual edit Mobile edit Mobile web edit |
Tag: Reverted |
||
Line 2:
==Introduction==
The [https://calculator1.net/maths/gamma-lanczos-calculator Lanczos] approximation consists of the formula
:<math>\Gamma(z+1) = \sqrt{2\pi} {\left( z + g + \tfrac12 \right)}^{z + 1/2 } e^{-(z+g+1/2)} A_g(z)</math>
for the [https://calculator1.net/maths/gamma-calculator gamma function], with
:<math>A_g(z) = \frac12p_0(g) + p_1(g) \frac{z}{z+1} + p_2(g) \frac{z(z-1)}{(z+1)(z+2)} + \cdots.</math>
Line 18:
:<math>A_g(z) = c_0 + \sum_{k=1}^{N} \frac{c_k}{z+k}</math>
Thus computing the [https://calculator1.net/maths/gamma-calculator gamma function] becomes a matter of evaluating only a small number of [[elementary function]]s and multiplying by stored constants. The [https://calculator1.net/maths/gamma-lanczos-calculator Lanczos approximation] was popularized by ''[[Numerical Recipes]]'', according to which computing the [https://calculator1.net/maths/gamma-calculator gamma function] becomes "not much more difficult than other built-in functions that we take for granted, such as sin ''x'' or ''e''<sup>''x''</sup>." The method is also implemented in the [[GNU Scientific Library]], [[Boost (C++ libraries)|Boost]], [[CPython]] and [[musl]].
==Coefficients==
|