On Feb 12, 2008, at 1:44 AM, Dmitri A. Sergatskov wrote:
FWIW: Marko's script seems to agree with "legendre_Plm"
wrapper of GSL's function (gsl package from octave-forge).
Sincerely,
Dmitri.
--
That is good news!
It would be nice to do a direct comparison for the example below.
result_matlab = legendre (80, [-1:0.1:1]);
Any chance anyone who knows c/c++ has the inclination to write a short
program using gsl to calculate that example and post the results?
In addition, I noticed the comment below in the reference manual for gsl,
"The following functions compute the associated Legendre Polynomials
P_l^m(x). Note that this function grows combinatorially with l and can
overflow for l larger than about 150. There is no trouble for small m, but
overflow occurs when m and l are both large. Rather than allow overflows,
these functions refuse to calculate P_l^m(x) and return GSL_EOVRFLW when they
can sense that l and m are too big."
It would be more proper to restrict the issuing of the warning for the cases
where overflow actually occurs. For example, even this trivial calculation
warns of overflow.
octave:73> legendre(0,0)
warning: legendre is unstable for higher orders
ans = 1
I'll take a look at modifying the script to catch overflows and issue the
warning only when such occurs.
Ben