Evaluate the gamma, log-gamma, beta and error functions with a documented Lanczos approximation.
Function value
How to use this tool
Choose gamma, log-gamma, beta or the error function.
Beta needs both arguments; the others need only x.
The headline value is shown to six decimals.
For whole-number gamma inputs, the factorial equivalent is shown.
Formula & worked example
Γ(5) = 24, Γ(½) = √π ≈ 1.77245, and B(2, 3) = 1/12.
Limitations — read this before you rely on it
Gamma and log-gamma are undefined at zero and negative integers. Very large inputs overflow to out-of-range rather than returning a misleading number; erf is an approximation, not an exact evaluation.
Frequently asked questions
It extends the factorial to non-integers: Γ(n) = (n − 1)! for whole numbers n, and it is defined for all other numbers except zero and negative integers.
√π, about 1.77245 — one of the most famous special values.
B(x, y) = Γ(x)Γ(y) / Γ(x + y). It appears in probability, especially the beta distribution.
The error function gives normal-distribution probabilities: the chance a normal variable falls within a range is an erf value.
Gamma and beta use the Lanczos approximation (near machine precision for ordinary inputs); erf uses Abramowitz–Stegun, accurate to about 1.5 × 10⁻⁷.
