Re: associated legendre polynomials



jacob@xxxxxxxxxx wrote:
Hi math wizards!

I am implementing the assoc_legendre function for my
compiler system lcc-win...

My stuff output looks like this

Mathematica can give all of those exactly. Note that, using its convention,
the first two arguments are interchanged compared to yours, the third
argument is always 2, and the last argument is the same as your last. Thus,
for the first example, I simplified LegendreP[2, 1, 2, -1/10] and then
approximated that result:

assoc_legendre(1,2,-0.1)= -0.298496231131986003

(9*Sqrt[11])/100 = 0.29849623113198598642

assoc_legendre(1,2,-0.2)= -0.587877538267962775

(6*Sqrt[6])/25 = 0.58787753826796274357

assoc_legendre(2,3,0.3)= 4.094999999999999878

819/200 = 4.0950000000000000000

assoc_legendre(4,4,0.2)= 96.7679999999999991

12096/125 = 96.768000000000000000

assoc_legendre(4,4,0.6)= 43.00800000000000358

5376/125 = 43.008000000000000000

assoc_legendre(0,10,-0.5)= -0.188228607177734375

-49343/262144 = -0.18822860717773437500

assoc_legendre(0,10,1e-008)= -0.246093749999998646

-6299999999999965350000000000030029999999999990991000000000001093949999\
999999953811/
25600000000000000000000000000000000000000000000000000000000000000000\
000000000000000 = -0.24609374999999864648

assoc_legendre(0,10,0.5)= -0.188228607177734375

-49343/262144 = -0.18822860717773437500

assoc_legendre(1,10,0.5)= -2.006687739436125652

(151855*Sqrt[3])/131072 = 2.0066877394361256516

assoc_legendre(1,10,1e-008)= 2.707031249999995228e-007

(-20789999999999963964000000000016216199999999997374520000000000138567*
Sqrt[1111111111111111])/
256000000000000000000000000000000000000000000000000000000000\
0000000000000000000000 = -2.7070312499999951725*10^-7

assoc_legendre(1,10,0.5)= -2.006687739436125652

(151855*Sqrt[3])/131072 = 2.0066877394361256516

assoc_legendre(5,10,-0.5)= 30086.16970611617498

(-142297155*Sqrt[3])/8192 = -30086.169706116174977

assoc_legendre(5,10,1e-008)= 0.002533781249999997

(-12162149999999983783800000000005497291799\
999999338379040000000026189163*
Sqrt[1111111111111111])/16000000000000000\
0000000000000000000000000000000000000000000\
000000000000000000000 = -0.0025337812499999964949

assoc_legendre(5,10,0.5)= -30086.16970611617498

(142297155*Sqrt[3])/8192 = 30086.169706116174977

assoc_legendre(5,10,0.999)= 0.503641148901328141

(-18023319916700146202634759279*Sqrt[1999])/
1600000000000000000000000000000 = -0.50364114890132704064

The public domain implementation of gsl gives a different
sign (sometimes)

Concerning sign conventions, see the comment preceeding item (63) at
<http://mathworld.wolfram.com/LegendrePolynomial.html>.

David

and with big numbers
(-30086.16970611617498 for instance) we disagree in the
7th or eighth decimal... not so reassuring.

Maybe one of you can tell me if my results are ok or not?
If possible with a package that gives more precision than
gsl, of course: mathematica or maple or whatever you have.

Thanks in advance for your help (and patience)
.



Relevant Pages

  • Re: dgemm subroutine in BLAS - I think Ive cracked the difference, please confirm
    ... but not a single I/O operation on them. ... appear simpler for that rare I/O statement, but the fortran ... convention is simpler for those dozens or hundreds of lines of code ... years and Mathematica for about 15 years, ...
    (comp.lang.fortran)
  • Re: Excel Math Bug
    ... > Yeah, it's a convention, but there IS an established convention in math, ... or academic math convention has been deviated ... Or the language applications just didn't feel it necessary to ... real math application -- maybe Mathematica. ...
    (sci.math)
  • Re: Excel Math Bug
    ... > Yeah, it's a convention, but there IS an established convention in math, ... or academic math convention has been deviated ... Or the language applications just didn't feel it necessary to ... real math application -- maybe Mathematica. ...
    (microsoft.public.excel.programming)
  • Re: on Hypergeometric distribution, can total number of balls in urn be zero?
    ... but if it follows the convention of the Wikipedia article you linked ... Any way, no difference, Mathematica still ... since in Mathematia 'N' is a special command) ...
    (sci.stat.math)
  • Re: How to increase Working Precision?
    ... arbitrary precision in applied situations is quite ... not 10 problems, each 10 digits. ... the machine-arithmetic subroutine library of Mathematica, ... iterations I've suggested than the 1-2 or 3 arithmetic ...
    (sci.math.symbolic)