msvcrt: Import acosh implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
75537f4375
commit
bc9105e238
|
@ -19616,7 +19616,6 @@ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
|
|||
fi
|
||||
|
||||
for ac_func in \
|
||||
acosh \
|
||||
asinh \
|
||||
asinhf \
|
||||
atanh \
|
||||
|
|
|
@ -2656,7 +2656,6 @@ then
|
|||
fi
|
||||
|
||||
AC_CHECK_FUNCS(\
|
||||
acosh \
|
||||
asinh \
|
||||
asinhf \
|
||||
atanh \
|
||||
|
|
|
@ -6585,16 +6585,26 @@ float CDECL asinhf(float x)
|
|||
|
||||
/*********************************************************************
|
||||
* acosh (MSVCR120.@)
|
||||
*
|
||||
* Copied from musl: src/math/acosh.c
|
||||
*/
|
||||
double CDECL acosh(double x)
|
||||
{
|
||||
int e = *(UINT64*)&x >> 52 & 0x7ff;
|
||||
|
||||
if (x < 1)
|
||||
{
|
||||
*_errno() = EDOM;
|
||||
feraiseexcept(FE_INVALID);
|
||||
return NAN;
|
||||
}
|
||||
return unix_funcs->acosh( x );
|
||||
|
||||
if (e < 0x3ff + 1) /* |x| < 2, up to 2ulp error in [1,1.125] */
|
||||
return log1p(x - 1 + sqrt((x - 1) * (x - 1) + 2 * (x - 1)));
|
||||
if (e < 0x3ff + 26) /* |x| < 0x1p26 */
|
||||
return log(2 * x - 1 / (x + sqrt(x * x - 1)));
|
||||
/* |x| >= 0x1p26 or nan */
|
||||
return log(x) + 0.693147180559945309417232121458176568;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -42,19 +42,6 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
||||
/*********************************************************************
|
||||
* acosh
|
||||
*/
|
||||
static double CDECL unix_acosh(double x)
|
||||
{
|
||||
#ifdef HAVE_ACOSH
|
||||
return acosh(x);
|
||||
#else
|
||||
if (!isfinite(x*x)) return log(2) + log(x);
|
||||
return log(x + sqrt(x*x-1));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* asinh
|
||||
*/
|
||||
|
@ -435,7 +422,6 @@ static float CDECL unix_tgammaf(float x)
|
|||
|
||||
static const struct unix_funcs funcs =
|
||||
{
|
||||
unix_acosh,
|
||||
unix_asinh,
|
||||
unix_asinhf,
|
||||
unix_atanh,
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
struct unix_funcs
|
||||
{
|
||||
double (CDECL *acosh)(double x);
|
||||
double (CDECL *asinh)(double x);
|
||||
float (CDECL *asinhf)(float x);
|
||||
double (CDECL *atanh)(double x);
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
/* Define to the file extension for executables. */
|
||||
#undef EXEEXT
|
||||
|
||||
/* Define to 1 if you have the `acosh' function. */
|
||||
#undef HAVE_ACOSH
|
||||
|
||||
/* Define to 1 if you have the <alias.h> header file. */
|
||||
#undef HAVE_ALIAS_H
|
||||
|
||||
|
|
Loading…
Reference in New Issue