Post Reply 
RE: HP48-HP50G : Error functions ERF(z), FRESNEL integrals, PROBIT, etc.
11-12-2023, 10:16 PM (This post was last modified: 11-13-2023 10:22 AM by Gil.)
Post: #21
RE: HP48-HP50G : Error functions ERF(x or z), ERFC (x or z) & iERF/iERFc —>x
Summary

Now, both ERF and ERFc functions allow as single argument
a real x (the returned result will be a real "probability")
or a complex number in the form (a b) (the returned result will be a complex number);

Their inverse functions iERF and iERFc, however, only admit here as single argument a real number/"probability" (the returned result will be the real number x).

Note
For real argument/numbers, the results calculated here for ERF and Erfc may differ by 1 unit in the last digit in comparison with the built-in functions erf(x) and erfc(x) of the HP PRIME.
For complex arguments, the results calculated here for ERF and ERFc may slightly differ in their last two last digits (the HP PRIME is then more accurate).

ERF
\\<< \"1 Arg
.real x or
.complex (a b)\" DROP DUP TYPE 1 \\=/
IF
THEN 0
ELSE C\\->R
END \\-> x y
\\<< x DUP SIGN SWAP ABS 0 .5 ROT UTPN -2 * 1 + * y 0 \\=/
IF
THEN 'e^-x^2/(2*\\pi*x)*(1-COS(2*x*y)+i*SIN(2*x*y))' \\->NUM + '2/\\pi*e^-x^2' \\->NUM '\\GS(k=1,30,e^(-k^2/4)/(k^2+4*x^2)*(2*x*(1-COS(2*x*y)*COSH(k*y))+k*SIN(2*x*y)*SINH(k*y)+i*(2*x*SIN(2*x*y)*COSH(k*y)+k*COS(2​*x*y)*SINH(k*y))))' \\->NUM * + \\->NUM
END
\\>>
\\>>

iERF
\\<< \"1 Arg
.a real
(not a complex !)\" DROP 1 - -2 / NOVAL \\-> p X
\\<<
\\<< p 0 .5 X UTPN -
\\>> 'X' 2 # 2F12Ch SYSEVAL \"x of Erf\" \\->TAG
\\>>
\\>>
If you have another calculator than the HP50G, please don't use # 2F12Ch SYSEVAL.

Use instead:
iERF
\<< "1 Arg
.a real
(not a complex !)" DROP 1 - -2 / \-> p
\<<
\<< p 0 .5 X UTPN -
\>> 'X' 2 ROOT "x of Erf" \->TAG 'X' PURGE
\>>
\>>

ERFc
\\<< \"1 Arg
.real x or
.complex (a b)\" DROP ERF NEG 1 +
\\>>

iERFc
\\<< \"1 Arg
.a real
(not a complex !)\" DROP 2 / NOVAL \\-> p X
\\<<
\\<< p 0 .5 X UTPN -
\\>> 'X' 2 # 2F12Ch SYSEVAL \"x of Erfc\" \\->TAG
\\>>
\\>>
If you have another calculator than the HP50G, please don't use # 2F12Ch SYSEVAL.

Use instead:
iERFc
\<< "1 Arg
.a real
(not a complex !)" DROP 2 / \-> p
\<<
\<< p 0 .5 X UTPN -
\>> 'X' 2 ROOT "x of Erfc" \->TAG 'X' PURGE
\>>
\>>


Attached File(s)
.hp  ERROR.HP (Size: 1.4 KB / Downloads: 2)
Find all posts by this user
Quote this message in a reply
Post Reply 


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



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