Beta Function Calculator
Calculate the Beta function B(x,y), Log-Beta, Incomplete Beta, and reciprocal values using Lanczos approximation with 15-digit precision.
About
The Euler Beta function B(x, y) appears in normalization constants for probability distributions (Beta, Dirichlet), combinatorial identities, and integral representations across physics and engineering. Errors in its evaluation propagate directly into posterior densities in Bayesian inference and into binomial coefficient generalizations for non-integer arguments. This calculator implements the Lanczos approximation with 9 coefficients at g = 7, yielding approximately 15 significant digits of accuracy across the positive real domain. It computes B(x, y), its natural logarithm ln B, the regularized incomplete beta Ix(a, b), and the reciprocal 1/B.
The log-beta path avoids overflow for large arguments where direct Gamma products exceed 10308. The incomplete beta uses Lentzβs continued fraction algorithm with up to 200 iterations. Note: this tool assumes real positive inputs. The Beta function is undefined at zero and negative integers where the Gamma function has poles.
Formulas
The Beta function is defined as a ratio of Gamma functions:
For numerical stability with large arguments, the logarithmic form is used:
The Gamma function is computed via the Lanczos approximation:
where g = 7 and Ag(z) is a truncated series of 9 precomputed coefficients.
The regularized incomplete beta function is defined as:
Evaluated via Lentzβs continued fraction method for x β [0, 1], with the symmetry relation Ix(a, b) = 1 β I1βx(b, a) used when x > (a + 1) / (a + b + 2).
Where B(x, y) = Beta function, Ξ(z) = Gamma function, x, y = positive real parameters, g = Lanczos constant, Ix = regularized incomplete beta ratio, a, b = shape parameters, t = integration variable.
Reference Data
| x | y | B(x, y) | ln B(x, y) | 1/B(x, y) |
|---|---|---|---|---|
| 1 | 1 | 1.000000 | 0.000000 | 1.000000 |
| 2 | 2 | 0.166667 | β1.791759 | 6.000000 |
| 3 | 3 | 0.033333 | β3.401197 | 30.000000 |
| 0.5 | 0.5 | 3.141593 | 1.144729 | 0.318310 |
| 1 | 2 | 0.500000 | β0.693147 | 2.000000 |
| 1 | 3 | 0.333333 | β1.098612 | 3.000000 |
| 5 | 5 | 0.001587 | β6.445720 | 630.000000 |
| 10 | 10 | 2.385eβ6 | β12.945086 | 419244.000 |
| 0.5 | 1 | 2.000000 | 0.693147 | 0.500000 |
| 2 | 5 | 0.033333 | β3.401197 | 30.000000 |
| 0.1 | 0.1 | 19.714464 | 2.981364 | 0.050724 |
| 3 | 7 | 0.003968 | β5.530108 | 252.000000 |
| 4 | 4 | 0.004762 | β5.347108 | 210.000000 |
| 1 | 0.5 | 2.000000 | 0.693147 | 0.500000 |
| 100 | 100 | 3.656eβ61 | β138.934 | 2.735e+60 |
| 0.25 | 0.75 | 4.442883 | 1.491273 | 0.225079 |
| 6 | 2 | 0.023810 | β3.737670 | 42.000000 |
| 1.5 | 2.5 | 0.196350 | β1.627313 | 5.092958 |
| 50 | 50 | 1.569eβ30 | β68.544 | 6.374e+29 |
| 0.01 | 0.01 | 199.714 | 5.297 | 0.005007 |