Skip to content

Imaginary parts of error functions are incorrect #545

Description

@paulmasson

The error function is odd in its argument, so that comparing values of the complementary error function on either side of the complex plane should merely have a change of sign. Instead:

>>> x=100+j
>>> erfc(x)
mpc(real='8.634691205220881e-4346', imag='1.5120569745187501e-4345')
>>> erfc(-x)
mpc(real='2.0', imag='-3.75294172883895e-25')

As you can see there is a major difference in magnitude between the two complex parts. This appears to be because in the left-hand plane the evaluation of erfc is processed through erf, so the problem must be there.

Indeed, Mathematica 10 gives

Erf[100. + I] 
1. - 1.512056974518836*10^-4345 I

whose imaginary part mostly matches that above, while mpmath has

>>> erf(100+j)
mpc(real='1.0', imag='-7.6847485642570108e-23')

Something is amiss in the error function...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions