Subject: Re: Stable Recurrence

From: [email-masked]
Date: Wed, 27 Jan 1993 13:02:29 CET

Subject: Stable Recurrence relations.

Dear Netters,

>From Dr. Surya Panigrahy at Duke (<[email-masked]> and

>       It would be of great help if  any one can give me references to
> stable recurrence relations for Associated Legendre polynomial
> and its derivative in the region : theta =0 to 90 degrees.
>
> Note:
> I have tried the recurrence relation given in the NUMERICAL RECIPES
> book. The recurrence relations are not stable in entire region of
> theta.

I have been dealing with that question a number of years ago in 
connection with the reconstruction of three-dimensional electron 
momentum densities from Compton profiles, and I have published a 
formula that is stable over the whole range of theta (i.e. from 
0 to 180 degrees including the endpoints). It can be found in 
Z.Naturforsch. 40 a, 99-111 (1985) and is (in TeX notation)

P_l^m(x) = {(-1)^{l+m} \over 2^l} \cdot (1-x^2)^{m/2} \cdot 
            \sum_{k=k_0}^l { (-1)^k {(2k)! \over k!(l-k)!(2k-l-m)!} 
                                                  \cdot x^{2k-l-m} }

or, blown up,
                            l
            l+m           ____
 m      (-1)        2 m/2 \        k       (2k)!          2k-l-m
P (x) = ------- (1-x )     >   (-1)  ------------------- x
 l          l             /          k! (l-k)! (2k-l-m)!
           2              ----
                          k=k
                             0

with k_0 = [(l+m+1)/2]  ([..] being the integer part). Apart from 
its numerical stability, it has the virtue not to use powers of 
x that cancel and hence cost time and add numerical noise. More 
details can be found in the paper, reprints of which you can get from 
me if you have difficulties to access Z.Naturforsch.

I had the impression that the algorithm in 'Numerical Recipes' is 
more or less equivalent when I tested it in 1989 (i.e. the 1986 
version). Now, of course, I am wondering about Dr. Panigrahy's 
observation. I will check it and tell you the result.

Wolf Weyrich.

--------------------------------------------------------------------
Prof. W. Weyrich, Lehrstuhl fuer Physikalische Chemie I,
Fakultaet fuer Chemie, Universitaet Konstanz,
D-W-7750 Konstanz, Fed. Rep. of Germany
Tel. +49-7531-88-2002, e-mail [email-masked]
--------------------------------------------------------------------