#7822: pynac log function cannot handle float arguments <= 0
-------------------------+--------------------------------------------------
   Reporter:  burcin     |       Owner:  burcin       
       Type:  defect     |      Status:  needs_review 
   Priority:  major      |   Milestone:  sage-4.3.1   
  Component:  symbolics  |    Keywords:               
Work_issues:             |      Author:  Burcin Erocal
   Upstream:  N/A        |    Reviewer:               
     Merged:             |  
-------------------------+--------------------------------------------------
Changes (by burcin):

  * status:  needs_work => needs_review


Comment:

 attachment:trac_7822-py_log.take2.patch fixes the speed problems, although
 it is still not as fast as before. It depends on a very small patch to
 pynac. I will post a pynac package with the fix later this week.

 Before:

 {{{
 sage: %timeit t = ln(float(-1))
 1000 loops, best of 3: 285 µs per loop
 sage: %timeit t = ln(float(1))
 100000 loops, best of 3: 17.5 µs per loop
 sage: %timeit t = ln(complex(1))
 100000 loops, best of 3: 6.25 µs per loop
 sage: %timeit t = ln(complex(1,1))
 100000 loops, best of 3: 6.4 µs per loop
 sage: %timeit t = ln(complex(1,-1))
 100000 loops, best of 3: 6.42 µs per loop
 sage: %timeit t = ln(complex(0))
 100000 loops, best of 3: 9.24 µs per loop
 sage: %timeit t = ln(complex(-1))
 100000 loops, best of 3: 6.21 µs per loop
 }}}

 After:

 {{{
 sage: %timeit t = ln(float(-1))
 100000 loops, best of 3: 15.2 µs per loop
 sage: %timeit t = ln(float(1))
 100000 loops, best of 3: 13.2 µs per loop
 sage: %timeit t = ln(complex(1))
 100000 loops, best of 3: 15 µs per loop
 sage: %timeit t = ln(complex(1,1))
 100000 loops, best of 3: 15.3 µs per loop
 sage: %timeit t = ln(complex(0))
 100000 loops, best of 3: 15.5 µs per loop
 sage: %timeit t = ln(complex(-1))
 100000 loops, best of 3: 15.1 µs per loop
 }}}

 Re comment:3:

 The top level log function is a regular python function which handles
 precision, etc. Calling that in the doctest is not really testing the
 `Function_log` defined in `sage/functions/log.py`. If we want people to
 move away from using `ln`, we should deprecate it. Since the last
 discussion about this topic ended up by concluding we should even support
 printing `ln` instead of `log`, I don't see that happening soon.

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