#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.0                           
      Component:  symbolics                                        |    
Resolution:                                     
       Keywords:  inequality equality relational sd31 __richcmp__  |   Work 
issues:                                     
Report Upstream:  N/A                                              |     
Reviewers:  Karl-Dieter Crisman, ThanhVu Nguyen
        Authors:  Keshav Kini, Burcin Erocal                       |     Merged 
in:                                     
   Dependencies:                                                   |      
Stopgaps:                                     
-------------------------------------------------------------------+--------

Comment (by kini):

 Done! Glad you like the comments :)

 I did not do any timing, no. I'm not sure what you mean by "lines 1241ff",
 but function calls should typically be avoided if you're optimizing for
 speed, afaik. The main thing I was wondering was, the argument `op` to the
 function `_richcmp_c_impl()` is an integer, but `operator.*` as seen in
 lines 1245-1252 seem to be strings, if I'm not mistaken. So I'm just
 wondering if that many string operators for a single comparison of
 symbolic expression couldn't be better optimized by somehow getting the
 operator of the lhs and rhs of the big relation as integers rather than
 strings. Well, not to mention that I'm calling `.operator()` a bunch of
 times, but I don't know if it would actually be any faster to compute it
 once and store it in a variable.

 They say you shouldn't try to second-guess compilers... I guess the best
 way to find out is to try a few different ways and see how `timeit`
 behaves. I'll do that later, I guess...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11309#comment:41>
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