jax.scipy.special.gammasgn#

jax.scipy.special.gammasgn(x)[源码]#

伽玛函数的符号。

JAX 对 scipy.special.gammasgn 的实现。

\[\begin{split}\mathrm{gammasgn}(x) = \begin{cases} +1 & \Gamma(x) > 0 \\ -1 & \Gamma(x) < 0 \end{cases}\end{split}\]

其中 \(\Gamma\)gamma() 函数。由于 \(\Gamma(x)\) 永远不为零,因此不需要对此情况进行特殊处理。

  • 如果 \(x = -\infty\),则返回 NaN。

  • 如果 \(x = \pm 0\),则返回 \(\pm 1\)

  • 如果 \(x\) 是负整数,则返回 NaN。在负整数处伽玛函数的符号取决于从哪一侧逼近极点。

  • 如果 \(x = \infty\),则返回 \(1\)

  • 如果 \(x\) 是 NaN,则返回 NaN。

参数:

x (ArrayLike) – 类数组,实数值。

返回:

包含伽玛函数符号的数组

返回类型:

Array

另请参阅