It is happening in a call from _integer_basis. There should probably be a quick exit at the start of the function when len(coeffs) < 3.
On Thursday, May 28, 2015 at 3:25:25 PM UTC-5, Aaron Meurer wrote: > > It looks like solve is calling factorint at some point. sqrt(N) will > already simplify intelligently (i.e., call factorint() with the limit > argument so that it isn't too slow). It looks like somewhere in > polyroots it is trying to compute all the divisors of the number. We > should investigate why it is doing this. I can see why that might be > necessary to compute the roots of a polynomial in general, but it > shouldn't be done when computing the roots of a quadratic. > > Aaron Meurer > > On Thu, May 28, 2015 at 1:37 PM, <[email protected] <javascript:>> > wrote: > > Hi, > > > > I used in some experiments the following simple code. > > > > import time > > from sympy.solvers import solve > > from sympy import Symbol > > x=Symbol('x') > > N=2**264+2**64+1 > > solve(x**2 + N , x) > > > > The previous code is very slow (at least in my machine, in fact I didn't > > wait to see the result). I want to ask if solve() command, before it > prints > > the result tries to compute some factors of N, in order to simplify the > > result in the square root? > > N is the following number > > > 29642774844752946028434172162224104410437116074403984394101159952769834897375233L > > > > which is large (but not really large). > > > > Thank you. > > > > Costas > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at http://groups.google.com/group/sympy. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/sympy/1dfc4ae4-2de2-45ba-a252-051e21fff72b%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/2ff6ba2f-080a-4cc9-a2fe-da2de1622206%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
