Skip to content

Commit 41318fc

Browse files
futogkeith-packard
authored andcommitted
libm/math: Update sinh FE_INEXACT code
Replace the code that is there to generate FE_INEXACT with __math_inexact.
1 parent a1f9eeb commit 41318fc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

newlib/libm/math/s_sinh.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#ifdef _NEED_FLOAT64
3535

36-
static const __float64 one = _F_64(1.0), shuge = _F_64(1.0e307);
36+
static const __float64 one = _F_64(1.0);
3737

3838
__float64
3939
sinh64(__float64 x)
@@ -56,8 +56,7 @@ sinh64(__float64 x)
5656
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
5757
if (ix < 0x40360000) { /* |x|<22 */
5858
if (ix < 0x3e300000) /* |x|<2**-28 */
59-
if (shuge + x > one)
60-
return x; /* sinh(tiny) = tiny with inexact */
59+
return __math_inexact64(x); /* sinh(tiny) = tiny with inexact */
6160
t = expm164(fabs64(x));
6261
if (ix < 0x3ff00000)
6362
return h * (_F_64(2.0) * t - t * t / (t + one));

newlib/libm/math/sf_sinh.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "fdlibm.h"
1717

18-
static const float one = 1.0, shuge = 1.0e37;
18+
static const float one = 1.0;
1919

2020
float
2121
sinhf(float x)
@@ -36,8 +36,7 @@ sinhf(float x)
3636
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
3737
if (ix < 0x41b00000) { /* |x|<22 */
3838
if (ix < 0x31800000) /* |x|<2**-28 */
39-
if (shuge + x > one)
40-
return x; /* sinh(tiny) = tiny with inexact */
39+
return __math_inexactf(x); /* sinh(tiny) = tiny with inexact */
4140
t = expm1f(fabsf(x));
4241
if (ix < 0x3f800000)
4342
return h * ((float)2.0 * t - t * t / (t + one));

0 commit comments

Comments
 (0)