msvcr120: Add fallback implementation of erf function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ddff85a361
commit
e495e25af7
|
@ -2740,8 +2740,15 @@ double CDECL MSVCR120_erf(double x)
|
||||||
#ifdef HAVE_ERF
|
#ifdef HAVE_ERF
|
||||||
return erf(x);
|
return erf(x);
|
||||||
#else
|
#else
|
||||||
FIXME( "not implemented\n" );
|
/* Abramowitz and Stegun approximation, maximum error: 1.5*10^-7 */
|
||||||
return 0.0;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue