Commit e495e25a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr120: Add fallback implementation of erf function.

parent ddff85a3
......@@ -2740,8 +2740,15 @@ double CDECL MSVCR120_erf(double x)
#ifdef HAVE_ERF
return erf(x);
#else
FIXME( "not implemented\n" );
return 0.0;
/* Abramowitz and Stegun approximation, maximum error: 1.5*10^-7 */
double t, y;
int sign = signbit(x);
if (sign) x = -x;
t = 1 / (1 + 0.3275911 * x);
y = ((((1.061405429*t - 1.453152027)*t + 1.421413741)*t - 0.284496736)*t + 0.254829592)*t;
y = 1.0 - y*exp(-x*x);
return sign ? -y : y;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment