Rebase against 2d9e894d285937716a4541c7fab9152fdf0b495f.

This commit is contained in:
Sebastian Lackner
2017-08-03 13:41:34 +02:00
parent 5f7efc6b30
commit e28edf1951
5 changed files with 41 additions and 56 deletions

View File

@@ -1,4 +1,4 @@
From 94ca142c68870be4e9dcb898fdc01d574de68e33 Mon Sep 17 00:00:00 2001
From eed82dcb03b097fe5e35ad02299977c7298c08aa Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 10 Apr 2015 07:51:16 +0200
Subject: msvcrt: Calculate sinh/cosh/exp/pow with higher precision. (v2)
@@ -9,10 +9,10 @@ Based on a patch by Zheng Chen.
1 file changed, 59 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index 2001d44a0b4..04b14788919 100644
index a94c34ac80e..6736f03ec4c 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -59,6 +59,61 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
@@ -64,6 +64,61 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
static BOOL sse2_supported;
static BOOL sse2_enabled;
@@ -74,42 +74,42 @@ index 2001d44a0b4..04b14788919 100644
void msvcrt_init_math(void)
{
sse2_supported = sse2_enabled = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE );
@@ -399,7 +454,7 @@ double CDECL MSVCRT_cos( double x )
@@ -476,7 +531,7 @@ double CDECL MSVCRT_cos( double x )
*/
double CDECL MSVCRT_cosh( double x )
{
if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
- return cosh(x);
+ return precise_cosh(x);
- double ret = cosh(x);
+ double ret = precise_cosh(x);
if (isnan(x)) math_error(_DOMAIN, "cosh", x, 0, ret);
return ret;
}
/*********************************************************************
@@ -407,7 +462,7 @@ double CDECL MSVCRT_cosh( double x )
@@ -486,7 +541,7 @@ double CDECL MSVCRT_cosh( double x )
*/
double CDECL MSVCRT_exp( double x )
{
- double ret = exp(x);
+ double ret = precise_exp(x);
if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
else if (isfinite(x) && !isfinite(ret)) *MSVCRT__errno() = MSVCRT_ERANGE;
return ret;
@@ -448,7 +503,7 @@ double CDECL MSVCRT_log10( double x )
if (isnan(x)) math_error(_DOMAIN, "exp", x, 0, ret);
else if (isfinite(x) && !ret) math_error(_UNDERFLOW, "exp", x, 0, ret);
else if (isfinite(x) && !isfinite(ret)) math_error(_OVERFLOW, "exp", x, 0, ret);
@@ -531,7 +586,7 @@ double CDECL MSVCRT_log10( double x )
double CDECL MSVCRT_pow( double x, double y )
{
/* FIXME: If x < 0 and y is not integral, set EDOM */
- double z = pow(x,y);
+ double z = precise_pow(x, y);
if (!isfinite(z)) *MSVCRT__errno() = MSVCRT_EDOM;
if (!isfinite(z)) math_error(_DOMAIN, "pow", x, y, z);
return z;
}
@@ -468,7 +523,7 @@ double CDECL MSVCRT_sin( double x )
@@ -551,7 +606,7 @@ double CDECL MSVCRT_sin( double x )
*/
double CDECL MSVCRT_sinh( double x )
{
if (isnan(x)) *MSVCRT__errno() = MSVCRT_EDOM;
- return sinh(x);
+ return precise_sinh(x);
- double ret = sinh(x);
+ double ret = precise_sinh(x);
if (isnan(x)) math_error(_DOMAIN, "sinh", x, 0, ret);
return ret;
}
/*********************************************************************
--
2.13.1