Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.num-analysis.independent

Topic: Legendre Polynomials normalised to Sin[theta]^m
Replies: 13   Last Post: Jul 1, 2013 12:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Guido Walter Pettinari

Posts: 29
From: Italy & UK
Registered: 3/24/10
Re: Legendre Polynomials normalised to Sin[theta]^m
Posted: Jun 29, 2013 6:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 Taylor-expanding 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 high-precision 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) / (1-x^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(?)=1-t. Any
>
> polynomial of type W(1-t) 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 1e-3, 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/multi-precision
>
> 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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.