Status: Valid
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3364 by [email protected]: RealInterval.refine() changes the order of the endpoints
http://code.google.com/p/sympy/issues/detail?id=3364

Minimal example:

from sympy import var, legendre_poly
from sympy.polys.rootisolation import RealInterval
from sympy.polys import ZZ
from sympy.polys.domains.pythonrationaltype import PythonRationalType
var("x")
p = legendre_poly(4, x)
a = PythonRationalType(-1, 1)
b = PythonRationalType(-1, 2)
r = RealInterval((a, b), p.as_poly().rep.rep, ZZ)
print r.a, r.b, r.a < r.b, r.dx
r = r.refine()
print r.a, r.b, r.a < r.b, r.dx


This prints:


-1/1 -1/2 True 1/2
-2/3 -1/1 False -1/3

As you can see, first the interval is fine and a < b as it should be. Then we call refine and suddenly it's not true that a < b, and also the dx < 0. I think that this is a bug.

--
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