Commit 90c61c7c authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Use the __cosdf() implementation from the bundled musl library.

With the changes from 9008cd2f.
parent b46bf3ff
......@@ -220,22 +220,7 @@ float CDECL _chgsignf( float num )
#ifndef __i386__
extern float __sindf(double x);
/* Copied from musl: src/math/__cosdf.c */
static float __cosdf(double x)
{
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;
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))));
}
extern float __cosdf(double x);
static const UINT64 exp2f_T[] = {
0x3ff0000000000000ULL, 0x3fefd9b0d3158574ULL, 0x3fefb5586cf9890fULL, 0x3fef9301d0125b51ULL,
......
......@@ -18,18 +18,18 @@
/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */
static const double
C0 = -0x1ffffffd0c5e81.0p-54, /* -0.499999997251031003120 */
C1 = 0x155553e1053a42.0p-57, /* 0.0416666233237390631894 */
C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */
C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */
C0 = -0x1.0000000000000p-1,
C1 = 0x1.5555555555555p-5,
C2 = -0x1.6c16c16c16c17p-10,
C3 = 0x1.a01a01a01a01ap-16,
C4 = -0x1.27e4fb7789f5cp-22;
float __cosdf(double x)
{
double_t r, w, z;
double_t z;
/* Try to optimize for parallel evaluation as in __tandf.c. */
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))));
}
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