#13050: change default numerical evaluation of `erf` to use mpmath
------------------------------+---------------------------------------------
Reporter: benjaminfjones | Owner: burcin
Type: enhancement | Status: new
Priority: minor | Milestone: sage-5.1
Component: symbolics | Keywords: sd40.5 mpmath pari erf
Work issues: | Report Upstream: N/A
Reviewers: | Authors: Benjamin Jones
Merged in: | Dependencies: 12289
Stopgaps: |
------------------------------+---------------------------------------------
In #1173 an mpmath numerical evaluator for `erf` was written by Douglas
!McNeil. This ticket proposes to save that code, incorporate it with the
ability to pass an `algorithm` parameter to `numerical_approx` from #12289
and solve #13003 all in one go.
The mpmath evaluator is more robust than PARI, e.g. at large inputs. This
is a good reason to switch the default numerical evaluation of `erf` to
use mpmath like most of the rest of the new symbolic functions in Sage.
In PARIs favor, it is faster for some inputs:
{{{
sage: timeit('erf(2).n()')
625 loops, best of 3: 153 µs per loop
sage: timeit("erf(2).n(algorithm='pari')")
625 loops, best of 3: 135 µs per loop
}}}
but not always:
{{{
sage: timeit('erf(10^7).n()')
625 loops, best of 3: 118 µs per loop
sage: timeit('erf(10^7).n(algorithm="pari")')
625 loops, best of 3: 132 µs per loop
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13050>
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.