本文整理汇总了Python中sympy.core.basic.C.hyper方法的典型用法代码示例。如果您正苦于以下问题:Python C.hyper方法的具体用法?Python C.hyper怎么用?Python C.hyper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.core.basic.C
的用法示例。
在下文中一共展示了C.hyper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eval
# 需要导入模块: from sympy.core.basic import C [as 别名]
# 或者: from sympy.core.basic.C import hyper [as 别名]
def eval(cls, n, a, b, x):
# Simplify to other polynomials
# P^{a, a}_n(x)
if a == b:
if a == -S.Half:
return C.RisingFactorial(S.Half, n) / C.factorial(n) * chebyshevt(n, x)
elif a == S.Zero:
return legendre(n, x)
elif a == S.Half:
return C.RisingFactorial(3 * S.Half, n) / C.factorial(n + 1) * chebyshevu(n, x)
else:
return C.RisingFactorial(a + 1, n) / C.RisingFactorial(2 * a + 1, n) * gegenbauer(n, a + S.Half, x)
elif b == -a:
# P^{a, -a}_n(x)
return (
C.gamma(n + a + 1) / C.gamma(n + 1) * (1 + x) ** (a / 2) / (1 - x) ** (a / 2) * assoc_legendre(n, -a, x)
)
elif a == -b:
# P^{-b, b}_n(x)
return (
C.gamma(n - b + 1) / C.gamma(n + 1) * (1 - x) ** (b / 2) / (1 + x) ** (b / 2) * assoc_legendre(n, b, x)
)
if not n.is_Number:
# Symbolic result P^{a,b}_n(x)
# P^{a,b}_n(-x) ---> (-1)**n * P^{b,a}_n(-x)
if x.could_extract_minus_sign():
return S.NegativeOne ** n * jacobi(n, b, a, -x)
# We can evaluate for some special values of x
if x == S.Zero:
return (
2 ** (-n)
* C.gamma(a + n + 1)
/ (C.gamma(a + 1) * C.factorial(n))
* C.hyper([-b - n, -n], [a + 1], -1)
)
if x == S.One:
return C.RisingFactorial(a + 1, n) / C.factorial(n)
elif x == S.Infinity:
if n.is_positive:
# TODO: Make sure a+b+2*n \notin Z
return C.RisingFactorial(a + b + n + 1, n) * S.Infinity
else:
# n is a given fixed integer, evaluate into polynomial
return jacobi_poly(n, a, b, x)