Rebase against 302153117e20b62c9170aed62aa33e83cacfaf59.

This commit is contained in:
Sebastian Lackner
2017-09-20 07:17:22 +02:00
parent 22cdd720aa
commit 8859da7cbd
10 changed files with 46 additions and 772 deletions

View File

@@ -1,4 +1,4 @@
From eed82dcb03b097fe5e35ad02299977c7298c08aa Mon Sep 17 00:00:00 2001
From 2712050d88f9b75e0b10e845d1ad21809a9d6dae 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,7 +9,7 @@ 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 a94c34ac80e..6736f03ec4c 100644
index 60ce4e659f5..140bf08828b 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -64,6 +64,61 @@ static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
@@ -74,7 +74,7 @@ index a94c34ac80e..6736f03ec4c 100644
void msvcrt_init_math(void)
{
sse2_supported = sse2_enabled = IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE );
@@ -476,7 +531,7 @@ double CDECL MSVCRT_cos( double x )
@@ -478,7 +533,7 @@ double CDECL MSVCRT_cos( double x )
*/
double CDECL MSVCRT_cosh( double x )
{
@@ -83,7 +83,7 @@ index a94c34ac80e..6736f03ec4c 100644
if (isnan(x)) math_error(_DOMAIN, "cosh", x, 0, ret);
return ret;
}
@@ -486,7 +541,7 @@ double CDECL MSVCRT_cosh( double x )
@@ -488,7 +543,7 @@ double CDECL MSVCRT_cosh( double x )
*/
double CDECL MSVCRT_exp( double x )
{
@@ -92,16 +92,16 @@ index a94c34ac80e..6736f03ec4c 100644
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 )
@@ -532,7 +587,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)) math_error(_DOMAIN, "pow", x, y, z);
return z;
}
@@ -551,7 +606,7 @@ double CDECL MSVCRT_sin( double x )
+ double z = precise_pow(x,y);
if (x < 0 && y != floor(y)) math_error(_DOMAIN, "pow", x, y, z);
else if (!x && isfinite(y) && y < 0) math_error(_SING, "pow", x, y, z);
else if (isfinite(x) && isfinite(y) && !isfinite(z)) math_error(_OVERFLOW, "pow", x, y, z);
@@ -555,7 +610,7 @@ double CDECL MSVCRT_sin( double x )
*/
double CDECL MSVCRT_sinh( double x )
{
@@ -111,5 +111,5 @@ index a94c34ac80e..6736f03ec4c 100644
return ret;
}
--
2.13.1
2.14.1