Uniform Convergent Expansions of the Error Function in Terms of Elementary Functions

We derive a new analytic representation of the error function erfz\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\text {erf}}\,\, z$$\end{document} in the form of a convergent series whose terms are exponential and rational functions. The expansion holds uniformly in z in the double sector |arg(±z)|<π/4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\vert \arg (\pm z)\vert <\pi /4$$\end{document}. The expansion is accompanied by realistic error bounds.


Introduction
The error function erf z is defined in the form [11,Section 7 It is a special function that plays a fundamental role in statistics, since it is related to the normal Gaussian distribution. It has also important applications in uniform asymptotic expansions of integrals and also in the so-called Stokes phenomenon [1]. For other mathematical and physical applications the reader is referred to [11,Section 7.20]. Different expansions of this function can be found in the literature. The power series expansion of the error function is given by [11,Section 7 (−1) n z 2n+1 n!(2n + 1) , z ∈ C.
This expansion converges absolutely for z ∈ C. It may be derived from the second integral representation in (1) by replacing the factor e −z 2 t 2 by its Taylor series at the origin and interchanging sum and integral. This Taylor series expansion converges for z ∈ C, but the convergence is not uniform in |z|, since the error term grows with |z|. Therefore, the expansion (2) is not uniform in |z| as the remainder is unbounded in |z|. A different power series expansion of erf z is given by [11,Section 7.6,Equation 7.6.2] As the previous series, it converges for z ∈ C, but the convergence is not uniform in |z|. An asymptotic expansion of erf z for large |z| and | arg z| < 3π 4 is given by [11,Section 7.12,Equation 7.12.1] and Simple error bounds for these two asymptotic expansions are indicated in [11,Section 7.12]; they are not uniform in |z|, as they blow up when z → 0.
Other expansions in series of Bessel functions and spherical Bessel functions can be found in [9, pp. 57-58] and [11,Section 7.6] respectively. We do not give details here since, in contrast to the above expansions, these expansions are not given in terms of elementary functions. In this paper we derive a convergent expansion of erf z in terms of elementary functions that holds uniformly in z in the double sector | arg(±z)| < π/4. To this end, we apply the method introduced in [8]. This technique provides a general theory of analytic expansions of integral transforms with the following properties: (i) it is uniform in a selected variable z in an unbounded subset of the complex plane that includes the point z = 0; (ii) it is convergent; (iii) it is given in terms of elementary functions of z. This method was previously applied successfully to a selection of different special functions (see [2][3][4][5][6][7]).

A Uniform Convergent Expansion of erf z
We first consider the following lemma that will be useful in the proof of the main result of the paper.
Proof. We define w := √ z + 1. We have that | arg(z + 1)| ≤ π, and then w ≥ 0, and it is clear that The result follows by replacing w by √ z + 1.

Theorem 1.
Consider z ∈ C with | arg z| < π/4. Then, for n = 1, 3, 5, . . ., where A n (z 2 ) and B n (z 2 ) are polynomials that, for convenience, we write in the form The remainder term R n (z) is bounded in either of the following forms For z > 0 we have the sharper bounds and the Taylor expansion of the factor 1/(1 + t 2 ) in (12) at the end point t = 0 of the integration interval (0, 1), where r n (t) is the remainder term Replacing expansion (13) into (12) and interchanging sum and integral we obtain, for any n = 1, 2, 3, . . ., Integrating by parts k − 2 times in (17), we obtain Before we complete the derivation of formula (7), we need to obtain some error bounds for the remainder termR n (a) in (16). We have that A different bound of the remainder term in (16) can be found from We complete now the derivation of formula (7). From (12), (15) and (18), and using the definitions (15) of A n and B n , we get the following algebraic whereR n (a) has been defined in (16). Solving equation (21) for x we obtain the two possible solutions • We have that lim a→+∞ erf √ a = 1, and only the solution x + satisfies this condition.
• We have that lim a→0 + erf √ a = 0, and only the solution x + with n odd satisfies this condition.
Therefore, for odd n, the correct solution is Or equivalently with n odd. Setting a = z 2 and multiplying numerator and denominator of the fraction on the right hand side above by z 2n−1 we obtain (7) with R n (a) given above. 1 In the remaining of this proof we derive the error bounds for the remainder term R n (a) given in the statement of the theorem.
When a > 0 it is possible to get more accurate bounds for the remainder term R n (a) in (24). Therefore, we analyze first the particular case a > 0 and then the general case a > 0. • Case a > 0. We use that √ 1 + x − 1 ≤ x/2 for all x > 0, and that, for odd n, Then Since Γ(n + 1/2) ≥ Γ(n) = (n − 1)! and from [10, Section 8.10, Equation 8.10.5], Using the bound (19) we find |R n (a)| ≤ 2e −a π (−1) n π 4 + n−1 k=0 from where we deduce the first bound in (11) for odd n. On the other hand, using (20) we find |R n (a)| ≤ 2e −a π(2n + 1) from where we deduce the second bound in (11). From either of the bounds in (11) we see that (7) is a uniform convergent expansion of erf z for z > 0. • Case a > 0. We rewrite the remainder (24) in the form

Numerical Experiments
In Figures 1, 2, 3 and Tables 1, 2 we compare erf z to the approximations provided by the Taylor expansions (2) and (3), the asymptotic expansion (4), and the uniform expansion (7) for different (odd) values of n. All the computations were carried out with the symbolic manipulator Wolfram Mathematica 11.3 ; in particular, the command Erf was used to compute the "exact" value of the error function. Expansions (2) and (3) are more competitive for small |z|, whereas expansion (4) is more competitive for large |z|. However, expansion (7) is more competitive for intermediate values of |z| and moreover, it is more competitive globally, in L 1 norm say.
Funding Open Access funding provided by Universidad Pública de Navarra.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creativecommons.org/licenses/by/4.0/.
Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.