#11143: define symbolic functions for exponential integrals
-----------------------------+----------------------------------------------
   Reporter:  kcrisman       |          Owner:  burcin                       
       Type:  defect         |         Status:  new                          
   Priority:  major          |      Milestone:  sage-4.7.1                   
  Component:  symbolics      |       Keywords:  ei Ei special function maxima
Work_issues:                 |       Upstream:  N/A                          
   Reviewer:  Burcin Erocal  |         Author:  Benjamin Jones               
     Merged:                 |   Dependencies:                               
-----------------------------+----------------------------------------------

Comment(by benjaminfjones):

 The patch now depends on #11513

 Here are new timings for the ``_eval_`` method with
 ``_is_numerically_zero()``:

 {{{
 #!rst
 .. code-block:: python

     # special case: *quickly* test if (z == 0 and n > 1)
     if isinstance(z, Expression):
         if z._is_numerically_zero():
             z_zero = True # for later
             if n > 1:
                 return 1/(n-1)
         else:
             if not z:
                 z_zero = True
                 if n > 1:
                     return 1/(n-1)

 ======================================================  =======
   Test                                                   Time
 ======================================================  =======
 sage: timeit("f = exp_integral_e(n,z)")                 535 µs
 sage: timeit("f = exp_integral_e(n,0)")                 482 µs
 sage: assume(n > 1); timeit("f = exp_integral_e(n,0)")  3.56 ms
 sage: timeit("f = exp_integral_e(0,z)")                 968 µs
 sage: timeit("f = exp_integral_e(1.0,1.0)")             160 µs
 ======================================================  =======
 }}}

 I realized that in row 2 of the previous timings I neglected to assume n >
 1 so those timings aren't giving much information since the expression is
 left unevaluated like in row 1. The new row 3 includes that assumption so
 that the simplified result ``1/(n-1)`` is created and returned.

 I'll update the timings above and move these tables to the wiki.

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