Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33962: wrong sign for value of Legendre polynomial at 0
As discussed in [https://groups.google.com/g/sage- devel/c/ES00LNWv6DQ/m/YLPkmAxRAgAJ this sage-devel thread], `legendre_P(n, 0)` should be negative when `n` is congruent to 2 modulo 4, but sagemath returns a positive value: {{{ sage: [legendre_P(n, 0) for n in range(0, 10, 2)] [1, 1/2, 3/8, 5/16, 35/128] }}} The correct values are `[1, -1/2, 3/8, -5/16, 35/128]`. (The signs should alternate when restricted to even values of `n`.) This is a pynac bug. It only arises in the code branch where `n` is an integer variable, so we get the correct values when `n` is real: {{{ sage: [QQ(legendre_P(RR(n), 0)) for n in range(0, 10, 2)] [1, -1/2, 3/8, -5/16, 35/128] }}} URL: https://trac.sagemath.org/33962 Reported by: gh-DaveWitteMorris Ticket author(s): Dave Morris Reviewer(s): Travis Scrimshaw
- Loading branch information