Calculadora da Função Gama Γ(x)
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
Γ(n) = (n−1)! ; Γ(x) = ∫₀^∞ t^(x−1)·e^(−t) dt
About this calculator
The Gamma Function Calculator Γ(x) numerically approximates the gamma function for positive real arguments (x > 0). The gamma function extends the factorial concept to non-integer numbers: for positive integers n, Γ(n) = (n-1)!. For other values, it uses the integral Γ(x) = ∫₀^∞ t^(x-1)·e^(-t) dt, which has no simple closed form. This calculator employs the Lanczos approximation, an efficient method achieving precision around 1e-10, sufficient for practical applications in mathematics, physics, and engineering.
The calculation is performed using the Lanczos approximation, which expresses Γ(x) as a series based on predefined constants. The algorithm is fast and accurate for x > 0, including fractional and decimal values. The user inputs x and obtains the approximate result, with validation ensuring x is positive. The calculator is useful for problems involving probability distributions (like the gamma distribution), integrals, and special functions.
Use cases include: calculating factorials of non-integer numbers (e.g., 3.5! = Γ(4.5)), determining parameters in statistics (gamma distribution density function), and solving differential equations in physics. Cautions: the gamma function diverges at x = 0 and negative integers, so input is restricted to x > 0. For very large x, overflow or precision loss may occur due to the function's exponential nature.
Frequently asked questions
What is the gamma function?
The gamma function Γ(x) extends the factorial to real and complex numbers, defined by the integral Γ(x) = ∫₀^∞ t^(x-1)·e^(-t) dt for x > 0. For positive integers, Γ(n) = (n-1)!.
Why does the calculator only accept x > 0?
The gamma function is defined for all real numbers except non-positive integers (0, -1, -2, ...), where it has poles. To avoid errors, the calculator restricts input to x > 0.
What is the precision of the result?
The Lanczos approximation used has precision around 1e-10, meaning the relative error is less than 0.00000001%. This is sufficient for most applications.
How do I calculate the factorial of a non-integer number?
The factorial of a non-integer is given by x! = Γ(x+1). For example, 3.5! = Γ(4.5). Just input x+1 into the calculator.
Can I use this calculator for the incomplete gamma function?
No, this calculator only provides the complete gamma function Γ(x). For the incomplete gamma function, you need a specific tool.