aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/s_atanl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_atanl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index 779209d..2a36d16 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -199,6 +199,22 @@ __atanl (long double x)
return atantbl[83];
}
+ if (k <= 0x3c800000) /* |x| <= 2**-55. */
+ {
+ /* Raise inexact. */
+ if (1e300L + x > 0.0)
+ return x;
+ }
+
+ if (k >= 0x46c00000) /* |x| >= 2**109. */
+ {
+ /* Saturate result to {-,+}pi/2. */
+ if (sign)
+ return -atantbl[83];
+ else
+ return atantbl[83];
+ }
+
if (sign)
x = -x;