Comment #1 on issue 2650 by [email protected]: non-determinism in integrate()
http://code.google.com/p/sympy/issues/detail?id=2650

I obviously don't know how this might affect the broader integration code, but this simple diff gives the simplifies result for the case we were working with without breaking any of the tests. It basically just sorts monoms before using it at all.

diff --git a/sympy/integrals/risch.py b/sympy/integrals/risch.py
index e3f8c98..b6752df 100644
--- a/sympy/integrals/risch.py
+++ b/sympy/integrals/risch.py
@@ -16,6 +16,7 @@
 from sympy.polys.polyroots import root_factors

 from sympy.core.compatibility import reduce
+from sympy.utilities import default_sort_key

 def components(f, x):
     """Returns a set of all functional components of the given expression
@@ -340,6 +341,7 @@ def exponent(g):
     else:
         monoms = monomials(V, A + B)

+    monoms = sorted(monoms, key=default_sort_key)
     poly_coeffs = _symbols('A', len(monoms))

     poly_part = Add(*[ poly_coeffs[i]*monomial



--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to