Post Reply 
RE: HP48-HP50G : Error functions ERF(z), FRESNEL integrals, PROBIT, etc.
11-14-2023, 10:24 PM
Post: #26
RE: RE: HP48-HP50G : Error functions ERF(x or z), ERFC (x or z) & iERF/iERFc —>x
Hi, Gil

It is just taylor series: y(x+h) ≈ y(x) + y'(x) * h

function ierf_taylor(x)
y = ierf(x)
x = erf(y)
dx = erf(y)' dy
dy/dx = 1/erf(y)' = sqrt(pi)/2 * exp(y*y)
approx(y) = ierfc(1-x) = erf(1-(1-x)) = erf(x-1+1)
h = exact - approx = x - (x-1+1)

FYI, if x is small, h is usually not zero.

>x = pi/1e6
>x - (x-1+1)
-3.4641E-13

Since small x correspond to small y, dy/dx is very flat ≈ sqrt(pi)/2

ierf(ε) ≈ sqrt(pi)/2 * (ε + pi/12*ε^3 + 7/480*pi^2*ε^5)

function erf_taylor(x)
y = erf(x)
dy = erf(x)' dx
dy/dx = erf(x)' = 2/sqrt(pi) * exp(-x*x)
approx(y) = 1 - erfc(x), we need to get what x 'belongs' to this y
h = exact - approx = x - ierf_taylor(y)

When x is small, dy/dx again is very flat ≈ 2/sqrt(pi)

erf(ε) ≈ 2/sqrt(pi) * (ε - ε^3/5 + ε^5/10)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RE: HP48-HP50G : Error functions ERF(x or z), ERFC (x or z) & iERF/iERFc —>x - Albert Chan - 11-14-2023 10:24 PM



User(s) browsing this thread: 1 Guest(s)