jax.scipy.special.gamma — JAX documentation (original) (raw)
jax.scipy.special.gamma#
jax.scipy.special.gamma(x)[source]#
The gamma function.
JAX implementation of scipy.special.gamma.
The gamma function is defined for \(\Re(z)>0\) as
\[\mathrm{gamma}(z) = \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}\mathrm{d}t\]
and is extended by analytic continuation to arbitrary complex values z. For positive integers n, the gamma function is related to thefactorial() function via the following identity:
\[\Gamma(n) = (n - 1)!\]
- if \(z = -\infty\), NaN is returned.
- if \(x = \pm 0\), \(\pm \infty\) is returned.
- if \(x\) is a negative integer, NaN is returned. The sign of gamma at a negative integer depends on from which side the pole is approached.
- if \(x = \infty\), \(\infty\) is returned.
- if \(x\) is NaN, NaN is returned.
Parameters:
x (ArrayLike) – arraylike, real valued.
Returns:
array containing the values of the gamma function
Return type:
See also
- jax.scipy.special.factorial(): the factorial function.
- jax.scipy.special.gammaln(): the natural log of the gamma function
- jax.scipy.special.gammasgn(): the sign of the gamma function
Notes
Unlike the scipy version, JAX’s gamma
does not support complex-valued inputs.