Commit 17174db6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Import asinhf implementation from musl.

parent bc9105e2
......@@ -19617,7 +19617,6 @@ fi
for ac_func in \
asinh \
asinhf \
atanh \
atanhf \
exp2 \
......
......@@ -2657,7 +2657,6 @@ fi
AC_CHECK_FUNCS(\
asinh \
asinhf \
atanh \
atanhf \
exp2 \
......
......@@ -6577,10 +6577,27 @@ double CDECL asinh(double x)
/*********************************************************************
* asinhf (MSVCR120.@)
*
* Copied from musl: src/math/asinhf.c
*/
float CDECL asinhf(float x)
{
return unix_funcs->asinhf( x );
UINT32 ux = *(UINT32*)&x;
UINT32 i = ux & 0x7fffffff;
int s = ux >> 31;
/* |x| */
x = *(float*)&i;
if (i >= 0x3f800000 + (12 << 23))/* |x| >= 0x1p12 or inf or nan */
x = logf(x) + 0.693147180559945309417232121458176568f;
else if (i >= 0x3f800000 + (1 << 23)) /* |x| >= 2 */
x = logf(2 * x + 1 / (sqrtf(x * x + 1) + x));
else if (i >= 0x3f800000 - (12 << 23)) /* |x| >= 0x1p-12 */
x = log1pf(x + x * x / (sqrtf(x * x + 1) + 1));
else /* |x| < 0x1p-12, raise inexact if x!=0 */
fp_barrierf(x + 0x1p120f);
return s ? -x : x;
}
/*********************************************************************
......
......@@ -60,18 +60,6 @@ static double CDECL unix_asinh(double x)
}
/*********************************************************************
* asinhf
*/
static float CDECL unix_asinhf(float x)
{
#ifdef HAVE_ASINHF
return asinhf(x);
#else
return unix_asinh(x);
#endif
}
/*********************************************************************
* atanh
*/
static double CDECL unix_atanh(double x)
......@@ -423,7 +411,6 @@ static float CDECL unix_tgammaf(float x)
static const struct unix_funcs funcs =
{
unix_asinh,
unix_asinhf,
unix_atanh,
unix_atanhf,
unix_cosh,
......
......@@ -24,7 +24,6 @@
struct unix_funcs
{
double (CDECL *asinh)(double x);
float (CDECL *asinhf)(float x);
double (CDECL *atanh)(double x);
float (CDECL *atanhf)(float x);
double (CDECL *cosh)(double x);
......
......@@ -28,9 +28,6 @@
/* Define to 1 if you have the `asinh' function. */
#undef HAVE_ASINH
/* Define to 1 if you have the `asinhf' function. */
#undef HAVE_ASINHF
/* Define to 1 if you have the <asm/types.h> header file. */
#undef HAVE_ASM_TYPES_H
......
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