maxframe.tensor.special.gammasgn#
- maxframe.tensor.special.gammasgn(x, out=None)[源代码]#
伽马函数的符号。
其定义为
\[\begin{split}\text{gammasgn}(x) = \begin{cases} +1 & \Gamma(x) > 0 \\ -1 & \Gamma(x) < 0 \end{cases}\end{split}\]其中 \(\Gamma\) 是伽马函数;参见 gamma。此定义是完整的,因为伽马函数永不为零;详见 [dlmf] 之后的讨论。
- 参数:
x (array_like) -- 实数参数
out (ndarray, optional) -- 可选的输出数组,用于存储函数值
- 返回:
伽马函数的符号
- 返回类型:
scalar or ndarray
备注
伽马函数可以计算为
gammasgn(x) * np.exp(gammaln(x))。引用
[dlmf]NIST 数学函数数字图书馆 https://dlmf.nist.gov/5.2#E1