#11309: Sage sees -x +y > 0, -y + x >= 0,  and  x -y > 0 as equivalent
--------------------------------------------------------------------------+-
       Reporter:  tnv                                                     |     
    Owner:  burcin                             
           Type:  defect                                                  |     
   Status:  needs_review                       
       Priority:  major                                                   |     
Milestone:  sage-5.1                           
      Component:  symbolics                                               |    
Resolution:                                     
       Keywords:  inequality equality relational sd31 __richcmp__ sd40.5  |   
Work issues:                                     
Report Upstream:  N/A                                                     |     
Reviewers:  Karl-Dieter Crisman, ThanhVu Nguyen
        Authors:  Keshav Kini, Burcin Erocal                              |     
Merged in:                                     
   Dependencies:                                                          |     
 Stopgaps:                                     
--------------------------------------------------------------------------+-

Comment (by kcrisman):

 Hmm, this is a big slowdown in at least one case.
 {{{
 # old
 sage: timeit("(x < y) != (y > x)")
 625 loops, best of 3: 2.76 µs per loop
 # new
 sage: timeit("(x < y) != (y > x)")
 625 loops, best of 3: 13.3 µs per loop
 }}}
 It looks like it's fairly constantly adding this.  Here, in the much
 slower checking of a list
 {{{
 # old
 sage: timeit("(x - 1 < 0) in [x - 2 < 0]")
 625 loops, best of 3: 104 µs per loop
 # new
 sage: timeit("(x - 1 < 0) in [x - 2 < 0]")
 625 loops, best of 3: 116 µs per loop
 }}}
 Here's another one.
 {{{
 # old
 sage: timeit("(y > y) != (y > y) ")
 625 loops, best of 3: 2.24 µs per loop
 # new
 sage: timeit("(y > y) != (y > y) ")
 625 loops, best of 3: 8.45 µs per loop
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11309#comment:44>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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/sage-trac?hl=en.

Reply via email to