Gamma Beta Functions
Overview
Gamma and beta functions are core special functions that extend factorial-style algebra to real and complex domains and connect directly to probability, Bayesian modeling, and asymptotic analysis. In applied work, these functions appear in normalization constants, cumulative distribution mappings, and stable evaluation of extreme magnitudes. The key idea is that Gamma/Beta structures provide continuous analogs of discrete combinatorial quantities while preserving useful recurrence and integral identities. This makes them foundational in scientific computing, from statistical inference pipelines to PDE and integral-transform methods.
The unifying concepts are complete vs. incomplete forms, regularization, and log-domain stability. The complete gamma and beta functions are linked by B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}, while regularized incomplete forms map integrals onto bounded probability-like ranges in [0,1]. Derivative families such as digamma and polygamma capture local sensitivity of \log\Gamma(x), and shifted products like the Pochhammer symbol represent rising factorial structure used in series expansions and hypergeometric models.
Implementation: This category is implemented with SciPy Special, specifically the scipy.special gamma-and-related toolkit. SciPy’s implementations are designed for numerical robustness across wide parameter ranges, including cases where direct evaluation would overflow, underflow, or lose precision.
The beta-family tools handle complete, logarithmic, incomplete, and inverse-incomplete variants: BETA, BETALN, BETAINC, and BETAINCINV. BETA evaluates Euler’s beta function for analytic formulas and normalization constants, while BETALN provides stable log-domain computation when direct values are too large or too small to represent safely. BETAINC computes the regularized incomplete beta map used in cumulative probability workflows (for example, beta-binomial and order-statistic relations), and BETAINCINV inverts that mapping to recover quantiles or thresholds. Together, these functions support forward and inverse probability calculations in bounded domains.
The gamma core and incomplete gamma set provides complete values and complementary cumulative structure through GAMMA, RGAMMA, GAMMALN, GAMMAINC, GAMMAINCC, GAMMAINCINV, and GAMMAINCCINV. GAMMA is the direct evaluator, while RGAMMA supplies the reciprocal form that can be numerically preferable near poles or in algebraic rearrangements. GAMMALN is essential for stable likelihoods and combinatorial log-expressions. The regularized lower/upper incomplete pair GAMMAINC and GAMMAINCC enables CDF/survival-style workflows, and their inverse functions GAMMAINCINV and GAMMAINCCINV provide quantile recovery for threshold design and calibration.
The derivative and rising-factorial tools capture higher-order structure with DIGAMMA, POLYGAMMA, and POCH. DIGAMMA is the logarithmic derivative of gamma and appears in gradient-based estimators, variational Bayes updates, and entropy-related identities. POLYGAMMA extends this to higher derivatives for curvature and sensitivity analysis. POCH computes the rising factorial (x)_m, a compact bridge between gamma ratios and series coefficients in hypergeometric and orthogonal-function expansions.
BETAINC
The regularized incomplete beta function evaluates a normalized cumulative integral of beta-kernel terms. It is widely used in cumulative probability calculations and ratio-based special-function identities.
It is defined as:
I_x(a,b)=\frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\int_0^x t^{a-1}(1-t)^{b-1}\,dt
for positive a,b and 0\le x\le 1. This wrapper returns the regularized value in [0,1].
Excel Usage
=BETAINC(a, b, x)
a(float, required): First positive shape parameter.b(float, required): Second positive shape parameter.x(float, required): Upper integration bound in the unit interval.
Returns (float): Regularized incomplete beta value for the given parameters.
Example 1: Regularized incomplete beta at upper bound one
Inputs:
| a | b | x |
|---|---|---|
| 0.2 | 3.5 | 1 |
Excel formula:
=BETAINC(0.2, 3.5, 1)
Expected output:
1
Example 2: Regularized incomplete beta at midpoint
Inputs:
| a | b | x |
|---|---|---|
| 1.4 | 3.1 | 0.5 |
Excel formula:
=BETAINC(1.4, 3.1, 0.5)
Expected output:
0.81489
Example 3: Regularized incomplete beta with moderate shapes
Inputs:
| a | b | x |
|---|---|---|
| 2.2 | 3.1 | 0.4 |
Excel formula:
=BETAINC(2.2, 3.1, 0.4)
Expected output:
0.493396
Example 4: Regularized incomplete beta at lower bound zero
Inputs:
| a | b | x |
|---|---|---|
| 2 | 5 | 0 |
Excel formula:
=BETAINC(2, 5, 0)
Expected output:
0
Python Code
Show Code
from scipy.special import betainc as scipy_betainc
def betainc(a, b, x):
"""
Compute the regularized incomplete beta function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.betainc.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): First positive shape parameter.
b (float): Second positive shape parameter.
x (float): Upper integration bound in the unit interval.
Returns:
float: Regularized incomplete beta value for the given parameters.
"""
try:
if a <= 0 or b <= 0:
return "Error: a and b must be positive"
if x < 0 or x > 1:
return "Error: x must be between 0 and 1"
return float(scipy_betainc(a, b, x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
BETAINCINV
This function solves for the unit-interval argument x in the regularized incomplete beta relation for fixed positive parameters a and b.
It finds x such that:
y = I_x(a,b)
where I_x(a,b) is the regularized incomplete beta function. The output lies in [0,1] when inputs are in-domain.
Excel Usage
=BETAINCINV(a, b, y)
a(float, required): First positive shape parameter.b(float, required): Second positive shape parameter.y(float, required): Regularized incomplete beta target value in the unit interval.
Returns (float): Unit-interval x value satisfying the inverse regularized incomplete beta equation.
Example 1: Inverse regularized incomplete beta at central probability
Inputs:
| a | b | y |
|---|---|---|
| 1.2 | 3.1 | 0.5 |
Excel formula:
=BETAINCINV(1.2, 3.1, 0.5)
Expected output:
0.242835
Example 2: Inverse regularized incomplete beta at low probability
Inputs:
| a | b | y |
|---|---|---|
| 2 | 5 | 0.1 |
Excel formula:
=BETAINCINV(2, 5, 0.1)
Expected output:
0.0925953
Example 3: Inverse regularized incomplete beta at high probability
Inputs:
| a | b | y |
|---|---|---|
| 7.5 | 0.4 | 0.8 |
Excel formula:
=BETAINCINV(7.5, 0.4, 0.8)
Expected output:
0.998143
Example 4: Inverse regularized incomplete beta at zero
Inputs:
| a | b | y |
|---|---|---|
| 2 | 2 | 0 |
Excel formula:
=BETAINCINV(2, 2, 0)
Expected output:
0
Python Code
Show Code
from scipy.special import betaincinv as scipy_betaincinv
def betaincinv(a, b, y):
"""
Invert the regularized incomplete beta function with respect to x.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.betaincinv.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): First positive shape parameter.
b (float): Second positive shape parameter.
y (float): Regularized incomplete beta target value in the unit interval.
Returns:
float: Unit-interval x value satisfying the inverse regularized incomplete beta equation.
"""
try:
if a <= 0 or b <= 0:
return "Error: a and b must be positive"
if y < 0 or y > 1:
return "Error: y must be between 0 and 1"
return float(scipy_betaincinv(a, b, y))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
BETALN
The log-beta function returns the natural logarithm of the absolute beta function value, which is useful for stable numerical work when direct beta values are too small or too large for floating-point representation.
It computes:
\ln\left|B(a,b)\right|
where B(a,b) is the Euler beta function. This wrapper uses SciPy’s implementation for real-valued parameters.
Excel Usage
=BETALN(a, b)
a(float, required): First positive shape parameter.b(float, required): Second positive shape parameter.
Returns (float): Natural log of the absolute beta function value.
Example 1: Log-beta with moderate parameters
Inputs:
| a | b |
|---|---|
| 3 | 4 |
Excel formula:
=BETALN(3, 4)
Expected output:
-4.09434
Example 2: Log-beta with equal parameters
Inputs:
| a | b |
|---|---|
| 2.5 | 2.5 |
Excel formula:
=BETALN(2.5, 2.5)
Expected output:
-2.60869
Example 3: Log-beta with large parameters
Inputs:
| a | b |
|---|---|
| 400 | 900 |
Excel formula:
=BETALN(400, 900)
Expected output:
-804.307
Example 4: Log-beta with fractional parameters
Inputs:
| a | b |
|---|---|
| 0.7 | 1.3 |
Excel formula:
=BETALN(0.7, 1.3)
Expected output:
0.152692
Python Code
Show Code
from scipy.special import betaln as scipy_betaln
def betaln(a, b):
"""
Compute the natural logarithm of the absolute beta function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.betaln.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): First positive shape parameter.
b (float): Second positive shape parameter.
Returns:
float: Natural log of the absolute beta function value.
"""
try:
return float(scipy_betaln(a, b))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
DIGAMMA
The digamma function is the first logarithmic derivative of the gamma function and appears in optimization, Bayesian updates, and asymptotic expansions involving gamma terms.
It is defined as:
\psi(x)=\frac{d}{dx}\ln\Gamma(x)
This wrapper evaluates the real-valued digamma function using SciPy’s implementation.
Excel Usage
=DIGAMMA(x)
x(float, required): Real argument for the digamma function.
Returns (float): Digamma function value at the input.
Example 1: Digamma at one
Inputs:
| x |
|---|
| 1 |
Excel formula:
=DIGAMMA(1)
Expected output:
-0.577216
Example 2: Digamma at two
Inputs:
| x |
|---|
| 2 |
Excel formula:
=DIGAMMA(2)
Expected output:
0.422784
Example 3: Digamma at positive fraction
Inputs:
| x |
|---|
| 0.5 |
Excel formula:
=DIGAMMA(0.5)
Expected output:
-1.96351
Example 4: Digamma at larger positive input
Inputs:
| x |
|---|
| 10 |
Excel formula:
=DIGAMMA(10)
Expected output:
2.25175
Python Code
Show Code
from scipy.special import digamma as scipy_digamma
def digamma(x):
"""
Compute the digamma function for a real input.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.digamma.html
This example function is provided as-is without any representation of accuracy.
Args:
x (float): Real argument for the digamma function.
Returns:
float: Digamma function value at the input.
"""
try:
return float(scipy_digamma(x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
EULER_BETA
The Euler beta function is a symmetric two-parameter special function that appears in probability distributions, integral transforms, and normalization constants.
It can be defined by an integral on [0,1] and by gamma functions:
B(a,b)=\int_0^1 t^{a-1}(1-t)^{b-1}\,dt
B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}
This wrapper evaluates B(a,b) using SciPy.
Excel Usage
=EULER_BETA(a, b)
a(float, required): First real shape parameter.b(float, required): Second real shape parameter.
Returns (float): Beta function value for the given parameters.
Example 1: Beta with integer parameters
Inputs:
| a | b |
|---|---|
| 2 | 3 |
Excel formula:
=EULER_BETA(2, 3)
Expected output:
0.0833333
Example 2: Beta with non-integer parameters
Inputs:
| a | b |
|---|---|
| 1.7 | 2.4 |
Excel formula:
=EULER_BETA(1.7, 2.4)
Expected output:
0.165675
Example 3: Beta with first parameter equal to one
Inputs:
| a | b |
|---|---|
| 1 | 4 |
Excel formula:
=EULER_BETA(1, 4)
Expected output:
0.25
Example 4: Beta with small positive shape parameters
Inputs:
| a | b |
|---|---|
| 0.5 | 0.5 |
Excel formula:
=EULER_BETA(0.5, 0.5)
Expected output:
3.14159
Python Code
Show Code
from scipy.special import beta as scipy_beta
def euler_beta(a, b):
"""
Evaluate the Euler beta function for two real parameters.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.beta.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): First real shape parameter.
b (float): Second real shape parameter.
Returns:
float: Beta function value for the given parameters.
"""
try:
return float(scipy_beta(a, b))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMA
The gamma function extends the factorial to non-integer real values through an integral definition and analytic continuation. For positive integers, it satisfies \Gamma(n+1)=n!, making it a fundamental building block in probability, statistics, and special-function identities.
For real x>0, it is defined by:
\Gamma(x)=\int_0^{\infty} t^{x-1}e^{-t}\,dt
This wrapper computes \Gamma(x) for a scalar real argument using SciPy’s special functions implementation.
Excel Usage
=GAMMA(x)
x(float, required): Real argument for the gamma function.
Returns (float): Gamma function value at the input.
Example 1: Gamma at one-half
Inputs:
| x |
|---|
| 0.5 |
Excel formula:
=GAMMA(0.5)
Expected output:
1.77245
Example 2: Gamma at six equals factorial of five
Inputs:
| x |
|---|
| 6 |
Excel formula:
=GAMMA(6)
Expected output:
120
Example 3: Gamma at positive fractional input
Inputs:
| x |
|---|
| 2.5 |
Excel formula:
=GAMMA(2.5)
Expected output:
1.32934
Example 4: Gamma at negative non-integer input
Inputs:
| x |
|---|
| -0.5 |
Excel formula:
=GAMMA(-0.5)
Expected output:
-3.54491
Python Code
Show Code
from scipy.special import gamma as scipy_gamma
def gamma(x):
"""
Evaluate the gamma function for a real input.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gamma.html
This example function is provided as-is without any representation of accuracy.
Args:
x (float): Real argument for the gamma function.
Returns:
float: Gamma function value at the input.
"""
try:
return float(scipy_gamma(x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMAINC
The regularized lower incomplete gamma function gives the normalized lower-tail accumulation of the gamma kernel and is commonly used in cumulative gamma-distribution calculations.
It is defined by:
P(a,x)=\frac{1}{\Gamma(a)}\int_0^x t^{a-1}e^{-t}\,dt
for a>0 and x\ge 0. This wrapper returns the lower regularized value in [0,1].
Excel Usage
=GAMMAINC(a, x)
a(float, required): Positive shape parameter.x(float, required): Nonnegative argument.
Returns (float): Regularized lower incomplete gamma value.
Example 1: Lower incomplete gamma at origin
Inputs:
| a | x |
|---|---|
| 0.5 | 0 |
Excel formula:
=GAMMAINC(0.5, 0)
Expected output:
0
Example 2: Lower incomplete gamma at one
Inputs:
| a | x |
|---|---|
| 0.5 | 1 |
Excel formula:
=GAMMAINC(0.5, 1)
Expected output:
0.842701
Example 3: Lower incomplete gamma at moderate input
Inputs:
| a | x |
|---|---|
| 2 | 3 |
Excel formula:
=GAMMAINC(2, 3)
Expected output:
0.800852
Example 4: Lower incomplete gamma near saturation
Inputs:
| a | x |
|---|---|
| 0.5 | 10 |
Excel formula:
=GAMMAINC(0.5, 10)
Expected output:
0.999992
Python Code
Show Code
from scipy.special import gammainc as scipy_gammainc
def gammainc(a, x):
"""
Compute the regularized lower incomplete gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammainc.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): Positive shape parameter.
x (float): Nonnegative argument.
Returns:
float: Regularized lower incomplete gamma value.
"""
try:
if a <= 0:
return "Error: a must be positive"
if x < 0:
return "Error: x must be nonnegative"
return float(scipy_gammainc(a, x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMAINCC
The regularized upper incomplete gamma function gives the normalized upper-tail accumulation of the gamma kernel and complements the lower regularized form.
It is defined by:
Q(a,x)=\frac{1}{\Gamma(a)}\int_x^{\infty} t^{a-1}e^{-t}\,dt
for a>0 and x\ge 0. It satisfies P(a,x)+Q(a,x)=1 with the lower function P.
Excel Usage
=GAMMAINCC(a, x)
a(float, required): Positive shape parameter.x(float, required): Nonnegative argument.
Returns (float): Regularized upper incomplete gamma value.
Example 1: Upper incomplete gamma at origin
Inputs:
| a | x |
|---|---|
| 0.5 | 0 |
Excel formula:
=GAMMAINCC(0.5, 0)
Expected output:
1
Example 2: Upper incomplete gamma at one
Inputs:
| a | x |
|---|---|
| 0.5 | 1 |
Excel formula:
=GAMMAINCC(0.5, 1)
Expected output:
0.157299
Example 3: Upper incomplete gamma at moderate input
Inputs:
| a | x |
|---|---|
| 2 | 3 |
Excel formula:
=GAMMAINCC(2, 3)
Expected output:
0.199148
Example 4: Upper incomplete gamma near zero tail
Inputs:
| a | x |
|---|---|
| 0.5 | 10 |
Excel formula:
=GAMMAINCC(0.5, 10)
Expected output:
0.00000774422
Python Code
Show Code
from scipy.special import gammaincc as scipy_gammaincc
def gammaincc(a, x):
"""
Compute the regularized upper incomplete gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammaincc.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): Positive shape parameter.
x (float): Nonnegative argument.
Returns:
float: Regularized upper incomplete gamma value.
"""
try:
if a <= 0:
return "Error: a must be positive"
if x < 0:
return "Error: x must be nonnegative"
return float(scipy_gammaincc(a, x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMAINCCINV
This function solves for the nonnegative argument x in the regularized upper incomplete gamma equation for a fixed positive shape parameter.
It finds x such that:
y=Q(a,x)
where Q(a,x) is the regularized upper incomplete gamma function. For valid inputs, the output decreases as y increases.
Excel Usage
=GAMMAINCCINV(a, y)
a(float, required): Positive shape parameter.y(float, required): Upper-tail target value in the unit interval.
Returns (float): Nonnegative x value satisfying the inverse upper incomplete gamma equation.
Example 1: Inverse upper incomplete gamma at zero probability
Inputs:
| a | y |
|---|---|
| 0.5 | 0 |
Excel formula:
=GAMMAINCCINV(0.5, 0)
Expected output:
"Infinity"
Example 2: Inverse upper incomplete gamma at tenth probability
Inputs:
| a | y |
|---|---|
| 0.5 | 0.1 |
Excel formula:
=GAMMAINCCINV(0.5, 0.1)
Expected output:
1.35277
Example 3: Inverse upper incomplete gamma at median probability
Inputs:
| a | y |
|---|---|
| 2 | 0.5 |
Excel formula:
=GAMMAINCCINV(2, 0.5)
Expected output:
1.67835
Example 4: Inverse upper incomplete gamma at one probability
Inputs:
| a | y |
|---|---|
| 1.5 | 1 |
Excel formula:
=GAMMAINCCINV(1.5, 1)
Expected output:
0
Python Code
Show Code
from scipy.special import gammainccinv as scipy_gammainccinv
def gammainccinv(a, y):
"""
Invert the regularized upper incomplete gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammainccinv.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): Positive shape parameter.
y (float): Upper-tail target value in the unit interval.
Returns:
float: Nonnegative x value satisfying the inverse upper incomplete gamma equation.
"""
try:
if a <= 0:
return "Error: a must be positive"
if y < 0 or y > 1:
return "Error: y must be between 0 and 1"
return float(scipy_gammainccinv(a, y))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMAINCINV
This function solves for the nonnegative argument x in the regularized lower incomplete gamma equation for a fixed positive shape parameter.
It finds x such that:
y=P(a,x)
where P(a,x) is the regularized lower incomplete gamma function. For valid inputs, the result is nonnegative and increases with y.
Excel Usage
=GAMMAINCINV(a, y)
a(float, required): Positive shape parameter.y(float, required): Lower-tail target value in the unit interval.
Returns (float): Nonnegative x value satisfying the inverse lower incomplete gamma equation.
Example 1: Inverse lower incomplete gamma at zero probability
Inputs:
| a | y |
|---|---|
| 0.5 | 0 |
Excel formula:
=GAMMAINCINV(0.5, 0)
Expected output:
0
Example 2: Inverse lower incomplete gamma at tenth probability
Inputs:
| a | y |
|---|---|
| 0.5 | 0.1 |
Excel formula:
=GAMMAINCINV(0.5, 0.1)
Expected output:
0.00789539
Example 3: Inverse lower incomplete gamma at median probability
Inputs:
| a | y |
|---|---|
| 2 | 0.5 |
Excel formula:
=GAMMAINCINV(2, 0.5)
Expected output:
1.67835
Example 4: Inverse lower incomplete gamma at one probability
Inputs:
| a | y |
|---|---|
| 1.5 | 1 |
Excel formula:
=GAMMAINCINV(1.5, 1)
Expected output:
"Infinity"
Python Code
Show Code
from scipy.special import gammaincinv as scipy_gammaincinv
def gammaincinv(a, y):
"""
Invert the regularized lower incomplete gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammaincinv.html
This example function is provided as-is without any representation of accuracy.
Args:
a (float): Positive shape parameter.
y (float): Lower-tail target value in the unit interval.
Returns:
float: Nonnegative x value satisfying the inverse lower incomplete gamma equation.
"""
try:
if a <= 0:
return "Error: a must be positive"
if y < 0 or y > 1:
return "Error: y must be between 0 and 1"
return float(scipy_gammaincinv(a, y))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
GAMMALN
The log-gamma function on the real axis returns the logarithm of the absolute value of the gamma function. It is useful for numerical stability when gamma values are extremely large or small, because logarithms avoid overflow and underflow in many calculations.
The quantity computed is:
\ln\left|\Gamma(x)\right|
This wrapper evaluates the real-valued log-gamma form implemented by SciPy.
Excel Usage
=GAMMALN(x)
x(float, required): Real argument for the log-gamma function.
Returns (float): Natural log of the absolute gamma function at the input.
Example 1: Log-gamma at one
Inputs:
| x |
|---|
| 1 |
Excel formula:
=GAMMALN(1)
Expected output:
0
Example 2: Log-gamma at two
Inputs:
| x |
|---|
| 2 |
Excel formula:
=GAMMALN(2)
Expected output:
0
Example 3: Log-gamma at fractional input
Inputs:
| x |
|---|
| 3.5 |
Excel formula:
=GAMMALN(3.5)
Expected output:
1.20097
Example 4: Log-gamma at large positive input
Inputs:
| x |
|---|
| 25 |
Excel formula:
=GAMMALN(25)
Expected output:
54.7847
Python Code
Show Code
from scipy.special import gammaln as scipy_gammaln
def gammaln(x):
"""
Compute the natural logarithm of the absolute gamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gammaln.html
This example function is provided as-is without any representation of accuracy.
Args:
x (float): Real argument for the log-gamma function.
Returns:
float: Natural log of the absolute gamma function at the input.
"""
try:
return float(scipy_gammaln(x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
POCH
The Pochhammer symbol, also called the rising factorial, is a core special function in series expansions, hypergeometric functions, and combinatorial identities.
It is defined by a gamma-function ratio:
(z)_m = \frac{\Gamma(z+m)}{\Gamma(z)}
and for positive integer m it equals the product z(z+1)\cdots(z+m-1). This wrapper computes (z)_m for real inputs.
Excel Usage
=POCH(z, m)
z(float, required): Base argument of the rising factorial.m(float, required): Rising amount parameter.
Returns (float): Rising factorial (Pochhammer symbol) value.
Example 1: Pochhammer with zero rise equals one
Inputs:
| z | m |
|---|---|
| 4 | 0 |
Excel formula:
=POCH(4, 0)
Expected output:
1
Example 2: Pochhammer from one matches factorial-like value
Inputs:
| z | m |
|---|---|
| 1 | 5 |
Excel formula:
=POCH(1, 5)
Expected output:
120
Example 3: Pochhammer with fractional parameters
Inputs:
| z | m |
|---|---|
| 3.7 | 2.1 |
Excel formula:
=POCH(3.7, 2.1)
Expected output:
20.5296
Example 4: Pochhammer with integer-like parameters
Inputs:
| z | m |
|---|---|
| 2 | 3 |
Excel formula:
=POCH(2, 3)
Expected output:
24
Python Code
Show Code
from scipy.special import poch as scipy_poch
def poch(z, m):
"""
Evaluate the rising factorial using the Pochhammer symbol.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.poch.html
This example function is provided as-is without any representation of accuracy.
Args:
z (float): Base argument of the rising factorial.
m (float): Rising amount parameter.
Returns:
float: Rising factorial (Pochhammer symbol) value.
"""
try:
return float(scipy_poch(z, m))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
POLYGAMMA
The polygamma family generalizes the digamma function to higher derivatives of the logarithm of the gamma function. It is useful in advanced approximation theory, statistical inference, and special-function series expansions.
For nonnegative integer order n, it is:
\psi^{(n)}(x)=\frac{d^{n+1}}{dx^{n+1}}\ln\Gamma(x)
This wrapper evaluates \psi^{(n)}(x) for real x and integer derivative order.
Excel Usage
=POLYGAMMA(n, x)
n(int, required): Nonnegative derivative order.x(float, required): Real input value.
Returns (float): Polygamma value of the specified order at the input.
Example 1: Zeroth-order polygamma equals digamma
Inputs:
| n | x |
|---|---|
| 0 | 3 |
Excel formula:
=POLYGAMMA(0, 3)
Expected output:
0.922784
Example 2: First-order polygamma at moderate input
Inputs:
| n | x |
|---|---|
| 1 | 3 |
Excel formula:
=POLYGAMMA(1, 3)
Expected output:
0.394934
Example 3: Second-order polygamma at larger input
Inputs:
| n | x |
|---|---|
| 2 | 10 |
Excel formula:
=POLYGAMMA(2, 10)
Expected output:
-0.0110498
Example 4: First-order polygamma at fractional input
Inputs:
| n | x |
|---|---|
| 1 | 2.5 |
Excel formula:
=POLYGAMMA(1, 2.5)
Expected output:
0.490358
Python Code
Show Code
from scipy.special import polygamma as scipy_polygamma
def polygamma(n, x):
"""
Compute the n-th derivative of the digamma function.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.polygamma.html
This example function is provided as-is without any representation of accuracy.
Args:
n (int): Nonnegative derivative order.
x (float): Real input value.
Returns:
float: Polygamma value of the specified order at the input.
"""
try:
if n < 0:
return "Error: n must be nonnegative"
return float(scipy_polygamma(n, x))
except Exception as e:
return f"Error: {str(e)}"Online Calculator
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
Show 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