Module: wine Branch: master Commit: b46bf3ffb14d193c430f1707aa0480b92057c029 URL: https://gitlab.winehq.org/wine/wine/-/commit/b46bf3ffb14d193c430f1707aa0480b...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Mar 30 13:36:49 2023 +0200
msvcrt: Use the __sindf() implementation from the bundled musl library.
With the changes from ee7b5ebc3a7843fc2997d5cc5f7784c4d51b4f8d.
---
dlls/msvcrt/math.c | 20 +------------------- libs/musl/src/math/__sindf.c | 10 ++++++---- 2 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index befd05e9ad0..8fa904b1cc9 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -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) diff --git a/libs/musl/src/math/__sindf.c b/libs/musl/src/math/__sindf.c index 8fec2a3f660..fda8a247621 100644 --- a/libs/musl/src/math/__sindf.c +++ b/libs/musl/src/math/__sindf.c @@ -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;