Commit 9008cd2f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Match native cosf results in -Pi/4 - Pi/4 range.

parent ee7b5ebc
......@@ -680,16 +680,17 @@ static float __sindf(double x)
/* Copied from musl: src/math/__cosdf.c */
static float __cosdf(double x)
{
static const double C0 = -0x1ffffffd0c5e81.0p-54,
C1 = 0x155553e1053a42.0p-57,
C2 = -0x16c087e80f1e27.0p-62,
C3 = 0x199342e0ee5069.0p-68;
double r, w, z;
static const double C0 = -0x1.0000000000000p-1,
C1 = 0x1.5555555555555p-5,
C2 = -0x1.6c16c16c16c17p-10,
C3 = 0x1.a01a01a01a01ap-16,
C4 = -0x1.27e4fb7789f5cp-22;
double z;
z = x * x;
w = z * z;
r = C2 + z * C3;
return ((1.0 + z * C0) + w * C1) + (w * z) * r;
if (x > -7.8163146972656250e-03 && x < 7.8163146972656250e-03)
return 1 + C0 * z;
return 1.0 + z * (C0 + z * (C1 + z * (C2 + z * (C3 + z * C4))));
}
static const UINT64 exp2f_T[] = {
......
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