Hey again,
On 10/03/2012 09:01 PM, Kris Katterjohn wrote:
> I've found a bug in assoc_legendre_p(): the results seem to always be zero
> when a negative degree is given.
The hypergeo21() function in orthopoly.lisp, which a lot (all?) of the
orthopoly functions eventually call, doesn't seem to handle negative n index
values correctly either. One issue is that it tries to sum from 0 to n, and
so it seems to always gives 0 for negative integer n limits. This means that
it seems to affect a lot more than I initially thought.
I'm currently pretty busy, so I cannot look into this further at the moment.
I can try to look into this later when I have more time if nobody has any
ideas. I just wanted to get this out there.
A related issue is that it seems the same sum can be done from 0 to some
non-integer (possibly negative) value. I'm not currently sure of the best way
to handle this either.
In regard to my patches: assoc_legendre_p() is becoming identically zero for a
different reason (a check for |m|>n for negative n, before anything else), but
legendre_p() is becoming identically zero because of hypergeo21(). Either
way, my patches give much nicer results for negative integer n degrees than
any result from hypergeo21().
Cheers,
Kris Katterjohn