#11948: Fix numeric evaluation of error function
--------------------------------------------------------------------------+-
Reporter: jdemeyer |
Owner: jdemeyer
Type: defect |
Status: closed
Priority: major |
Milestone: sage-4.8
Component: numerical |
Resolution: fixed
Keywords: erf erfc |
Work issues:
Report Upstream: N/A |
Reviewers: Karl-Dieter Crisman
Authors: Jeroen Demeyer |
Merged in: sage-4.8.alpha6
Dependencies: #11130, #11321, #11854, #11891, #11890, #11836, #11952 |
Stopgaps:
--------------------------------------------------------------------------+-
Comment (by kcrisman):
Unfortunately, this causes a nasty problem.
This example in the documentation is fine - comparing mpmath:
{{{
sage: mpmath.erf(pi-1/2*i)
}}}
But anything along the imaginary axis seems to be off by exactly 1:
{{{
mpc(real='1.0000111669099367', imag='1.6332655417638451e-6')
sage: for z in [3,33,333,3333,33333]:
....: mpmath.erf(i*z); erf(n(z)*i)
....:
mpc(real='0.0', imag='1629.9946226015657')
1.00000000000000 + 1629.86732385786*I
mpc(real='0.0', imag='1.5128697751040891e+471')
1.00000000000000 + 1.51286977510409e471*I
mpc(real='0.0', imag='5.1260939089106243e+48155')
1.00000000000000 + 5.12609390891062e48155*I
mpc(real='0.0', imag='2.6385510598470926e+4824525')
1.00000000000000 + 2.63855105984709e4824525*I
}}}
But other values seem ok.
{{{
sage: for z in [3,33,333,3333]:
mpmath.erf(1+i*z); erf(1.+n(z)*i)
....:
mpc(real='-330.81538696857206', imag='443.38888183939281')
-330.815386892947 + 443.388881909712*I
mpc(real='2.0957487368415288e+468', imag='-5.5629367605580166e+470')
2.09574873684153e468 - 5.56293676055802e470*I
mpc(real='-3.8930178706420656e+48153', imag='1.8853741770265906e+48155')
-3.89301787064206e48153 + 1.88537417702659e48155*I
mpc(real='-4.3084905090066053e+4824524',
imag='8.6980843586535772e+4824524')
-4.30849050900660e4824524 + 8.69808435865358e4824524*I
sage: for z in [3,33,333,3333,33333]:
mpmath.erf(-1-i*z); erf(-1.-n(z)*i)
....:
mpc(real='330.81538696857206', imag='-443.38888183939281')
330.815386968572 - 443.388881839393*I
mpc(real='-2.0957487368415288e+468', imag='5.5629367605580166e+470')
-2.09574873684153e468 + 5.56293676055802e470*I
mpc(real='3.8930178706420656e+48153', imag='-1.8853741770265906e+48155')
3.89301787064207e48153 - 1.88537417702659e48155*I
mpc(real='4.3084905090066053e+4824524',
imag='-8.6980843586535772e+4824524')
4.30849050900661e4824524 - 8.69808435865358e4824524*I
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11948#comment:14>
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.