Saturday, April 30, 2016

[ntyllbtl] Deviation from asymptote

A few potentially useful functions for a calculator or numerical library, mostly within the theme of avoiding underflow, overflow, or loss of precision.

exp(x)-1 = expm1(x)
ln(x!) = log(x!) = log(gamma(x+1)) = lgamma(x+1)
1-cos(x)
1-sin(x)/x = 1-sinc(x)

erf(x)
1-erf(x) = erfc(x)
erfc(x)*exp(x^2) = erfcx(x)
1-erfcx(x)*x*sqrt(pi) = an even order power series that starts with 1/(2*x^2)

-i*erf(i*x) = erfi(x)
sqrt(pi)/2*exp(-x^2)*erfi(x) = F(x) Dawson function

And their inverses:

log(1+x) = log1p(x)

No comments :