assoc_legendre_p() is broken wrt negative degrees: it seems to be identically zero. 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
This can also be seen doing something like "plot2d(assoc_legendre_p(-3,1,x),[x,-1,1])"
In the comments of orthopoly.lisp it refers to an equation in A&S relating positive and negative degrees, but it wasn't actually implemented. I've uploaded a very simple patch to do this:
(%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)
Let me know what you think.
Thanks,
Kris Katterjohn
Patch to fix assoc_legendre_p(-n,m,x)
Patch to fix legendre_p(-n,x)
In case this sits for a while, I'm updating the title and giving links to my mailing list posts since I have found problems with more than just assoc_legendre_p():
http://www.math.utexas.edu/pipermail/maxima/2012/030183.html (original assoc_legendre_p() post)
http://www.math.utexas.edu/pipermail/maxima/2012/030300.html (legendre_p())
http://www.math.utexas.edu/pipermail/maxima/2012/030302.html (my simple analysis of what seems to be a more general problem)
I've applied the patches and added test cases to test_orthopoly, and committed it all as 3823546518e5dc. Thanks for your help, Kris.