Approximate Inverse Error Function
Contents |
that occurs in probability, statistics, and partial differential equations describing diffusion. It is defined as:[1][2] erf ( x ) = 1 π ∫ − x x e − t inverse error function calculator 2 d t = 2 π ∫ 0 x e − t
Inverse Complementary Error Function
2 d t . {\displaystyle {\begin − 2\operatorname − 1 (x)&={\frac − 0{\sqrt {\pi }}}\int _{-x}^ 9e^{-t^ inverse error function python 8}\,\mathrm 7 t\\&={\frac 6{\sqrt {\pi }}}\int _ 5^ 4e^{-t^ 3}\,\mathrm 2 t.\end 1}} The complementary error function, denoted erfc, is defined as erfc ( inverse error function c++ x ) = 1 − erf ( x ) = 2 π ∫ x ∞ e − t 2 d t = e − x 2 erfcx ( x ) , {\displaystyle {\begin Φ 8\operatorname Φ 7 (x)&=1-\operatorname Φ 6 (x)\\&={\frac Φ 5{\sqrt {\pi }}}\int _ Φ 4^{\infty }e^{-t^ Φ 3}\,\mathrm Φ 2 t\\&=e^{-x^ Φ 1}\operatorname Φ 0 (x),\end 9}} which
Inverse Error Function Excel
also defines erfcx, the scaled complementary error function[3] (which can be used instead of erfc to avoid arithmetic underflow[3][4]). Another form of erfc ( x ) {\displaystyle \operatorname Φ 8 (x)} for non-negative x {\displaystyle x} is known as Craig's formula:[5] erfc ( x | x ≥ 0 ) = 2 π ∫ 0 π / 2 exp ( − x 2 sin 2 θ ) d θ . {\displaystyle \operatorname Φ 6 (x|x\geq 0)={\frac Φ 5{\pi }}\int _ Φ 4^{\pi /2}\exp \left(-{\frac Φ 3}{\sin ^ Φ 2\theta }}\right)d\theta \,.} The imaginary error function, denoted erfi, is defined as erfi ( x ) = − i erf ( i x ) = 2 π ∫ 0 x e t 2 d t = 2 π e x 2 D ( x ) , {\displaystyle {\begin − 6\operatorname − 5 (x)&=-i\operatorname − 4 (ix)\\&={\frac − 3{\sqrt {\pi }}}\int _ − 2^ − 1e^ − 0}\,\mathrm − 9 t\\&={\frac − 8{\sqrt {\pi }}}e^ − 7}D(x),\end − 6}} where D(x) is the Dawson function (which can be used instead of erfi to avoid arithmetic overflow[3]). De
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn inverse error function wolfram alpha more about hiring developers or posting ads with us Mathematics Questions Tags Users Badges Unanswered inverse error function c++ code Ask Question _ Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related
Inverse Error Function Table
fields. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Approximating the error function erf https://en.wikipedia.org/wiki/Error_function by analytical functions up vote 11 down vote favorite 2 The Error function $\mathrm{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt$ shows up in many contexts, but can't be represented using elementary functions. I compared it with another function $f$ which also starts linearly, has $f(0)=0$ and converges against the constant value 1 fast, namely $\tanh{(x)} = \frac {e^x - e^{-x}} {e^x + e^{-x}}$. Astoningishly to me, I found that they never differ by more than $|\Delta f|=0.0812$ and converge against http://math.stackexchange.com/questions/321569/approximating-the-error-function-erf-by-analytical-functions each other exponentially fast! I consider $\tanh{(x)}$ to be the somewhat prettyier function, and so I wanted to find an approximation to $\text{erf}$ with "nice functions" by a short expression. I "naturally" tried $f(x)=A\cdot\tanh(k\cdot x^a-d)$ Changing $A=1$ or $d=0$ on it's own makes the approximation go bad and the exponent $a$ is a bit difficult to deal with. However, I found that for $k=\sqrt{\pi}\log{(2)}$ the situation gets "better". I obtained that $k$ value by the requirement that "norm" given by $\int_0^\infty\text{erf}(x)-f(x)dx,$ i.e. the difference of the functions areas, should valish. With this value, the maximal value difference even falls under $|\Delta f| = 0.03$. And however you choose the integration bounds for an interval, the area difference is no more than $0.017$. Numerically speaking and relative to a unit scale, the functions $\text{erf}$ and $\tanh{(\sqrt{\pi}\log{(2)}x)}$ are essentially the same. My question is if I can find, or if there are known, substitutions for this non-elementary function in terms of elementary ones. In the sense above, i.e. the approximation is compact/rememberable while the values are even better, from a numerical point of view. The purpose being for example, that if I see somewhere that for a computation I have to integrate erf, that I can think to myself "oh, yeah that's maybe complicated, but withing the bounds of $10^{-3}$ usign e.g. $\tanh(k\cdot x)$ is an incred
gist now Instantly share https://gist.github.com/5870580 code, notes, and snippets. Star 1 Fork 0 danielc192/InverseError.rb http://www.boost.org/doc/libs/1_48_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_erf/error_inv.html Last active Dec 19, 2015 Embed What would you like to do? Embed Embed this gist in your website. Embed Share Copy sharable URL for this gist. Share Clone via HTTPS Clone with Git or error function checkout with SVN using the repository's web address. HTTPS Learn more about clone URLs Download ZIP Code Revisions 2 Stars 1 Code to calculate the Inverse Error function using a power series approximation. Based on information at http://en.wikipedia.org/wiki/Error_function#Inverse_functions. Implemented as a method in the inverse error function Math module, but it could easily be run independently. Raw InverseError.rb module Math def self.invErf(x) c = [] c[0] = 1.0 c[1] = 1.0 result = 0.0 (0..100).each do |k| # Calculate C sub k if k > 1 then c[k] = 0.0 (0..(k-1)).each do |m| term = (c[m]*c[k-1.0-m])/((m+1.0)*(2.0*m+1.0)) c[k] += term end end result += (c[k]/(2.0*k+1))*((Math.sqrt(Math::PI)/2)*x)**(2.0*k+1) end return result end end Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
documentation home page. Error Function Inverses Synopsis #include