Table of Contents
Fetching ...

Evaluation of complex-valued error-like functions by the exponentially-convergent trapezoidal rule

Federico Maria Guercilena

TL;DR

This work addresses the challenge of accurately evaluating complex-valued error-like functions across the complex plane. It employs the exponentially convergent composite trapezoidal rule applied to an integral representation of the Faddeeva function $w(z)$ to derive a compact evaluation formula, and then extends to related functions via closed-form relations. The main contributions include a double-precision implementation (erflike) with a carefully chosen step size $h$ and truncation ($N\approx12$), a plane-partition strategy for efficiency, and demonstrated superiority in accuracy and regularity over the Faddeeva package in many regions, plus open-source availability. The approach enables robust, fast computation of $erf$, $erfc$, $erfcx$, $erfi$, and Dawson through a single central function, with potential extensions to arbitrary precision and coupling to asymptotic and Maclaurin expansions for very large or small arguments.

Abstract

The exponentially convergent trapezoidal rule is applied to a suitable integral representation of the Faddeeva function to derive a simple formula for its evaluation. I describe its properties, strategies for maximising its efficiency, and its coupling with other evaluation methods (asymptotic expansions and Maclaurin series). From knowledge of the values of the Faddeeva function, all other complex-valued error-like functions such as $\rm erf$ and $\rm erfc$ can be easily obtained. The resulting algorithm has been implemented in a publicly-available C/C++ library named $\texttt{erflike}$ in IEEE double precision arithmetic, and tested against more widespread valuation methods based on Taylor series and continued fractions, as provided by the widely used Faddeeva package. It is found that the algorithm presented here and its implementation achieve better accuracy and a more regular behaviour of the relative error over vast regions of the complex plane. In terms of speed of evaluation the $\texttt{erflike}$ library also outperforms the Faddeeva package for complex valued arguments, although not for real-valued ones.

Evaluation of complex-valued error-like functions by the exponentially-convergent trapezoidal rule

TL;DR

This work addresses the challenge of accurately evaluating complex-valued error-like functions across the complex plane. It employs the exponentially convergent composite trapezoidal rule applied to an integral representation of the Faddeeva function to derive a compact evaluation formula, and then extends to related functions via closed-form relations. The main contributions include a double-precision implementation (erflike) with a carefully chosen step size and truncation (), a plane-partition strategy for efficiency, and demonstrated superiority in accuracy and regularity over the Faddeeva package in many regions, plus open-source availability. The approach enables robust, fast computation of , , , , and Dawson through a single central function, with potential extensions to arbitrary precision and coupling to asymptotic and Maclaurin expansions for very large or small arguments.

Abstract

The exponentially convergent trapezoidal rule is applied to a suitable integral representation of the Faddeeva function to derive a simple formula for its evaluation. I describe its properties, strategies for maximising its efficiency, and its coupling with other evaluation methods (asymptotic expansions and Maclaurin series). From knowledge of the values of the Faddeeva function, all other complex-valued error-like functions such as and can be easily obtained. The resulting algorithm has been implemented in a publicly-available C/C++ library named in IEEE double precision arithmetic, and tested against more widespread valuation methods based on Taylor series and continued fractions, as provided by the widely used Faddeeva package. It is found that the algorithm presented here and its implementation achieve better accuracy and a more regular behaviour of the relative error over vast regions of the complex plane. In terms of speed of evaluation the library also outperforms the Faddeeva package for complex valued arguments, although not for real-valued ones.

Paper Structure

This paper contains 13 sections, 37 equations, 7 figures.

Figures (7)

  • Figure 1: Domain colouring of the Faddeeva function on the complex plane. Superimposed in white and black are the boundaries of the regions of Sec. \ref{['sec:implementation']}, themselves indicated by capital letters.
  • Figure 2: Relative error in the computation of the Faddeeva function $\textnormal{w}(z)$ over the complex plane in units of the double precision epsilon $\epsilon_{\textnormal{DP}}$. The colour scale is linear up to $5\epsilon_{\textnormal{DP}}$ and logarithmic beyond.
  • Figure 3: Relative error in the computation of the error-like functions over the real axis in units of the double precision epsilon $\epsilon_{\textnormal{DP}}$. The ordinate scale is linear up to $5\epsilon$ and logarithmic beyond. Values relative to the Faddeeva package are marked by blue dots. Values relative to the erflike library are denoted by green dots if their accuracy is no more than twice worse than that of the Faddeeva package, by red upwards-pointing triangles otherwise.
  • Figure 4: Left panel: time of evaluation of the Faddeeva function $\textnormal{w}(z)$ over the complex plane for the erflike implementation, in nanoseconds. Right panel: ratio of evaluation speed of the erflike library with respect to the Faddeeva package.
  • Figure 5: Evaluation time of the real-valued error-like functions, expressed in nanoseconds, for both the Faddeeva package and erflike library.
  • ...and 2 more figures