Changes between Initial Version and Version 1 of Ticket #9044


Ignore:
Timestamp:
05/25/10 09:00:03 (12 years ago)
Author:
schilly
Comment:

For a complete switch this probably needs a bit more analysis. I tested this on another (much faster) machine again and the timing numbers were different. No fast binding for mpmath installed?

But in any situation, using mpmath.erf to calculate the erf for a precision other than 53 bits is a necessary addition. It seems that it also depends on the magnitude of the input argument.

import mpmath

sage: %timeit erf(0.001)
625 loops, best of 3: 74.6 µs per loop   #winner
sage: %timeit mpmath.erf(0.001)
625 loops, best of 3: 101 µs per loop

sage: %timeit erf(1.001)
625 loops, best of 3: 82.7 µs per loop   #winner
sage: %timeit mpmath.erf(1.001)
625 loops, best of 3: 120 µs per loop

sage: %timeit erf(10010)
625 loops, best of 3: 52.3 µs per loop
sage: %timeit mpmath.erf(10010)
625 loops, best of 3: 12.8 µs per loop   #winner

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9044

    • Property Cc fredrik.johansson added
  • Ticket #9044 – Description

    initial v1  
    1 Appears the current erf() function is limited to 53-bit accuracy, while using mpmath instead will provide greater accuracy and also greater speed.  This is from an IRC session - an edited version is below.
     1Appears the current erf() function is limited to 53-bit accuracy, while using mpmath instead will provide greater accuracy and also (sometimes?) greater speed.  This is from an IRC session - an edited version is below.
    22
    33{{{