#11513: add _is_numerically_zero() method to symbolic expressions
---------------------------+------------------------------------------------
   Reporter:  burcin       |          Owner:  burcin  
       Type:  enhancement  |         Status:  new     
   Priority:  major        |      Milestone:  sage-4.8
  Component:  symbolics    |       Keywords:  sd35.5  
Work_issues:               |       Upstream:  N/A     
   Reviewer:               |         Author:          
     Merged:               |   Dependencies:          
---------------------------+------------------------------------------------

Comment(by burcin):

 Replying to [comment:7 zimmerma]:
 > I'm puzzled about this ticket. Why doesn't the {{{is_zero}}} method
 suffice? As said by Karl-Dieter,
 > for general expressions the problem is undecidable, thus if you want to
 check expressions that
 > *reduce* to zero, the name of the method should reflect the fact that
 there could be false
 > negatives.

 Hi Paul, I wanted to ask you about this in Warwick. I got caught up in the
 linear algebra stuff and this slipped my mind.

 `is_zero()` usually ends up calling maxima, which is very slow especially
 in the context of automatic evaluation of symbolic functions.

 At the moment, many symbolic functions (see
 `sage/functions/generalized.py` for example) use code similar to the
 following to test if an argument is zero within a reasonable time: (BTW,
 this code should not initialize `CIF` on every call.)

 {{{
         try:
             approx_x = ComplexIntervalField()(x)
             if bool(approx_x.imag() == 0):      # x is real
                 if bool(approx_x.real() == 0):  # x is zero
                     return None
                 else:
                     return 0
         except:                     # x is symbolic
             pass
 }}}

 The reason for this ticket was to move this to a separate function to
 avoid code duplication. If this function can detect `pi + (pi - 1)*pi -
 pi^2 == 0` or `(pi - 1)*x - pi*x + x == 0` it would be even better. In
 this context, false negatives are not a problem. We should just avoid
 false positives. It's also OK if this test is not purely numeric. Any
 suggestions for a better name for this function is also welcome of course.

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