# numerical value of hypergeometric function This post is a wiki. Anyone with karma >750 is welcome to improve it.

I want to compute the value of hypergeometric 2F1 like this

a=1/3; b=2/3; c=5/6; x=27/32
print n(hypergeometric([2,1],[a,b,c],x)


Sagemath answered 16.9608452387059. But this should be 8/5=1.60000000. All the other numerical values are also unreliable.

I hope this will be fixed in the next version.

edit retag close merge delete

The special value of the hypergeometric 2F1 can be found in http://mathworld.wolfram.com/HypergeometricFunction.html (this page) or maybe its reference. By the way, 8/6 in my posting is typo.　Correctly, this is 8/5.

Sort by » oldest newest most voted Just a matter of syntax (read the doc). You do not need to give [2,1] as parameters, only the actual parameters of the 2F1.

sage: a=1/3; b=2/3; c=5/6; x=27/32
sage: v=hypergeometric([a,b],[c],x)
sage: v.hypergeometric_simplify()
1/5*5^(11/12)*3^(1/4)*assoc_legendre_p(-2/3, 1/6, -11/16)*gamma(5/6)
sage: v.n()
1.60000000000000


So the simplification is not perfect.

more

Indeed

sage: QQ(v)
Traceback (most recent call last):
...
TypeError: unable to convert hypergeometric((1/3, 2/3), (5/6,), 27/32) to a rational


Thank you for telling me the correct usage.

more