Commit b46bf3ff authored by Alexandre Julliard's avatar Alexandre Julliard

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

With the changes from ee7b5ebc.
parent b9b19ea2
......@@ -219,25 +219,7 @@ float CDECL _chgsignf( float num )
#endif
#ifndef __i386__
/* Copied from musl: src/math/__sindf.c */
static float __sindf(double x)
{
static const double S1 = -0x1.5555555555555p-3,
S2 = 0x1.1111111111111p-7,
S3 = -0x1.a01a01a01a01ap-13,
S4 = 0x1.71de3a556c734p-19;
double r, s, w, z;
z = x * x;
if (x > -7.8175831586122513e-03 && x < 7.8175831586122513e-03)
return x * (1 + S1 * z);
w = z * z;
r = S3 + z * S4;
s = z * x;
return (x + s * (S1 + z * S2)) + s * w * r;
}
extern float __sindf(double x);
/* Copied from musl: src/math/__cosdf.c */
static float __cosdf(double x)
......
......@@ -18,10 +18,10 @@
/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */
static const double
S1 = -0x15555554cbac77.0p-55, /* -0.166666666416265235595 */
S2 = 0x111110896efbb2.0p-59, /* 0.0083333293858894631756 */
S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */
S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */
S1 = -0x1.5555555555555p-3,
S2 = 0x1.1111111111111p-7,
S3 = -0x1.a01a01a01a01ap-13,
S4 = 0x1.71de3a556c734p-19;
float __sindf(double x)
{
......@@ -29,6 +29,8 @@ float __sindf(double x)
/* Try to optimize for parallel evaluation as in __tandf.c. */
z = x*x;
if (x > -7.8175831586122513e-03 && x < 7.8175831586122513e-03)
return x * (1 + S1 * z);
w = z*z;
r = S3 + z*S4;
s = z*x;
......
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