我需要计算相当大的x的Gamma(x+1/2)/Gamma(x),如果我只使用http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.gamma.html,它会失败,因为分母和分子都很大。然而,分数本身在sqrt(x)附近。我怎样才能准确地计算出这个分数?
发布于 2013-03-17 19:55:42
您可以使用beta(a, b) = gamma(a) * gamma(b) / gamma(a+b)
from scipy.special import gamma, beta
x = 10
print gamma(x+0.5)/gamma(x)
print gamma(0.5)/beta(x, 0.5)https://stackoverflow.com/questions/15460414
复制相似问题