Computes the error function erf(u) with a maximum error of 1.5e-7. Implementation is according to Abramowitz and Stegun (see Handbook of Mathematical Functions, page 299, equation 7.1.26).
function erfSimple input Real u; output Real y "y = 2/sqrt(pi)*Integral_0_u exp(-t^2)*dt"; end erfSimple;
Date | Description | ||
---|---|---|---|
June 22, 2015 |
|