Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-11-29 22:23:20 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-12-02 12:00:32 +0300
commit7a526cdc28a3c4acce98e8a99b06562452c90d07 (patch)
tree654412a63d47449ad4a65384ff3f28a5603d345a /newlib/libm/common
parent8574f8a1e4b02a4b47e2434111c4e2c382a9f046 (diff)
libm: switch sf_log1p from double error routines to float
sf_log1p was using __math_divzero and __math_invalid, which drag in a pile of double-precision code. Switch to using the single-precision variants. This also required making those available in __OBSOLETE_MATH mode. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'newlib/libm/common')
-rw-r--r--newlib/libm/common/math_errf.c2
-rw-r--r--newlib/libm/common/sf_log1p.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/newlib/libm/common/math_errf.c b/newlib/libm/common/math_errf.c
index 762fc2799..53c68b1cf 100644
--- a/newlib/libm/common/math_errf.c
+++ b/newlib/libm/common/math_errf.c
@@ -75,7 +75,6 @@ __math_oflowf (uint32_t sign)
return xflowf (sign, 0x1p97f);
}
-#if !__OBSOLETE_MATH
HIDDEN float
__math_divzerof (uint32_t sign)
{
@@ -89,4 +88,3 @@ __math_invalidf (float x)
float y = (x - x) / (x - x);
return isnan (x) ? y : with_errnof (y, EDOM);
}
-#endif /* !__OBSOLETE_MATH */
diff --git a/newlib/libm/common/sf_log1p.c b/newlib/libm/common/sf_log1p.c
index d86768082..d326e00ba 100644
--- a/newlib/libm/common/sf_log1p.c
+++ b/newlib/libm/common/sf_log1p.c
@@ -56,9 +56,9 @@ static float zero = 0.0;
if (hx < 0x3ed413d7) { /* x < 0.41422 */
if(ax>=0x3f800000) { /* x <= -1.0 */
if(x==(float)-1.0)
- return __math_divzero (1); /* log1p(-1)=-inf */
+ return __math_divzerof (1); /* log1p(-1)=-inf */
else
- return __math_invalid (x); /* log1p(x<-1)=NaN */
+ return __math_invalidf (x); /* log1p(x<-1)=NaN */
}
if(ax<0x31000000) { /* |x| < 2**-29 */
if(two25+x>zero /* raise inexact */