<div dir="ltr"><div><div>In an attempt to analyze the accuracy of hyp2f1,<br>Different cases mentioned in Abramowitz (<a href="http://bl-1.com/click/load/UmcPPANhUGxVMQNuUGU-b0231" target="_blank">http://people.math.sfu.ca/~cbm/aands/page_561.htm</a>)<br>



</div>and also in the Thesis on 'Computation of Hypergeometric functions" <br>(<a href="http://bl-1.com/click/load/VmMBMlw-b0221ADxRNVI-b0169BDY-b0231" target="_blank">http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdf</a>, pg 65-66)<br>



were tried out, and the function fails without warning when: <br>    c<0, c is not integral<br><div>   |c|>>|a| and |b|<br></div><div>  <br></div><div>For example:<br></div><div>sp.hyp2f1(10,5,-300.5,0.5)<br>
</div><div>>>-6.5184949735e+156<br></div><div>while the answer is<br></div>    <b>-3.8520770815e+32<br></b></div><div>this case appears to filter down to hys2f1 in the source code (scipy.special.cephes.hyp2f1) <br>
</div><div><br>I tried the same input in mpmath to check if it works there:<br>hyp2f1(10,5,-300.5,0.5)<br>>>mpf('0.9211827166328477893913199888')<br></div><div>which is the solution when we apply power series expansion.<br>
<br></div><div>however MATLAB succeeds in giving the required solution.<br></div><div>Another interesting fact is that of the methods mentioned in the thesis:<br></div><div>Taylor series expansion, fraction method with double precision,<br>
</div><div>Gauss-Jacobi method and RK4), none succeeds in the given case.<br></div><div><br><br></div><div>I don't have any idea how the function itself is evaluated in the given case.<br></div><div>Any leads on how it is done and how MATLAB executes it?<br>
<br></div><img alt="" src="http://bl-1.com/img/AzMIPl04UWxQOQZrATc-b0231.gif" height="1" width="1"></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 20, 2014 at 1:16 AM, Jennifer stone <span dir="ltr"><<a href="mailto:jenny.stone125@gmail.com" target="_blank">jenny.stone125@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div class="">If you are interested in the hypergeometric numerical evaluation, it's<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


probably a good idea to take a look at this recent master's thesis<br>
written on the problem:<br>
<br>
<a href="http://bl-1.com/click/load/BDEKOABvUWAAYgNhATc-b0231" target="_blank">http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdf</a><br>
<br></blockquote></div><div>The thesis is really comprehensive and detailed with quite convincing<br></div><div>conclusions on the methods to be used with varying a,b,x (though I am<br></div><div>yet to read the thesis properly enough understand and validate each <br>

of the multitude of the cases for the boundaries for the parameters). <br>It seems to be an assuring and reliable walk through for the project.<br>   <br></div><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


This may give some systematic overview on the range of methods<br>
available. (Note that for copyright reasons, it's not a good idea to<br>
look closely at the source codes linked from that thesis, as they are<br>
not available under a compatible license.)<br>
<br>
It may well be that the best approach for evaluating these functions,<br>
if accuracy in the whole parameter range is wanted, in the end turns<br>
out to require arbitrary-precision computations.  In that case, it<br>
would be a very good idea to look at how the problem is approached in<br>
mpmath. There are existing multiprecision packages written in C, and<br>
using one of them in scipy.special could bring better evaluation<br>
performance even if the algorithm is the same.<span><font color="#888888"><br></font></span></blockquote><div> </div></div><div>Yeah, this seems to be brilliant idea. mpmath too, I assume, must have <br>used some of the methods mentioned in the thesis. I ll look through the<br>

</div><div>code and get back.<br><br></div><div>I am still unaware of the complexity of project expected at GSoC. This project<br></div><div>looks engaging to me. Will an attempt to improve both Spherical harmonic <br>functions ( improving the present algorithm to avoid the calculation for <br>

lower n's and m's) and hypergeometric functions be too ambitious or <br>is it doable?<br><br></div><div>Regards<br></div><div>Jennifer <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span><font color="#888888">
--<br>
Pauli Virtanen<br>
</font></span><div><div><br>
</div></div></blockquote></div><br></div><img alt="" src="http://bl-1.com/img/UWFabwNjUmFfPwNiBzM-b0231.gif" height="1" width="1"></div>
</blockquote></div><br></div>