[Scipy-tickets] [SciPy] #1296: associated legendre polynomials in scipy.special fail for calculations with degree higher than approx. 22

SciPy Trac scipy-tickets@scipy....
Sun Oct 10 06:25:05 CDT 2010


#1296: associated legendre polynomials in scipy.special fail for calculations with
degree higher than approx. 22
------------------------------+---------------------------------------------
 Reporter:  josip.mihaljevic  |       Owner:  pv   
     Type:  defect            |      Status:  new  
 Priority:  high              |   Milestone:  0.9.0
Component:  scipy.special     |     Version:  0.7.0
 Keywords:  legendre          |  
------------------------------+---------------------------------------------

Comment(by pv):

 The implementation LPMV comes from specfun.f, and does not seem to do any
 down-recursion on the degree.

 If we had an implementation for the regularized hypergeometric function,
 we could use the relation to `hyp2f1`, since that implementation does have
 degree down-recursion. But without the regularization the implementation
 has to look like this:
 {{{
 import scipy.special as sc
 def assoc_leg(m,v,x):
     m = m * (1 + 1e-13) # remove gamma(c) divergence
     return ((1+x)/(1-x))**(m/2.) * sc.hyp2f1(-v, v+1, 1-m,
 (1-x)/2)/sc.gamma(1-m)
 }}}
 I don't know if modifying our `hyp2f1` implementation to produce the
 regularized function `hyp2f1(a,b,c,z)/gamma(c)` would be easy.

 If not, then the best option might be to implement the degree down-
 recursion in LPMV.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1296#comment:3>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list