Ask Your Question

numerical value of hypergeometric function

asked 2016-01-31 02:31:56 -0500

this post is marked as community wiki

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 flag offensive close merge delete


Where does your supposed "right answer" come from ?

FrédéricC gravatar imageFrédéricC ( 2016-02-01 12:54:15 -0500 )edit

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

cxrjdd gravatar imagecxrjdd ( 2016-02-13 02:01:57 -0500 )edit

2 answers

Sort by » oldest newest most voted

answered 2016-02-16 14:32:41 -0500

FrédéricC gravatar image

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()

So the simplification is not perfect.

edit flag offensive delete link more



sage: QQ(v)
Traceback (most recent call last):
TypeError: unable to convert hypergeometric((1/3, 2/3), (5/6,), 27/32) to a rational
vdelecroix gravatar imagevdelecroix ( 2016-02-17 08:13:45 -0500 )edit

answered 2016-02-18 13:19:38 -0500

cxrjdd gravatar image

Thank you for telling me the correct usage.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-01-31 02:31:56 -0500

Seen: 203 times

Last updated: Feb 18 '16