# Revision history [back]

### Computing Roots of Large Polynomials

Hey, I'm looking to compute the roots of very large polynomials (as in polynomials of degree 500+) and am looking for the most efficient method to do so. This my code so far (I tried a different method with the commented out code) and it works great for about anything with N<=200ish and then starts to take a really long time:

# var('x')

x=PolynomialRing(ComplexField(),'x').gen() N=500 s=0 for m in range (N+1): n=N+1-m s+=(-1)^n(n+1)x^n/factorial(n) #s+=[(-1)^n*(n+1)/factorial(n)]

# sols=(s==0).roots(x,ring=CC,multiplicities=False)

sols=s.roots() solsPlot=[] for n in range(len(sols)): solsPlot+=[[sols[n][0].real(),sols[n][0].imag()]] #solsPlot+=[[sols[n].real(),sols[n].imag()]] scatter_plot(solsPlot)

Thanks.

 2 None tmonteil 23843 ●26 ●172 ●438 http://wiki.sagemath.o...

### Computing Roots of Large Polynomials

Hey, I'm looking to compute the roots of very large polynomials (as in polynomials of degree 500+) and am looking for the most efficient method to do so. This my code so far (I tried a different method with the commented out code) and it works great for about anything with N<=200ish and then starts to take a really long time:

# var('x')

x=PolynomialRing(ComplexField(),'x').gen() N=500 s=0 for m in range (N+1): n=N+1-m s+=(-1)^n(n+1)x^n/factorial(n) #s+=[(-1)^n*(n+1)/factorial(n)]

# sols=(s==0).roots(x,ring=CC,multiplicities=False)

sols=s.roots() solsPlot=[] for n in range(len(sols)): solsPlot+=[[sols[n][0].real(),sols[n][0].imag()]] #solsPlot+=[[sols[n].real(),sols[n].imag()]] scatter_plot(solsPlot)

Thanks.

 3 None tmonteil 23843 ●26 ●172 ●438 http://wiki.sagemath.o...

### Computing Roots of Large Polynomials

Hey, I'm looking to compute the roots of very large polynomials (as in polynomials of degree 500+) and am looking for the most efficient method to do so. This my code so far (I tried a different method with the commented out code) and it works great for about anything with N<=200ish and then starts to take a really long time:

# var('x')

#var('x')
x=PolynomialRing(ComplexField(),'x').gen()
N=500
s=0
for m in range (N+1):
n=N+1-m
s+=(-1)^n(n+1)x^n/factorial(n)
s+=(-1)^n*(n+1)*x^n/factorial(n)
#s+=[(-1)^n*(n+1)/factorial(n)] sols=(s==0).roots(x,ring=CC,multiplicities=False) #s+=[(-1)^n*(n+1)/factorial(n)]
#sols=(s==0).roots(x,ring=CC,multiplicities=False)
sols=s.roots()
solsPlot=[]
for n in range(len(sols)):
solsPlot+=[[sols[n][0].real(),sols[n][0].imag()]]
#solsPlot+=[[sols[n].real(),sols[n].imag()]]
scatter_plot(solsPlot)scatter_plot(solsPlot)


Thanks.