Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Gamma function value
3.32335097044784
Γ(a) for a = 3.5
Argument a 3.5
Γ(a) 3.32335097044784
Method Lanczos approximation (g = 7)

What is the Gamma function?

The Gamma function, written \(\Gamma(a)\), is the continuous extension of the factorial to real (and complex) numbers. For a positive integer n it satisfies \(\Gamma(n) = (n-1)!\), so \(\Gamma(5) = 4! = 24\). For a real argument a with positive real part it is defined by the improper integral $$\Gamma\!\left(a\right) = \int_{0}^{\infty} t^{\,a-1}\, e^{-t}\, dt$$ This calculator returns \(\Gamma(a)\) for any real a you enter.

Smooth curve of the Gamma function plotted against the argument a, showing factorial-like growth and poles at non-positive integers
The Gamma function Γ(a) extends the factorial to non-integer arguments, with poles at 0 and negative integers.

How to use this calculator

Type the real argument a into the "Variable a" field and choose how many decimal places to display. The integrand \(t^{a-1}e^{-t}\) and the limits 0 to infinity are fixed by the definition, so you only supply a. The tool reports \(\Gamma(a)\). If you enter a = 0 or a negative integer it reports "undefined" because the Gamma function has a pole there.

The formula explained

Rather than integrating numerically every time, the calculator uses the Lanczos approximation (g = 7, nine coefficients), which reproduces the integral value to about 15 significant digits. For a ≤ 0.5 it first applies the reflection formula \(\Gamma(a)\cdot\Gamma(1-a) = \pi/\sin(\pi a)\), which mirrors the argument into the well-conditioned region and even produces the finite (sometimes negative) values at non-integer negative arguments.

Shaded area under the curve of the integrand t to the power a minus 1 times e to the minus t from zero to infinity
Γ(a) equals the area under the integrand tᵃ⁻¹e⁻ᵗ from 0 to infinity.

Worked example

Take a = 3.5. Using the recurrence \(\Gamma(a) = (a-1)\cdot\Gamma(a-1)\): $$\Gamma(3.5) = 2.5 \cdot 1.5 \cdot 0.5 \cdot \Gamma(0.5) = 1.875 \cdot \sqrt{\pi} = 1.875 \cdot 1.7724538509 \approx 3.3233509704$$ The calculator returns the same value.

FAQ

Why is \(\Gamma(0)\) undefined? The integral diverges and the function has a simple pole at 0 and every negative integer, so the value is infinite.

What is \(\Gamma(0.5)\)? Exactly \(\sqrt{\pi} \approx 1.7724538509\), a famous result tied to the Gaussian integral.

How accurate is the result? The Lanczos approximation is accurate to roughly 15 digits for typical arguments, more than enough for almost all applications.

Last updated: