Zeros of Legendre polynomials?

30 views
Skip to first unread message

Alasdair McAndrew

unread,
Apr 21, 2021, 5:39:06 AM4/21/21
to mpmath
The documentation shows that

import mpmath
n = 10
polyroots(taylor(lambda x: legendre(n,x),0,n)[::-1])

computes the roots of the n-th Legendre polynomial to the current precision.  However, it seems that beyond n = 21 the system gets a bit flaky:

dps = 15
n = 22
polyroots(taylor(lambda x: legendre(n,x),0,n)[::-1], extraprec=15, maxsteps=1000)

works, but not for n = 23.  Why should the system get into strife at n = 23, when it managed n = 22 quite easily?  

Thanks very much,
Alasdair
Reply all
Reply to author
Forward
0 new messages