-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solveset is perhaps oversimplifying #16793
Labels
Comments
This may also be a symptom of the same problem. I suspect it is related to the use of >>> a = S("6506833320952669167898688709329/5070602400912917605986812821504")
>>> solve(Rational(Float(a,5))<(a.p-x)/a.q)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "s\solvers\solvers.py", line 985, in solve
return reduce_inequalities(f, symbols=symbols)
File "s\solvers\inequalities.py", line 986, in reduce_inequalities
rv = _reduce_inequalities(inequalities, symbols)
File "s\solvers\inequalities.py", line 923, in _reduce_inequalities
poly_reduced.append(reduce_rational_inequalities([exprs], gen))
File "s\solvers\inequalities.py", line 266, in reduce_rational_inequalities
solution &= solve_rational_inequalities(eqs)
File "s\solvers\inequalities.py", line 164, in solve_rational_inequalities
numer_intervals = solve_poly_inequality(numer*denom, rel)
File "s\solvers\inequalities.py", line 57, in solve_poly_inequality
reals, intervals = poly.real_roots(multiple=False), []
File "s\polys\polytools.py", line 3496, in real_roots
reals = sympy.polys.rootoftools.CRootOf.real_roots(f, radicals=radicals)
File "s\polys\rootoftools.py", line 400, in real_roots
return cls._get_roots("_real_roots", poly, radicals)
File "s\polys\rootoftools.py", line 732, in _get_roots
coeff, poly = cls._preprocess_roots(poly)
File "s\polys\rootoftools.py", line 706, in _preprocess_roots
coeff, poly = preprocess_roots(poly)
File "s\polys\polyroots.py", line 770, in preprocess_roots
basis = _integer_basis(poly)
File "s\polys\polyroots.py", line 693, in _integer_basis
divs = reversed(divisors(gcd_list(coeffs))[1:])
File "s\ntheory\factor_.py", line 1404, in divisors
return sorted(rv)
File "s\ntheory\factor_.py", line 1344, in _divisors
factordict = factorint(n)
File "s\ntheory\factor_.py", line 1217, in factorint
seed=high_)
File "s\ntheory\factor_.py", line 492, in pollard_rho
g = igcd(U - V, n)
File "s\core\numbers.py", line 180, in igcd
args_temp = [abs(as_int(i)) for i in args]
File "s\core\numbers.py", line 180, in <listcomp>
args_temp = [abs(as_int(i)) for i in args]
File "s\core\compatibility.py", line 416, in as_int
from sympy.core.numbers import Integer
File "<frozen importlib._bootstrap>", line 1019, in _handle_fromlist
KeyboardInterrupt -> it was going very slow The following is very fast:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When computing a solution for a surd within a numerical expression,
solveset
appears to add in factoring of the surd. This can add a lot of time when the argument is large.solve
does not do so and returns much more quickly with an unsimplified surd:So solveset factored out the squares:
The text was updated successfully, but these errors were encountered: