本文整理汇总了Python中sympy.digamma函数的典型用法代码示例。如果您正苦于以下问题:Python digamma函数的具体用法?Python digamma怎么用?Python digamma使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了digamma函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gruntz_eval_special_slow
def test_gruntz_eval_special_slow():
sskip()
assert gruntz(gamma(x+1)/sqrt(2*pi)
- exp(-x)*(x**(x+S(1)/2) + x**(x-S(1)/2)/12), x, oo) == oo
assert gruntz(exp(exp(exp(digamma(digamma(digamma(x))))))/x, x, oo) == 0
# XXX This sometimes fails!!!
assert gruntz(exp(gamma(x-exp(-x))*exp(1/x)) - exp(gamma(x)), x, oo) == oo
示例2: test_beta
def test_beta():
x, y = Symbol('x'), Symbol('y')
assert isinstance(beta(x, y), beta)
assert expand_func(beta(x, y)) == gamma(x)*gamma(y)/gamma(x + y)
assert expand_func(beta(x, y) - beta(y, x)) == 0 # Symmetric
assert expand_func(beta(x, y)) == expand_func(beta(x, y + 1) + beta(x + 1, y)).simplify()
assert diff(beta(x, y), x) == beta(x, y)*(digamma(x) - digamma(x + y))
assert diff(beta(x, y), y) == beta(x, y)*(digamma(y) - digamma(x + y))
示例3: test_gruntz_eval_special
def test_gruntz_eval_special():
# Gruntz, p. 126
assert gruntz(exp(x) * (sin(1 / x + exp(-x)) - sin(1 / x + exp(-x ** 2))), x, oo) == 1
assert gruntz((erf(x - exp(-exp(x))) - erf(x)) * exp(exp(x)) * exp(x ** 2), x, oo) == -2 / sqrt(pi)
assert gruntz(exp(exp(x)) * (exp(sin(1 / x + exp(-exp(x)))) - exp(sin(1 / x))), x, oo) == 1
assert gruntz(exp(x) * (gamma(x + exp(-x)) - gamma(x)), x, oo) == oo
assert gruntz(exp(exp(digamma(digamma(x)))) / x, x, oo) == exp(-S(1) / 2)
assert gruntz(exp(exp(digamma(log(x)))) / x, x, oo) == exp(-S(1) / 2)
assert gruntz(digamma(digamma(digamma(x))), x, oo) == oo
assert gruntz(loggamma(loggamma(x)), x, oo) == oo
assert gruntz(((gamma(x + 1 / gamma(x)) - gamma(x)) / log(x) - cos(1 / x)) * x * log(x), x, oo) == -S(1) / 2
assert gruntz(x * (gamma(x - 1 / gamma(x)) - gamma(x) + log(x)), x, oo) == S(1) / 2
assert gruntz((gamma(x + 1 / gamma(x)) - gamma(x)) / log(x), x, oo) == 1
示例4: test_leading_term
def test_leading_term():
from sympy import digamma
assert O(1 / digamma(1 / x)) == O(1 / log(x))
示例5: test_gruntz_eval_special_slow
def test_gruntz_eval_special_slow():
_sskip()
assert gruntz(gamma(x + 1)/sqrt(2*pi)
- exp(-x)*(x**(x + S(1)/2) + x**(x - S(1)/2)/12), x, oo) == oo
assert gruntz(exp(exp(exp(digamma(digamma(digamma(x))))))/x, x, oo) == 0