Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Error function
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Approximation with elementary functions=== <ul> <li> [[Abramowitz and Stegun]] give several approximations of varying accuracy (equations 7.1.25–28). This allows one to choose the fastest approximation suitable for a given application. In order of increasing accuracy, they are: <math display="block">\operatorname{erf} x \approx 1 - \frac{1}{\left(1 + a_1x + a_2x^2 + a_3x^3 + a_4x^4\right)^4}, \qquad x \geq 0</math> (maximum error: {{val|5e-4}}) {{pb}} where {{math|''a''<sub>1</sub> {{=}} 0.278393}}, {{math|''a''<sub>2</sub> {{=}} 0.230389}}, {{math|''a''<sub>3</sub> {{=}} 0.000972}}, {{math|''a''<sub>4</sub> {{=}} 0.078108}} <math display="block">\operatorname{erf} x \approx 1 - \left(a_1t + a_2t^2 + a_3t^3\right)e^{-x^2},\quad t=\frac{1}{1 + px}, \qquad x \geq 0</math> (maximum error: {{val|2.5e-5}}) {{pb}} where {{math|''p'' {{=}} 0.47047}}, {{math|''a''<sub>1</sub> {{=}} 0.3480242}}, {{math|''a''<sub>2</sub> {{=}} −0.0958798}}, {{math|''a''<sub>3</sub> {{=}} 0.7478556}} <math display="block">\operatorname{erf} x \approx 1 - \frac{1}{\left(1 + a_1x + a_2x^2 + \cdots + a_6x^6\right)^{16}}, \qquad x \geq 0</math> (maximum error: {{val|3e-7}}) {{pb}} where {{math|''a''<sub>1</sub> {{=}} 0.0705230784}}, {{math|''a''<sub>2</sub> {{=}} 0.0422820123}}, {{math|''a''<sub>3</sub> {{=}} 0.0092705272}}, {{math|''a''<sub>4</sub> {{=}} 0.0001520143}}, {{math|''a''<sub>5</sub> {{=}} 0.0002765672}}, {{math|''a''<sub>6</sub> {{=}} 0.0000430638}} <math display="block">\operatorname{erf} x \approx 1 - \left(a_1t + a_2t^2 + \cdots + a_5t^5\right)e^{-x^2},\quad t = \frac{1}{1 + px}</math> (maximum error: {{val|1.5e-7}}) {{pb}} where {{math|''p'' {{=}} 0.3275911}}, {{math|''a''<sub>1</sub> {{=}} 0.254829592}}, {{math|''a''<sub>2</sub> {{=}} −0.284496736}}, {{math|''a''<sub>3</sub> {{=}} 1.421413741}}, {{math|''a''<sub>4</sub> {{=}} −1.453152027}}, {{math|''a''<sub>5</sub> {{=}} 1.061405429}} {{pb}} All of these approximations are valid for {{math|''x'' ≥ 0}}. To use these approximations for negative {{mvar|x}}, use the fact that {{math|erf ''x''}} is an odd function, so {{math|erf ''x'' {{=}} −erf(−''x'')}}. </li> <li> Exponential bounds and a pure exponential approximation for the complementary error function are given by<ref>{{cite journal |url = http://campus.unibo.it/85943/1/mcddmsTranWIR2003.pdf |last1= Chiani|first1= M.|last2= Dardari|first2= D. |last3=Simon |first3= M.K.|date = 2003 |title = New Exponential Bounds and Approximations for the Computation of Error Probability in Fading Channels|journal = IEEE Transactions on Wireless Communications|volume = 2|number=4|pages = 840–845| doi=10.1109/TWC.2003.814350 | citeseerx= 10.1.1.190.6761}}</ref> <math display="block">\begin{align} \operatorname{erfc} x &\leq \frac{1}{2}e^{-2 x^2} + \frac{1}{2}e^{- x^2} \leq e^{-x^2}, &\quad x &> 0 \\[1.5ex] \operatorname{erfc} x &\approx \frac{1}{6}e^{-x^2} + \frac{1}{2}e^{-\frac{4}{3} x^2}, &\quad x &> 0 . \end{align}</math> </li> <li> The above have been generalized to sums of {{mvar|N}} exponentials<ref>{{cite journal |doi=10.1109/TCOMM.2020.3006902 |title=Global minimax approximations and bounds for the Gaussian Q-function by sums of exponentials|journal=IEEE Transactions on Communications |year=2020 |last1=Tanash |first1=I.M. |last2=Riihonen |first2=T. |volume=68 |issue=10 |pages=6514–6524 |arxiv=2007.06939 |s2cid=220514754}}</ref> with increasing accuracy in terms of {{mvar|N}} so that {{math|erfc ''x''}} can be accurately approximated or bounded by {{math|2''Q̃''({{sqrt|2}}''x'')}}, where <math display="block">\tilde{Q}(x) = \sum_{n=1}^N a_n e^{-b_n x^2}.</math> In particular, there is a systematic methodology to solve the numerical coefficients {{math|{(''a<sub>n</sub>'',''b<sub>n</sub>'')}{{su|b=''n'' {{=}} 1|p=''N''}}}} that yield a [[minimax approximation algorithm|minimax]] approximation or bound for the closely related [[Q-function]]: {{math|''Q''(''x'') ≈ ''Q̃''(''x'')}}, {{math|''Q''(''x'') ≤ ''Q̃''(''x'')}}, or {{math|''Q''(''x'') ≥ ''Q̃''(''x'')}} for {{math|''x'' ≥ 0}}. The coefficients {{math|{(''a<sub>n</sub>'',''b<sub>n</sub>'')}{{su|b=''n'' {{=}} 1|p=''N''}}}} for many variations of the exponential approximations and bounds up to {{math|''N'' {{=}} 25}} have been released to open access as a comprehensive dataset.<ref>{{cite journal | doi=10.5281/zenodo.4112978 | title=Coefficients for Global Minimax Approximations and Bounds for the Gaussian Q-Function by Sums of Exponentials [Data set] | url=https://zenodo.org/record/4112978 | website=Zenodo | year=2020 | last1=Tanash | first1=I.M. | last2=Riihonen | first2=T.}}</ref></li> <li> A tight approximation of the complementary error function for {{math|''x'' ∈ [0,∞)}} is given by [[George Karagiannidis|Karagiannidis]] & Lioumpas (2007)<ref>{{cite journal|last1=Karagiannidis |first1=G. K. |last2=Lioumpas |first2=A. S. |url=http://users.auth.gr/users/9/3/028239/public_html/pdf/Q_Approxim.pdf |title=An improved approximation for the Gaussian Q-function |date=2007 |journal=IEEE Communications Letters |volume=11 |issue=8 |pages=644–646|doi=10.1109/LCOMM.2007.070470 |s2cid=4043576 }}</ref> who showed for the appropriate choice of parameters {{math|{''A'',''B''}<nowiki/>}} that <math display="block">\operatorname{erfc} x \approx \frac{\left(1 - e^{-Ax}\right)e^{-x^2}}{B\sqrt{\pi} x}.</math> They determined {{math|{''A'',''B''} {{=}} {1.98,1.135}<nowiki/>}}, which gave a good approximation for all {{math|''x'' ≥ 0}}. Alternative coefficients are also available for tailoring accuracy for a specific application or transforming the expression into a tight bound.<ref>{{cite journal |doi=10.1109/LCOMM.2021.3052257|title=Improved coefficients for the Karagiannidis–Lioumpas approximations and bounds to the Gaussian Q-function|journal=IEEE Communications Letters | year=2021 | last1=Tanash | first1=I.M.|last2=Riihonen|first2=T.|volume=25|issue=5|pages=1468–1471|arxiv=2101.07631|s2cid=231639206}}</ref> </li> <li> A single-term lower bound is<ref>{{cite journal |last1=Chang |first1=Seok-Ho |last2=Cosman |first2=Pamela C. |author-link2 = Pamela Cosman |last3=Milstein |first3=Laurence B. |date=November 2011 |title=Chernoff-Type Bounds for the Gaussian Error Function |url=http://escholarship.org/uc/item/6hw4v7pg |journal=IEEE Transactions on Communications |volume=59 |issue=11 |pages=2939–2944 |doi=10.1109/TCOMM.2011.072011.100049 |s2cid=13636638}}</ref> <math display="block" display="block">\operatorname{erfc} x \geq \sqrt{\frac{2 e}{\pi}} \frac{\sqrt{\beta - 1}}{\beta} e^{- \beta x^2}, \qquad x \ge 0,\quad \beta > 1,</math> where the parameter {{mvar|β}} can be picked to minimize error on the desired interval of approximation. </li> <li> Another approximation is given by Sergei Winitzki using his "global Padé approximations":<ref>{{cite book |last=Winitzki |first=Sergei |title=Computational Science and Its Applications – ICCSA 2003 |date=2003 |volume=2667 |chapter=Uniform approximations for transcendental functions |publisher=Springer, Berlin |pages=[https://archive.org/details/computationalsci0000iccs_a2w6/page/780 780–789] |isbn=978-3-540-40155-1 |doi=10.1007/3-540-44839-X_82 |chapter-url-access=registration |chapter-url=https://archive.org/details/computationalsci0000iccs_a2w6 |series=Lecture Notes in Computer Science }}</ref><ref>{{cite journal|last1=Zeng |first1=Caibin |last2=Chen |first2=Yang Cuan |title=Global Padé approximations of the generalized Mittag-Leffler function and its inverse |journal=Fractional Calculus and Applied Analysis |date=2015 |volume=18 |issue=6 | pages=1492–1506 |doi= 10.1515/fca-2015-0086 |quote=Indeed, Winitzki [32] provided the so-called global Padé approximation | arxiv=1310.5592 |s2cid=118148950 }}</ref>{{rp|2–3}} <math display="block">\operatorname{erf} x \approx \sgn x \cdot \sqrt{1 - \exp\left(-x^2\frac{\frac{4}{\pi} + ax^2}{1 + ax^2}\right)}</math> where <math display="block">a = \frac{8(\pi - 3)}{3\pi(4 - \pi)} \approx 0.140012.</math> This is designed to be very accurate in a neighborhood of 0 and a neighborhood of infinity, and the ''relative'' error is less than 0.00035 for all real {{mvar|x}}. Using the alternate value {{math|''a'' ≈ 0.147}} reduces the maximum relative error to about 0.00013.<ref>{{Cite web <!-- Deny Citation Bot--> |url=https://www.academia.edu/9730974/A_handy_approximation_for_the_error_function_and_its_inverse |last=Winitzki |first=Sergei |date=6 February 2008 |title=A handy approximation for the error function and its inverse }}</ref> {{pb}} This approximation can be inverted to obtain an approximation for the inverse error function: <math display="block">\operatorname{erf}^{-1}x \approx \sgn x \cdot \sqrt{\sqrt{\left(\frac{2}{\pi a} + \frac{\ln\left(1 - x^2\right)}{2}\right)^2 - \frac{\ln\left(1 - x^2\right)}{a}} -\left(\frac{2}{\pi a} + \frac{\ln\left(1 - x^2\right)}{2}\right)}.</math> </li> <li> An approximation with a maximal error of {{val|1.2e-7}} for any real argument is:<ref>{{cite book | last = Press | first = William H. | title = Numerical Recipes in Fortran 77: The Art of Scientific Computing | isbn = 0-521-43064-X | year = 1992 | page = 214 | publisher = Cambridge University Press }}</ref> <math display="block">\operatorname{erf} x = \begin{cases} 1-\tau & x\ge 0\\ \tau-1 & x < 0 \end{cases}</math> with <math display="block">\begin{align} \tau &= t\cdot\exp\left(-x^2-1.26551223+1.00002368 t+0.37409196 t^2+0.09678418 t^3 -0.18628806 t^4\right.\\ &\left. \qquad\qquad\qquad +0.27886807 t^5-1.13520398 t^6+1.48851587 t^7 -0.82215223 t^8+0.17087277 t^9\right) \end{align}</math> and <math display="block">t = \frac{1}{1 + \frac{1}{2}|x|}.</math> </li> <li>An approximation of <math>\operatorname{erfc}</math> with a maximum relative error less than <math>2^{-53}</math> <math>\left(\approx 1.1 \times 10^{-16}\right)</math> in absolute value is:<ref>{{Cite journal | last = Dia | first = Yaya D. |date = 2023 | title = Approximate Incomplete Integrals, Application to Complementary Error Function | url = https://www.ssrn.com/abstract=4487559 | journal = SSRN Electronic Journal | language = en | doi = 10.2139/ssrn.4487559 | issn = 1556-5068}}</ref> for {{nowrap|<math>x\ge 0</math>,}} <math display="block">\begin{aligned} \operatorname{erfc} \left(x\right) & = \left(\frac{0.56418958354775629}{x+2.06955023132914151}\right) \left(\frac{x^2+2.71078540045147805 x+5.80755613130301624}{x^2+3.47954057099518960 x+12.06166887286239555}\right) \\ & \left(\frac{x^2+3.47469513777439592 x+12.07402036406381411}{x^2+3.72068443960225092 x+8.44319781003968454}\right) \left(\frac{x^2+4.00561509202259545 x+9.30596659485887898}{x^2+3.90225704029924078 x+6.36161630953880464}\right) \\ & \left(\frac{x^2+5.16722705817812584 x+9.12661617673673262}{x^2+4.03296893109262491 x+5.13578530585681539}\right) \left(\frac{x^2+5.95908795446633271 x+9.19435612886969243}{x^2+4.11240942957450885 x+4.48640329523408675}\right) e^{-x^2} \\ \end{aligned}</math> and for <math>x<0</math> <math display="block">\operatorname{erfc} \left(x\right) = 2 - \operatorname{erfc} \left(-x\right)</math> </li> <li> A simple approximation for real-valued arguments could be done through [[Hyperbolic functions]]: <math display="block">\operatorname{erf} \left(x\right) \approx z(x) = \tanh\left(\frac{2}{\sqrt{\pi}}\left(x+\frac{11}{123}x^3\right)\right)</math> which keeps the absolute difference {{nowrap|<math>\left|\operatorname{erf} \left(x\right)-z(x)\right| < 0.000358,\, \forall x</math>.}} </li> <li> Since the error function and the Gaussian Q-function are closely related through the identity <math>\operatorname{erfc}(x) = 2 Q(\sqrt{2} x)</math> or equivalently <math>Q(x) = \frac{1}{2} \operatorname{erfc}\left(\frac{x}{\sqrt{2}}\right)</math>, bounds developed for the Q-function can be adapted to approximate the complementary error function. A pair of tight lower and upper bounds on the Gaussian Q-function for positive arguments <math>x \in [0, \infty)</math> was introduced by Abreu (2012)<ref>{{cite journal |doi=10.1109/TCOMM.2012.080612.110075 |title=Very Simple Tight Bounds on the Q-Function |journal=IEEE Transactions on Communications |volume=60 |issue=9 |pages=2415–2420 |year=2012 |last=Abreu |first=Giuseppe}}</ref> based on a simple algebraic expression with only two exponential terms: <math display="block">Q(x) \geq \frac{1}{12} e^{-x^2} + \frac{1}{\sqrt{2\pi} (x + 1)} e^{-x^2 / 2}, \qquad x \geq 0,</math> and <math display="block">Q(x) \leq \frac{1}{50} e^{-x^2} + \frac{1}{2 (x + 1)} e^{-x^2 / 2}, \qquad x \geq 0.</math> These bounds stem from a unified form <math display="block">Q_{\mathrm{B}}(x; a, b) = \frac{\exp(-x^2)}{a} + \frac{\exp(-x^2 / 2)}{b (x + 1)},</math> where the parameters <math>a</math> and <math>b</math> are selected to ensure the bounding properties: for the lower bound, <math>a_{\mathrm{L}} = 12</math> and <math>b_{\mathrm{L}} = \sqrt{2\pi}</math>, and for the upper bound, <math>a_{\mathrm{U}} = 50</math> and <math>b_{\mathrm{U}} = 2</math>. These expressions maintain simplicity and tightness, providing a practical trade-off between accuracy and ease of computation. They are particularly valuable in theoretical contexts, such as communication theory over fading channels, where both functions frequently appear. Additionally, the original Q-function bounds can be extended to <math>Q^n(x)</math> for positive integers <math>n</math> via the binomial theorem, suggesting potential adaptability for powers of <math>\operatorname{erfc}(x)</math>, though this is less commonly required in error function applications. </li> </ul>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Error function
(section)
Add topic