[PATCH] Fix assoc_legendre_p(-n, m, x): identically zero



Hello everyone,

It's been a bit over 2 weeks and there has been no comment on this.

If it was forgotten, then I guess this is just a reminder.  But if I didn't do
something right, I'll try to give it another go based on any suggestions.

The patch is short and it follows a simple relation from A&S which, again, is
referenced in the comments ("For n < 0, see A&S 8.2.1 page 333") but wasn't
implemented.

Cheers,
Kris Katterjohn

On 10/03/2012 09:01 PM, Kris Katterjohn wrote:
> Hey everyone,
> 
> I've found a bug in assoc_legendre_p(): the results seem to always be zero
> when a negative degree is given.  For example:
> 
> (%i2) assoc_legendre_p(-3,2,1/8);
> (%o2)                                  0
> (%i3) assoc_legendre_p(-5,3,1/7);
> (%o3)                                  0
> (%i4) assoc_legendre_p(-8,1,1/6);
> (%o4)                                  0
> 
> I've created a simple patch to fix this (attached), and created a patch
> tracker for it[1].  I think it does The Right Thing.
> 
> (%i5) load(orthopoly)$
> (%i6) assoc_legendre_p(-3,2,1/8),numer;
> (%o6)              interval(2.953125, 8.135094160810487E-15)
> (%i7) assoc_legendre_p(-5,3,1/7),numer;
> (%o7)        interval(- 14.54316713060748, 2.376273306325054E-13)
> (%i8) assoc_legendre_p(-8,1,1/6),numer;
> (%o8)         interval(.7000229997231038, 4.669118735062099E-14)
> 
> The comments in orthopoly.lisp refer to an equation in A&S relating positive
> and negative degrees, but it wasn't actually implemented.
> 
> Let me know if there are any problems!
> 
> Thanks,
> Kris Katterjohn
> 
> [1]
> https://sourceforge.net/tracker/?func=detail&aid=3574318&group_id=4933&atid=304933
>