#13193: erf evaluation is wrong along imaginary axis
-------------------------------------------------------+--------------------
Reporter: kcrisman | Owner: jason,
jkantor
Type: defect | Status:
needs_review
Priority: critical | Milestone:
sage-5.2
Component: numerical | Resolution:
Keywords: | Work issues:
Report Upstream: Reported upstream. No feedback yet. | Reviewers:
Karl-Dieter Crisman
Authors: Benjamin Jones | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------------------+--------------------
Changes (by kcrisman):
* reviewer: => Karl-Dieter Crisman
Comment:
> @kcrisman, it looks like your reviewer patch on #11948 was merged in
4.8.alpha6, but then my patch at #13001 reorganized the doctests (moved a
bunch from `__init__` to the class docstring) and the `erf(3*I).n()`
doctest got removed in the process (oops!).
That's hilarious! You must have done this at the Sage Days, and not
mentioned it to me :) So you removed an erroneous doctest. Glad you
nabbed the one in symbolic/expression.pyx, though.
> Should I add it back in do you think? I have `erf(3.0*I)` which calls
`_evalf_` just the same.
No, the one you changed is sufficient, since it does integer times I
instead of real times I. Nice.
Should this be a blocker for Sage 5.2, since it is mathematically wrong?
Anyway, on a first glance this seems like a good patch.
Before:
{{{
sage: timeit('erf(320).n()')
625 loops, best of 3: 147 µs per loop
sage: timeit('erf(320*I).n()')
125 loops, best of 3: 5.49 ms per loop
sage: timeit('erf(-100).n()')
625 loops, best of 3: 160 µs per loop
sage: timeit('erf(100-100*i).n()')
125 loops, best of 3: 1.81 ms per loop
sage: timeit('erf(1+i).n()')
125 loops, best of 3: 1.65 ms per loop
}}}
After:
{{{
sage: timeit('erf(320).n()')
625 loops, best of 3: 138 µs per loop
sage: timeit('erf(320*I).n()')
125 loops, best of 3: 2.15 ms per loop
sage: timeit('erf(-100).n()')
625 loops, best of 3: 137 µs per loop
sage: timeit('erf(100-100*i).n()')
125 loops, best of 3: 2.36 ms per loop
sage: timeit('erf(1+i).n()')
125 loops, best of 3: 1.73 ms per loop
}}}
Sometimes slower, sometimes faster, except on the one that was wrong
before, where it's faster.
Looks pretty good. I'll see what the patchbot says.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13193#comment:11>
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.