mars.tensor.special.gammasgn¶
- mars.tensor.special.gammasgn(x, **kwargs)[源代码]¶
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].
- 参数
x (array_like) – Real argument
- 返回
Sign of the gamma function
- 返回类型
scalar or ndarray
提示
The gamma function can be computed as
gammasgn(x) * np.exp(gammaln(x))
.参见
引用
- dlmf
NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/5.2#E1