[Numpy-discussion] Suggestions for GSoC Projects

Pauli Virtanen pav at iki.fi
Sun Feb 23 08:58:03 EST 2014


23.02.2014 15:18, Jennifer stone kirjoitti:
[clip]
> I tried the same input in mpmath to check if it works there:
> hyp2f1(10,5,-300.5,0.5)
>
>>> mpf('0.9211827166328477893913199888')
>
> which is the solution when we apply power series expansion.

Typically, you need to tell mpmath to use an appropriate precision for
the evaluation:

>>> mpmath.mp.dps = 300
>>> float(mpmath.hyp2f1('10','5','-300.5','0.5'))
-3.8520270815239185e+32

> however MATLAB succeeds in giving the required solution.
> Another interesting fact is that of the methods mentioned in the thesis:
> Taylor series expansion, fraction method with double precision,
> Gauss-Jacobi method and RK4), none succeeds in the given case.
>
> I don't have any idea how the function itself is evaluated in the given
> case. Any leads on how it is done and how MATLAB executes it?

You can look in their documentation what references the implementation
is based on. However, it's not a good idea to go beyond that in
wondering how it does things --- from legal POV and from fair play.

    ***

What can help in hyp2f1 for large values of a,b,c is use of recurrence
relations. These are typically stable in one direction only. [1] This
seems to be still a partially open research question...

Our current hyp2f1 implementation does use recurrences (hyp2f1ra), but
perhaps they are not invoked for this case. The problem here can be the
accurate determination of the convergence region for each parameter value.

[1] http://www.ams.org/journals/mcom/2007-76-259/S0025-5718-07-01918-7/

-- 
Pauli Virtanen





More information about the NumPy-Discussion mailing list