Ask Your Question

Quinten87's profile - activity

2018-06-08 14:20:34 -0500 received badge  Scholar (source)
2018-06-08 14:20:20 -0500 commented answer Computing Roots of Large Polynomials

Thanks a lot! That's closer to what I was expecting when I went out to code the graph. I should have figured dividing by all those really huge numbers and then using numerical algorithms to pinpoint the roots would result in some massive errors.

2018-06-08 11:18:51 -0500 received badge  Supporter (source)
2018-06-08 11:18:42 -0500 commented answer Computing Roots of Large Polynomials

Thanks for the reply. I tried CDF and like you said it was a lot faster but a bunch of the roots also disappeared. The trouble is I'm not getting the picture I think I should. I think I should see one root converging to 1 and all the other ones going to infinity as for large N the series becomes increasingly close to z*exp(-z). I would be interested to see the picture you get using exact computation to see if it would be closer to my intuition but your code seems to give me the error 'Algebraic Field is not a valid variable'.

2018-06-08 04:13:10 -0500 received badge  Good Question (source)
2018-06-07 01:48:33 -0500 received badge  Nice Question (source)
2018-06-07 01:04:58 -0500 received badge  Student (source)
2018-06-07 00:57:28 -0500 asked a question 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.