summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128/k_tanl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/k_tanl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/k_tanl.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index 6bb221e4a6..8da794d80c 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -57,36 +57,38 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- pio4hi = 7.8539816339744830961566084581987569936977E-1L,
- pio4lo = 2.1679525325309452561992610065108379921906E-35L,
+#include <math-underflow.h>
+#include <libc-diag.h>
+
+static const _Float128
+ one = 1,
+ pio4hi = L(7.8539816339744830961566084581987569936977E-1),
+ pio4lo = L(2.1679525325309452561992610065108379921906E-35),
/* tan x = x + x^3 / 3 + x^5 T(x^2)/U(x^2)
0 <= x <= 0.6743316650390625
Peak relative error 8.0e-36 */
- TH = 3.333333333333333333333333333333333333333E-1L,
- T0 = -1.813014711743583437742363284336855889393E7L,
- T1 = 1.320767960008972224312740075083259247618E6L,
- T2 = -2.626775478255838182468651821863299023956E4L,
- T3 = 1.764573356488504935415411383687150199315E2L,
- T4 = -3.333267763822178690794678978979803526092E-1L,
+ TH = L(3.333333333333333333333333333333333333333E-1),
+ T0 = L(-1.813014711743583437742363284336855889393E7),
+ T1 = L(1.320767960008972224312740075083259247618E6),
+ T2 = L(-2.626775478255838182468651821863299023956E4),
+ T3 = L(1.764573356488504935415411383687150199315E2),
+ T4 = L(-3.333267763822178690794678978979803526092E-1),
- U0 = -1.359761033807687578306772463253710042010E8L,
- U1 = 6.494370630656893175666729313065113194784E7L,
- U2 = -4.180787672237927475505536849168729386782E6L,
- U3 = 8.031643765106170040139966622980914621521E4L,
- U4 = -5.323131271912475695157127875560667378597E2L;
+ U0 = L(-1.359761033807687578306772463253710042010E8),
+ U1 = L(6.494370630656893175666729313065113194784E7),
+ U2 = L(-4.180787672237927475505536849168729386782E6),
+ U3 = L(8.031643765106170040139966622980914621521E4),
+ U4 = L(-5.323131271912475695157127875560667378597E2);
/* 1.000000000000000000000000000000000000000E0 */
-long double
-__kernel_tanl (long double x, long double y, int iy)
+_Float128
+__kernel_tanl (_Float128 x, _Float128 y, int iy)
{
- long double z, r, v, w, s;
+ _Float128 z, r, v, w, s;
int32_t ix, sign;
ieee854_long_double_shape_type u, u1;
@@ -98,7 +100,7 @@ __kernel_tanl (long double x, long double y, int iy)
{ /* generate inexact */
if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3
| (iy + 1)) == 0)
- return one / fabs (x);
+ return one / fabsl (x);
else if (iy == 1)
{
math_check_force_underflow (x);
@@ -134,7 +136,7 @@ __kernel_tanl (long double x, long double y, int iy)
w = x + r;
if (ix >= 0x3ffe5942)
{
- v = (long double) iy;
+ v = (_Float128) iy;
w = (v - 2.0 * (x - (w * w / (w + v) - r)));
/* SIGN is set for arguments that reach this code, but not
otherwise, resulting in warnings that it may be used