help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: normalized ALF (Assotiated Legendre Function)


From: Marco Caliari
Subject: Re: normalized ALF (Assotiated Legendre Function)
Date: Wed, 13 Feb 2008 14:16:24 +0100 (CET)

That line was incorporated from your version. Should it be something else?

Something like that to be added:

if (max(abs(scale)) == Inf)
  underflow = true;
endif

and try to prevent that scale becomes Inf.
Moreover, I don't understand the limit 255 on n. With the normalizations, there are no problems for n>255.

Agreed.

The enclosed version has a further improvement:

# the warning when scale is Inf
octave:4> legendre(151,0)(end)
warning: legendre: results may be  unstable for high orders.
warning: legendre: results may be  unstable for high orders.
ans = -Inf
octave:5> legendreold(151,0)(end)
ans = -Inf

# NaN prevented in case of Inf*0
octave:8> legendre(151,-1)(end-1:end)
ans =

  -0
  -0
octave:9> legendreold(151,-1)(end-1:end)
ans =

    -0
   NaN

# Inf prevented in case of Inf*(small quantity)
octave:10> legendre(151,-0.9)(end-1:end)
ans =

  -8.1986e+254
  -3.9708e+254
octave:11> legendreold(151,-0.9)(end-1:end)
ans =

  -8.1986e+254
          -Inf

Best regards,

Marco

Attachment: legendre.m
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]