scipy/scipy — pull request #3897 by gertingold (2014-08-24 12:31:09+00:00)
Title: BUG: associated Legendre function of second kind for 1<|x|<1.0001

While working on a solution to gh-2840, it turned out that in the function ``LQMN`` evaluating the associated Legendre function of second kind on the real axis, a bug exists for 1<|x|<1.0001. At |x|=1.0001, the algorithm changes and above this value, everything appears to be fine. Below this value, the algorithm used for |x|<1 is employed with the help of a sign stored in the variable ``LS``. However, the explicit expression for Q_1^1 is incorrect, lacking a factor of ``LS`` and leading to a jump in the function at |x|=1.0001. The correct sign factor has been introduced and a test exposing the problem has been added.