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.
翻译:将指数收敛梯形法则应用于Faddeeva函数的适当积分表示,推导出其评估的简明公式。本文描述了该公式的性质、最大化其效率的策略,以及与其他评估方法(渐近展开和麦克劳林级数)的耦合。基于Faddeeva函数的值,所有其他复值误差类函数(如$\\rm erf$和$\\rm erfc$)均可轻松导出。所得算法已以IEEE双精度算术实现于公开可用的C/C++库$\\texttt{erflike}$中,并与基于泰勒级数和连分式的更广泛评估方法(由广泛使用的Faddeeva包提供)进行了对比测试。结果表明,本文提出的算法及其实现在复平面的大部分区域具有更高的精度和更规则的相对误差行为。在评估速度方面,$\\texttt{erflike}$库对复值参数的表现优于Faddeeva包,但对实值参数则不然。