
Re: Legendre Polynomials normalised to Sin[theta]^m
Posted:
Jun 29, 2013 6:48 AM


Dear AMX,
Thank you very much for your reply.
I might have misunderstood your suggestion, but I am not sure whether a Taylor expansion of the numerator and denominator can help here. My problem is that both are very small for m>0, which generates a loss of precision in the ratio. As far as I understand, I would still have this problem after Taylorexpanding the numerator and denominator separately. On the other hand, I think that knowing the first few Taylor coefficients of the whole ratio, P_lm(x)/sin(x)^(m/2), would solve my issue.
Alas speed of execution is very important for my application, thus using highprecision libraries such as "GNU Multiple Precision Arithmetic Library" is not viable.
The frustrating fact is that I know that P_lm(x) is proportional to sin(x)^(m/2) (see http://en.wikipedia.org/wiki/Associated_Legendre_polynomials#Reparameterization_in_terms_of_angles). Doing the ratio P_lm(x)/sin(x)^(m/2) should not be so hard :)
Cheers, Guido
Il giorno sabato 22 giugno 2013 21:27:44 UTC+2, AMX ha scritto: > On Sat, 22 Jun 2013 07:00:59 0700 (PDT), > > Guido Walter Pettinari wrote: > > > > > I would like to add that, since I need to evaluate this > > > function very close to theta=n*pi, I cannot just use the result > > > from a Legendre polynomial routine and divide it by > > > sin(theta)^m. > > > > > >> I would be grateful if somebody could point me to a numerical > > >> routine (possibly in C) to compute the following special > > >> function: > > >> P_lm (cos(theta)) / (sin(theta)^m) , > > >> > > >> where P_lm is an associated Legendre polynomial. The function > > >> can be also expresses as > > >> > > >> P_lm (x) / (1x^2)^(m/2) . > > >> ratio is even easier to estimate than the P_lm's. I checked in > > >> GSL and alglib but alas I could not find this function. > > >> > > > > Not easy problem, rather difficult to find ready to use solution. > > > > For cos(?) close to 1.0 it could be written as cos(?)=1t. Any > > polynomial of type W(1t) would have terms 1,t,t^2,t^3...t^n. > > The term sin(?)^m is much worse, it ends with t^(m^2). > > > > For t quite small, say 1e3, t^6 is below standard IEEE > > arithmetic machine precision so this term and higher terms would > > not affect the results. > > > > One of possible solution is to use arbitrary/multiprecision > > library. Conversion value of cos(?) into multiprecision allow you > > to compute your expression without loss of accuracy, except > > initial and final conversion. > > > > From my experience with ,,GNU Multiple Precision Arithmetic > > Library'' it needs half an hour to study interface and then it > > works. Many others libraries are available. > > > > The clear deficiency of such a library use is that evaluation of > > your expression would be very slow. This may be acceptable or not > > depending of the purpose of your routine. > > > > Trying to be as precisely as possible > > AMX > > > > > >  > > adres w rot13

