#2452: [with patch, needs work] Heaviside step function, Dirac delta needed
-------------------------+--------------------------------------------------
 Reporter:  gfurnish     |       Owner:  gfurnish
     Type:  enhancement  |      Status:  assigned
 Priority:  major        |   Milestone:  sage-4.1
Component:  symbolics    |    Keywords:          
 Reviewer:               |      Author:          
   Merged:               |  
-------------------------+--------------------------------------------------

Comment(by burcin):

 Hi Golam,

 You're right! When using high precision we start calling maxima to decide
 if two expressions are equal. This kills performance as you observed.

 Now I suggest using `CIF(x).imag() == 0` where `x` is the element you want
 to test for. This is consistent in timings, and produces correct results:

 {{{
 sage: u = 1 + I*exp(-10000000000000000)
 sage: CIF(u).imag() == 0
 False
 sage: timeit('b = (CIF(u).imag() == 0)')
 625 loops, best of 3: 761 µs per loop
 sage: t = 1 + I*exp(-10000)
 sage: CIF(t).imag() == 0
 False
 sage: timeit('b = (CIF(t).imag() == 0)')
 625 loops, best of 3: 784 µs per loop
 }}}

 Thanks.

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