mars.tensor.special.gammasgn#
- mars.tensor.special.gammasgn(x, **kwargs)[source]#
Sign of the gamma function.
It is defined as
\[\begin{split}\text{gammasgn}(x) = \begin{cases} +1 & \Gamma(x) > 0 \\ -1 & \Gamma(x) < 0 \end{cases}\end{split}\]where \(\Gamma\) is the gamma function; see gamma. This definition is complete since the gamma function is never zero; see the discussion after [dlmf].
- Parameters
x (array_like) – Real argument
- Returns
Sign of the gamma function
- Return type
scalar or ndarray
Notes
The gamma function can be computed as
gammasgn(x) * np.exp(gammaln(x))
.See also
References
- dlmf
NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/5.2#E1