RGAMMA
The reciprocal gamma function is defined as the inverse of the gamma function and is often used to avoid overflow in formulas that place gamma terms in denominators.
It is given by:
\operatorname{rgamma}(x)=\frac{1}{\Gamma(x)}
Unlike \Gamma(x), this reciprocal form is entire and has zeros at nonpositive integers.
Excel Usage
=RGAMMA(x)
x(float, required): Real argument for the reciprocal gamma function.
Returns (float): Reciprocal gamma function value at the input.
Example 1: Reciprocal gamma at one
Inputs:
| x |
|---|
| 1 |
Excel formula:
=RGAMMA(1)
Expected output:
1
Example 2: Reciprocal gamma at four
Inputs:
| x |
|---|
| 4 |
Excel formula:
=RGAMMA(4)
Expected output:
0.166667
Example 3: Reciprocal gamma at one-half
Inputs:
| x |
|---|
| 0.5 |
Excel formula:
=RGAMMA(0.5)
Expected output:
0.56419
Example 4: Reciprocal gamma at a nonpositive integer
Inputs:
| x |
|---|
| 0 |
Excel formula:
=RGAMMA(0)
Expected output:
0
Python Code
from scipy.special import rgamma as scipy_rgamma
def rgamma(x):
"""
Compute the reciprocal of the gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.rgamma.html
This example function is provided as-is without any representation of accuracy.
Args:
x (float): Real argument for the reciprocal gamma function.
Returns:
float: Reciprocal gamma function value at the input.
"""
try:
return float(scipy_rgamma(x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Real argument for the reciprocal gamma function.