cerfi3
Imaginary error function
Usage
double complex
cerfi
(
double
complex
z
);
double erfi
(
double
x
);
Overview
The function cerfi returns an error function rotated in the complex plane, erfi(z) = -i erf(iz).
The function erfi takes a real argument and returns a real result.
Accuracy
Errors are given in units of eps = 2^-53 = 1.1e-16, as relative deviations from high-precision reference values; for complex results, of the modulus.
erfi(x) = exp(x^2) Im w(x) is computed from im_w_of_x(3), with the exponent x^2 carried as an unevaluated sum of two doubles; the relative error was found below 4.7 eps for 0.2 < x < 26.3. The exponential alone overflows from |x| = 26.6417 on; since Im w(x) < 1/(sqrt(pi) x) brings the product back into range, a constant is split off the exponent there, so that the full range of erfi is available and +-Inf is returned only from |x| = 26.7140 on, where erfi itself exceeds the double format.
cerfi(z) = -i erf(iz) inherits the accuracy of cerf(3), the rotation by a right angle being exact: the error is not controlled, the relative error is unbounded near the zeros of erfi, the first of which lie at z = +-1.8809 +- 1.4506i, and it reaches about 120 eps close to the origin, for 0.01 < |z| < 0.1 off the coordinate axes, where the Maclaurin series is not used.
References
Joachim Wuttke, "libcerf, complex error function and related functions reimplemented with relative accuracy guarantees" (unpublished manuscript, available upon request) documents the algorithms of this library and derives their error bounds.
Contact
Please report bugs to the maintainer:
Joachim Wuttke <[email protected]>
Copying
Copyright (c) 2012 Massachusetts Institute of Technology
Copyright (c) 2013 Forschungszentrum Juelich GmbH
Software: MIT License.
This documentation: Creative Commons Attribution Share Alike.
History
- Arch Linux 2026-11-01: the text shown here
- Debian 13 (Trixie)
- Debian 12 (Bookworm) to Debian 8 (Jessie)