From: Alexandre Julliard julliard@winehq.org
With the changes from 4fd9daea4a79d0826c9e5ab6466291043e40d579. --- dlls/msvcrt/math.c | 36 ------------------------------------ libs/musl/src/math/sinhf.c | 5 +++++ 2 files changed, 5 insertions(+), 36 deletions(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 1c6fd5d7d70..9741100b2b9 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -983,8 +983,6 @@ float CDECL cosf( float x ) } }
-extern float __expo2f(float x, float sign); - /********************************************************************* * expf (MSVCRT.@) */ @@ -1277,40 +1275,6 @@ float CDECL sinf( float x ) } }
-/********************************************************************* - * sinhf (MSVCRT.@) - */ -float CDECL sinhf( float x ) -{ - UINT32 ui = *(UINT32*)&x; - float t, h, absx; - - h = 0.5; - if (ui >> 31) - h = -h; - /* |x| */ - ui &= 0x7fffffff; - absx = *(float*)&ui; - - /* |x| < log(FLT_MAX) */ - if (ui < 0x42b17217) { - t = expm1f(absx); - if (ui < 0x3f800000) { - if (ui < 0x3f800000 - (12 << 23)) - return x; - return h * (2 * t - t * t / (t + 1)); - } - return h * (t + t / (t + 1)); - } - - /* |x| > logf(FLT_MAX) or nan */ - if (ui > 0x7f800000) - *(DWORD*)&t = *(DWORD*)&x | 0x400000; - else - t = __expo2f(absx, 2 * h); - return t; -} - static BOOL sqrtf_validate( float *x ) { short c = _fdclass(*x); diff --git a/libs/musl/src/math/sinhf.c b/libs/musl/src/math/sinhf.c index a9abf634e85..60bca2b5a36 100644 --- a/libs/musl/src/math/sinhf.c +++ b/libs/musl/src/math/sinhf.c @@ -3,6 +3,7 @@ float __cdecl sinhf(float x) { union {float f; uint32_t i;} u = {.f = x}; + uint32_t sign = u.i & 0x80000000; uint32_t w; float t, h, absx;
@@ -26,6 +27,10 @@ float __cdecl sinhf(float x) }
/* |x| > logf(FLT_MAX) or nan */ + if (w > 0x7f800000) { + u.i = w | sign | 0x400000; + return u.f; + } t = __expo2f(absx, 2*h); return t; }