summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128ibm
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/Makefile6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acoshl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_atanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_exp10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_expl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_fmodl.c25
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_hypotl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j0l.c865
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j1l.c887
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_jnl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c993
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log2l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_logl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_powl.c43
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_remainderl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sinhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/gamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ieee754.h2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_cosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sincosl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sinl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h (renamed from sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h)7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math_ldbl.h64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/printf_fphex.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_asinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_atanl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c104
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ceill.c58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_daddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ddivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_erfl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_expm1l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fabsl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_faddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fdivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_floorl.c51
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmal.c243
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_frexpl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c147
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c35
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llrintl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llroundl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_log1pl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lrintl.c17
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lroundl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_modfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c111
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextupl.c79
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_remquol.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_rintl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c70
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundl.c76
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_tanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c63
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c65
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_truncl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/strtold_l.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_expl.h970
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c230
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c (renamed from sysdeps/ieee754/ldbl-128ibm/w_log1pl.c)12
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c84
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c (renamed from sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c)12
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c30
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c73
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_expl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c34
100 files changed, 5713 insertions, 471 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index 5591814824..bdba6cc6b5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -8,3 +8,9 @@ ifeq ($(subdir),stdlib)
tests += tst-strtold-ldbl-128ibm
$(objpfx)tst-strtold-ldbl-128ibm: $(libm)
endif
+
+ifeq ($(subdir),math)
+tests += test-fmodl-ldbl-128ibm test-remainderl-ldbl-128ibm \
+ test-remquol-ldbl-128ibm test-canonical-ldbl-128ibm \
+ test-totalorderl-ldbl-128ibm
+endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
new file mode 100644
index 0000000000..60c54cca46
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -0,0 +1,58 @@
+/* Define iscanonical macro. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __NO_LONG_DOUBLE_MATH
+# define iscanonical(x) ((void) (__typeof (x)) (x), 1)
+#else
+extern int __iscanonicall (long double __x)
+ __THROW __attribute__ ((__const__));
+# define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
+# define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+# if __HAVE_DISTINCT_FLOAT128
+# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+# endif
+
+/* Return nonzero value if X is canonical. In IEEE interchange binary
+ formats, all values are canonical, but the argument must still be
+ converted to its semantic type for any exceptions arising from the
+ conversion, before being discarded; in IBM long double, there are
+ encodings that are not consistently handled as corresponding to any
+ particular value of the type, and we return 0 for those. */
+# ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+# else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile)). */
+extern "C++" {
+inline int iscanonical (float __val) { return __iscanonicalf (__val); }
+inline int iscanonical (double __val) { return __iscanonical (__val); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+# endif /* __cplusplus */
+#endif /* __NO_LONG_DOUBLE_MATH */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index cab1da9995..f85fe678ba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -53,10 +53,10 @@ __ieee754_acoshl(long double x)
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x4000000000000000LL) { /* 2**56 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2.0*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
index 5974ee1338..1f8e405c9b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
@@ -51,7 +51,7 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
*/
#include <math.h>
@@ -268,7 +268,7 @@ __ieee754_acosl (long double x)
double shi, slo;
z = (one - a) * 0.5;
- s = __ieee754_sqrtl (z);
+ s = sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
The change w from s to the improved value is
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
index 6ed5e8d68d..e8b0221a92 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
@@ -61,8 +61,9 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-long double sqrtl (long double);
+#include <math-underflow.h>
static const long double
one = 1.0L,
@@ -226,7 +227,7 @@ __ieee754_asinl (long double x)
return x + x * w;
}
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (a > 0.975L)
{
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
index b576f42030..25c286b8ff 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0L, huge = 1e300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
index 5699b8e53d..b4c17856b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index ca3cbb53af..16d4205465 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -65,7 +65,9 @@
#include <fenv.h>
#include <inttypes.h>
#include <math_private.h>
-#include <sysdeps/ieee754/ldbl-128/t_expl.h>
+
+
+#include "t_expl.h"
static const long double C[] = {
/* Smallest integer x for which e^x overflows. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
index 205097d38f..fae7dbe888 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
@@ -55,6 +55,13 @@ __ieee754_fmodl (long double x, long double y)
return x;
/* At this point the absolute value of the high doubles of
x and y must be equal. */
+ if ((lx & 0x7fffffffffffffffLL) == 0
+ && (ly & 0x7fffffffffffffffLL) == 0)
+ /* Both low parts are zero. The result should be an
+ appropriately signed zero, but the subsequent logic
+ could treat them as unequal, depending on the signs
+ of the low parts. */
+ return Zero[(uint64_t) sx >> 63];
/* If the low double of y is the same sign as the high
double of y (ie. the low double increases |y|)... */
if (((ly ^ sy) & 0x8000000000000000LL) == 0
@@ -112,7 +119,7 @@ __ieee754_fmodl (long double x, long double y)
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
@@ -121,7 +128,7 @@ __ieee754_fmodl (long double x, long double y)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -130,15 +137,11 @@ __ieee754_fmodl (long double x, long double y)
x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
} else { /* subnormal output */
n = -1022 - iy;
- if(n<=48) {
- lx = (lx>>n)|((u_int64_t)hx<<(64-n));
- hx >>= n;
- } else if (n<=63) {
- lx = (hx<<(64-n))|(lx>>n); hx = sx;
- } else {
- lx = hx>>(n-64); hx = sx;
- }
- x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
+ /* We know 1 <= N <= 52, and that there are no nonzero
+ bits in places below 2^-1074. */
+ lx = (lx >> n) | ((uint64_t) hx << (64 - n));
+ hx >>= n;
+ x = ldbl_insert_mantissa((sx>>63), -1023, hx, lx);
x *= one; /* create necessary signal */
}
return x; /* exact output */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
index 8dbb131f93..84ea7ee0f5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -106,7 +107,7 @@ gammal_positive (long double x, int *exp2_adj)
long double ret = (__ieee754_powl (x_adj_mant, x_adj)
* __ieee754_exp2l (x_adj_log2 * x_adj_frac)
* __ieee754_expl (-x_adj)
- * __ieee754_sqrtl (2 * M_PIl / x_adj)
+ * sqrtl (2 * M_PIl / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
long double bsum = gamma_coeff[NCOEFF - 1];
@@ -134,7 +135,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
+ if (hx < 0 && (uint64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index c68dac03b0..842f77b7ed 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double
__ieee754_hypotl(long double x, long double y)
@@ -67,6 +68,8 @@ __ieee754_hypotl(long double x, long double y)
if(ha > 0x5f30000000000000LL) { /* a>2**500 */
if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
if(ha == 0x7ff0000000000000LL)
w = a;
if(hb == 0x7ff0000000000000LL)
@@ -105,7 +108,7 @@ __ieee754_hypotl(long double x, long double y)
= a1*(a1+a2) + a2*a + b*b
= a1*a1 + a1*a2 + a2*a + b*b
= a1*a1 + a2*(a+a1) + b*b */
- w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
+ w = sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
} else {
a = a+a;
ldbl_unpack (b, &hi, &lo);
@@ -122,7 +125,7 @@ __ieee754_hypotl(long double x, long double y)
= w*w + a1*b + a2*b
= w*w + a1*(b1+b2) + a2*b
= w*w + a1*b1 + a1*b2 + a2*b */
- w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
+ w = sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
}
if(k!=0)
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index 39a238aa9b..448cfb63fe 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -1,3 +1,864 @@
-/* Looks like we can use ieee854 e_j0l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j0l.c>
+/* Bessel function of order zero. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.ornl.gov).
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
+
+/* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
+ Peak relative error 3.4e-37
+ 0 <= x <= 2 */
+#define NJ0_2N 6
+static const long double J0_2N[NJ0_2N + 1] = {
+ 3.133239376997663645548490085151484674892E16L,
+ -5.479944965767990821079467311839107722107E14L,
+ 6.290828903904724265980249871997551894090E12L,
+ -3.633750176832769659849028554429106299915E10L,
+ 1.207743757532429576399485415069244807022E8L,
+ -2.107485999925074577174305650549367415465E5L,
+ 1.562826808020631846245296572935547005859E2L,
+};
+#define NJ0_2D 6
+static const long double J0_2D[NJ0_2D + 1] = {
+ 2.005273201278504733151033654496928968261E18L,
+ 2.063038558793221244373123294054149790864E16L,
+ 1.053350447931127971406896594022010524994E14L,
+ 3.496556557558702583143527876385508882310E11L,
+ 8.249114511878616075860654484367133976306E8L,
+ 1.402965782449571800199759247964242790589E6L,
+ 1.619910762853439600957801751815074787351E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2),
+ 0 <= 1/x <= .0625
+ Peak relative error 3.3e-36 */
+#define NP16_IN 9
+static const long double P16_IN[NP16_IN + 1] = {
+ -1.901689868258117463979611259731176301065E-16L,
+ -1.798743043824071514483008340803573980931E-13L,
+ -6.481746687115262291873324132944647438959E-11L,
+ -1.150651553745409037257197798528294248012E-8L,
+ -1.088408467297401082271185599507222695995E-6L,
+ -5.551996725183495852661022587879817546508E-5L,
+ -1.477286941214245433866838787454880214736E-3L,
+ -1.882877976157714592017345347609200402472E-2L,
+ -9.620983176855405325086530374317855880515E-2L,
+ -1.271468546258855781530458854476627766233E-1L,
+};
+#define NP16_ID 9
+static const long double P16_ID[NP16_ID + 1] = {
+ 2.704625590411544837659891569420764475007E-15L,
+ 2.562526347676857624104306349421985403573E-12L,
+ 9.259137589952741054108665570122085036246E-10L,
+ 1.651044705794378365237454962653430805272E-7L,
+ 1.573561544138733044977714063100859136660E-5L,
+ 8.134482112334882274688298469629884804056E-4L,
+ 2.219259239404080863919375103673593571689E-2L,
+ 2.976990606226596289580242451096393862792E-1L,
+ 1.713895630454693931742734911930937246254E0L,
+ 3.231552290717904041465898249160757368855E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 0.0625 <= 1/x <= 0.125
+ Peak relative error 2.4e-35 */
+#define NP8_16N 10
+static const long double P8_16N[NP8_16N + 1] = {
+ -2.335166846111159458466553806683579003632E-15L,
+ -1.382763674252402720401020004169367089975E-12L,
+ -3.192160804534716696058987967592784857907E-10L,
+ -3.744199606283752333686144670572632116899E-8L,
+ -2.439161236879511162078619292571922772224E-6L,
+ -9.068436986859420951664151060267045346549E-5L,
+ -1.905407090637058116299757292660002697359E-3L,
+ -2.164456143936718388053842376884252978872E-2L,
+ -1.212178415116411222341491717748696499966E-1L,
+ -2.782433626588541494473277445959593334494E-1L,
+ -1.670703190068873186016102289227646035035E-1L,
+};
+#define NP8_16D 10
+static const long double P8_16D[NP8_16D + 1] = {
+ 3.321126181135871232648331450082662856743E-14L,
+ 1.971894594837650840586859228510007703641E-11L,
+ 4.571144364787008285981633719513897281690E-9L,
+ 5.396419143536287457142904742849052402103E-7L,
+ 3.551548222385845912370226756036899901549E-5L,
+ 1.342353874566932014705609788054598013516E-3L,
+ 2.899133293006771317589357444614157734385E-2L,
+ 3.455374978185770197704507681491574261545E-1L,
+ 2.116616964297512311314454834712634820514E0L,
+ 5.850768316827915470087758636881584174432E0L,
+ 5.655273858938766830855753983631132928968E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 0.125 <= 1/x <= 0.1875
+ Peak relative error 2.7e-35 */
+#define NP5_8N 10
+static const long double P5_8N[NP5_8N + 1] = {
+ -1.270478335089770355749591358934012019596E-12L,
+ -4.007588712145412921057254992155810347245E-10L,
+ -4.815187822989597568124520080486652009281E-8L,
+ -2.867070063972764880024598300408284868021E-6L,
+ -9.218742195161302204046454768106063638006E-5L,
+ -1.635746821447052827526320629828043529997E-3L,
+ -1.570376886640308408247709616497261011707E-2L,
+ -7.656484795303305596941813361786219477807E-2L,
+ -1.659371030767513274944805479908858628053E-1L,
+ -1.185340550030955660015841796219919804915E-1L,
+ -8.920026499909994671248893388013790366712E-3L,
+};
+#define NP5_8D 9
+static const long double P5_8D[NP5_8D + 1] = {
+ 1.806902521016705225778045904631543990314E-11L,
+ 5.728502760243502431663549179135868966031E-9L,
+ 6.938168504826004255287618819550667978450E-7L,
+ 4.183769964807453250763325026573037785902E-5L,
+ 1.372660678476925468014882230851637878587E-3L,
+ 2.516452105242920335873286419212708961771E-2L,
+ 2.550502712902647803796267951846557316182E-1L,
+ 1.365861559418983216913629123778747617072E0L,
+ 3.523825618308783966723472468855042541407E0L,
+ 3.656365803506136165615111349150536282434E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 3.5e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NP4_5N 9
+static const long double P4_5N[NP4_5N + 1] = {
+ -9.791405771694098960254468859195175708252E-10L,
+ -1.917193059944531970421626610188102836352E-7L,
+ -1.393597539508855262243816152893982002084E-5L,
+ -4.881863490846771259880606911667479860077E-4L,
+ -8.946571245022470127331892085881699269853E-3L,
+ -8.707474232568097513415336886103899434251E-2L,
+ -4.362042697474650737898551272505525973766E-1L,
+ -1.032712171267523975431451359962375617386E0L,
+ -9.630502683169895107062182070514713702346E-1L,
+ -2.251804386252969656586810309252357233320E-1L,
+};
+#define NP4_5D 9
+static const long double P4_5D[NP4_5D + 1] = {
+ 1.392555487577717669739688337895791213139E-8L,
+ 2.748886559120659027172816051276451376854E-6L,
+ 2.024717710644378047477189849678576659290E-4L,
+ 7.244868609350416002930624752604670292469E-3L,
+ 1.373631762292244371102989739300382152416E-1L,
+ 1.412298581400224267910294815260613240668E0L,
+ 7.742495637843445079276397723849017617210E0L,
+ 2.138429269198406512028307045259503811861E1L,
+ 2.651547684548423476506826951831712762610E1L,
+ 1.167499382465291931571685222882909166935E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 2.3e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NP3r2_4N 9
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+ -2.589155123706348361249809342508270121788E-8L,
+ -3.746254369796115441118148490849195516593E-6L,
+ -1.985595497390808544622893738135529701062E-4L,
+ -5.008253705202932091290132760394976551426E-3L,
+ -6.529469780539591572179155511840853077232E-2L,
+ -4.468736064761814602927408833818990271514E-1L,
+ -1.556391252586395038089729428444444823380E0L,
+ -2.533135309840530224072920725976994981638E0L,
+ -1.605509621731068453869408718565392869560E0L,
+ -2.518966692256192789269859830255724429375E-1L,
+};
+#define NP3r2_4D 9
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+ 3.682353957237979993646169732962573930237E-7L,
+ 5.386741661883067824698973455566332102029E-5L,
+ 2.906881154171822780345134853794241037053E-3L,
+ 7.545832595801289519475806339863492074126E-2L,
+ 1.029405357245594877344360389469584526654E0L,
+ 7.565706120589873131187989560509757626725E0L,
+ 2.951172890699569545357692207898667665796E1L,
+ 5.785723537170311456298467310529815457536E1L,
+ 5.095621464598267889126015412522773474467E1L,
+ 1.602958484169953109437547474953308401442E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.0e-35
+ 0.3125 <= 1/x <= 0.375 */
+#define NP2r7_3r2N 9
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+ -1.917322340814391131073820537027234322550E-7L,
+ -1.966595744473227183846019639723259011906E-5L,
+ -7.177081163619679403212623526632690465290E-4L,
+ -1.206467373860974695661544653741899755695E-2L,
+ -1.008656452188539812154551482286328107316E-1L,
+ -4.216016116408810856620947307438823892707E-1L,
+ -8.378631013025721741744285026537009814161E-1L,
+ -6.973895635309960850033762745957946272579E-1L,
+ -1.797864718878320770670740413285763554812E-1L,
+ -4.098025357743657347681137871388402849581E-3L,
+};
+#define NP2r7_3r2D 8
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+ 2.726858489303036441686496086962545034018E-6L,
+ 2.840430827557109238386808968234848081424E-4L,
+ 1.063826772041781947891481054529454088832E-2L,
+ 1.864775537138364773178044431045514405468E-1L,
+ 1.665660052857205170440952607701728254211E0L,
+ 7.723745889544331153080842168958348568395E0L,
+ 1.810726427571829798856428548102077799835E1L,
+ 1.986460672157794440666187503833545388527E1L,
+ 8.645503204552282306364296517220055815488E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.3e-36
+ 0.3125 <= 1/x <= 0.4375 */
+#define NP2r3_2r7N 9
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+ -1.594642785584856746358609622003310312622E-6L,
+ -1.323238196302221554194031733595194539794E-4L,
+ -3.856087818696874802689922536987100372345E-3L,
+ -5.113241710697777193011470733601522047399E-2L,
+ -3.334229537209911914449990372942022350558E-1L,
+ -1.075703518198127096179198549659283422832E0L,
+ -1.634174803414062725476343124267110981807E0L,
+ -1.030133247434119595616826842367268304880E0L,
+ -1.989811539080358501229347481000707289391E-1L,
+ -3.246859189246653459359775001466924610236E-3L,
+};
+#define NP2r3_2r7D 8
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+ 2.267936634217251403663034189684284173018E-5L,
+ 1.918112982168673386858072491437971732237E-3L,
+ 5.771704085468423159125856786653868219522E-2L,
+ 8.056124451167969333717642810661498890507E-1L,
+ 5.687897967531010276788680634413789328776E0L,
+ 2.072596760717695491085444438270778394421E1L,
+ 3.801722099819929988585197088613160496684E1L,
+ 3.254620235902912339534998592085115836829E1L,
+ 1.104847772130720331801884344645060675036E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.2e-35
+ 0.4375 <= 1/x <= 0.5 */
+#define NP2_2r3N 8
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+ -1.001042324337684297465071506097365389123E-4L,
+ -6.289034524673365824853547252689991418981E-3L,
+ -1.346527918018624234373664526930736205806E-1L,
+ -1.268808313614288355444506172560463315102E0L,
+ -5.654126123607146048354132115649177406163E0L,
+ -1.186649511267312652171775803270911971693E1L,
+ -1.094032424931998612551588246779200724257E1L,
+ -3.728792136814520055025256353193674625267E0L,
+ -3.000348318524471807839934764596331810608E-1L,
+};
+#define NP2_2r3D 8
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+ 1.423705538269770974803901422532055612980E-3L,
+ 9.171476630091439978533535167485230575894E-2L,
+ 2.049776318166637248868444600215942828537E0L,
+ 2.068970329743769804547326701946144899583E1L,
+ 1.025103500560831035592731539565060347709E2L,
+ 2.528088049697570728252145557167066708284E2L,
+ 2.992160327587558573740271294804830114205E2L,
+ 1.540193761146551025832707739468679973036E2L,
+ 2.779516701986912132637672140709452502650E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 2.2e-35
+ 0 <= 1/x <= .0625 */
+#define NQ16_IN 10
+static const long double Q16_IN[NQ16_IN + 1] = {
+ 2.343640834407975740545326632205999437469E-18L,
+ 2.667978112927811452221176781536278257448E-15L,
+ 1.178415018484555397390098879501969116536E-12L,
+ 2.622049767502719728905924701288614016597E-10L,
+ 3.196908059607618864801313380896308968673E-8L,
+ 2.179466154171673958770030655199434798494E-6L,
+ 8.139959091628545225221976413795645177291E-5L,
+ 1.563900725721039825236927137885747138654E-3L,
+ 1.355172364265825167113562519307194840307E-2L,
+ 3.928058355906967977269780046844768588532E-2L,
+ 1.107891967702173292405380993183694932208E-2L,
+};
+#define NQ16_ID 9
+static const long double Q16_ID[NQ16_ID + 1] = {
+ 3.199850952578356211091219295199301766718E-17L,
+ 3.652601488020654842194486058637953363918E-14L,
+ 1.620179741394865258354608590461839031281E-11L,
+ 3.629359209474609630056463248923684371426E-9L,
+ 4.473680923894354600193264347733477363305E-7L,
+ 3.106368086644715743265603656011050476736E-5L,
+ 1.198239259946770604954664925153424252622E-3L,
+ 2.446041004004283102372887804475767568272E-2L,
+ 2.403235525011860603014707768815113698768E-1L,
+ 9.491006790682158612266270665136910927149E-1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 5.1e-36
+ 0.0625 <= 1/x <= 0.125 */
+#define NQ8_16N 11
+static const long double Q8_16N[NQ8_16N + 1] = {
+ 1.001954266485599464105669390693597125904E-17L,
+ 7.545499865295034556206475956620160007849E-15L,
+ 2.267838684785673931024792538193202559922E-12L,
+ 3.561909705814420373609574999542459912419E-10L,
+ 3.216201422768092505214730633842924944671E-8L,
+ 1.731194793857907454569364622452058554314E-6L,
+ 5.576944613034537050396518509871004586039E-5L,
+ 1.051787760316848982655967052985391418146E-3L,
+ 1.102852974036687441600678598019883746959E-2L,
+ 5.834647019292460494254225988766702933571E-2L,
+ 1.290281921604364618912425380717127576529E-1L,
+ 7.598886310387075708640370806458926458301E-2L,
+};
+#define NQ8_16D 11
+static const long double Q8_16D[NQ8_16D + 1] = {
+ 1.368001558508338469503329967729951830843E-16L,
+ 1.034454121857542147020549303317348297289E-13L,
+ 3.128109209247090744354764050629381674436E-11L,
+ 4.957795214328501986562102573522064468671E-9L,
+ 4.537872468606711261992676606899273588899E-7L,
+ 2.493639207101727713192687060517509774182E-5L,
+ 8.294957278145328349785532236663051405805E-4L,
+ 1.646471258966713577374948205279380115839E-2L,
+ 1.878910092770966718491814497982191447073E-1L,
+ 1.152641605706170353727903052525652504075E0L,
+ 3.383550240669773485412333679367792932235E0L,
+ 3.823875252882035706910024716609908473970E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.9e-35
+ 0.125 <= 1/x <= 0.1875 */
+#define NQ5_8N 10
+static const long double Q5_8N[NQ5_8N + 1] = {
+ 1.750399094021293722243426623211733898747E-13L,
+ 6.483426211748008735242909236490115050294E-11L,
+ 9.279430665656575457141747875716899958373E-9L,
+ 6.696634968526907231258534757736576340266E-7L,
+ 2.666560823798895649685231292142838188061E-5L,
+ 6.025087697259436271271562769707550594540E-4L,
+ 7.652807734168613251901945778921336353485E-3L,
+ 5.226269002589406461622551452343519078905E-2L,
+ 1.748390159751117658969324896330142895079E-1L,
+ 2.378188719097006494782174902213083589660E-1L,
+ 8.383984859679804095463699702165659216831E-2L,
+};
+#define NQ5_8D 10
+static const long double Q5_8D[NQ5_8D + 1] = {
+ 2.389878229704327939008104855942987615715E-12L,
+ 8.926142817142546018703814194987786425099E-10L,
+ 1.294065862406745901206588525833274399038E-7L,
+ 9.524139899457666250828752185212769682191E-6L,
+ 3.908332488377770886091936221573123353489E-4L,
+ 9.250427033957236609624199884089916836748E-3L,
+ 1.263420066165922645975830877751588421451E-1L,
+ 9.692527053860420229711317379861733180654E-1L,
+ 3.937813834630430172221329298841520707954E0L,
+ 7.603126427436356534498908111445191312181E0L,
+ 5.670677653334105479259958485084550934305E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.2e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NQ4_5N 10
+static const long double Q4_5N[NQ4_5N + 1] = {
+ 2.233870042925895644234072357400122854086E-11L,
+ 5.146223225761993222808463878999151699792E-9L,
+ 4.459114531468296461688753521109797474523E-7L,
+ 1.891397692931537975547242165291668056276E-5L,
+ 4.279519145911541776938964806470674565504E-4L,
+ 5.275239415656560634702073291768904783989E-3L,
+ 3.468698403240744801278238473898432608887E-2L,
+ 1.138773146337708415188856882915457888274E-1L,
+ 1.622717518946443013587108598334636458955E-1L,
+ 7.249040006390586123760992346453034628227E-2L,
+ 1.941595365256460232175236758506411486667E-3L,
+};
+#define NQ4_5D 9
+static const long double Q4_5D[NQ4_5D + 1] = {
+ 3.049977232266999249626430127217988047453E-10L,
+ 7.120883230531035857746096928889676144099E-8L,
+ 6.301786064753734446784637919554359588859E-6L,
+ 2.762010530095069598480766869426308077192E-4L,
+ 6.572163250572867859316828886203406361251E-3L,
+ 8.752566114841221958200215255461843397776E-2L,
+ 6.487654992874805093499285311075289932664E-1L,
+ 2.576550017826654579451615283022812801435E0L,
+ 5.056392229924022835364779562707348096036E0L,
+ 4.179770081068251464907531367859072157773E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 1.4e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NQ3r2_4N 10
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+ 6.126167301024815034423262653066023684411E-10L,
+ 1.043969327113173261820028225053598975128E-7L,
+ 6.592927270288697027757438170153763220190E-6L,
+ 2.009103660938497963095652951912071336730E-4L,
+ 3.220543385492643525985862356352195896964E-3L,
+ 2.774405975730545157543417650436941650990E-2L,
+ 1.258114008023826384487378016636555041129E-1L,
+ 2.811724258266902502344701449984698323860E-1L,
+ 2.691837665193548059322831687432415014067E-1L,
+ 7.949087384900985370683770525312735605034E-2L,
+ 1.229509543620976530030153018986910810747E-3L,
+};
+#define NQ3r2_4D 9
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+ 8.364260446128475461539941389210166156568E-9L,
+ 1.451301850638956578622154585560759862764E-6L,
+ 9.431830010924603664244578867057141839463E-5L,
+ 3.004105101667433434196388593004526182741E-3L,
+ 5.148157397848271739710011717102773780221E-2L,
+ 4.901089301726939576055285374953887874895E-1L,
+ 2.581760991981709901216967665934142240346E0L,
+ 7.257105880775059281391729708630912791847E0L,
+ 1.006014717326362868007913423810737369312E1L,
+ 5.879416600465399514404064187445293212470E0L,
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.8e-36
+ 0.3125 <= 1/x <= 0.375 */
+#define NQ2r7_3r2N 9
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ 7.584861620402450302063691901886141875454E-8L,
+ 9.300939338814216296064659459966041794591E-6L,
+ 4.112108906197521696032158235392604947895E-4L,
+ 8.515168851578898791897038357239630654431E-3L,
+ 8.971286321017307400142720556749573229058E-2L,
+ 4.885856732902956303343015636331874194498E-1L,
+ 1.334506268733103291656253500506406045846E0L,
+ 1.681207956863028164179042145803851824654E0L,
+ 8.165042692571721959157677701625853772271E-1L,
+ 9.805848115375053300608712721986235900715E-2L,
+};
+#define NQ2r7_3r2D 9
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ 1.035586492113036586458163971239438078160E-6L,
+ 1.301999337731768381683593636500979713689E-4L,
+ 5.993695702564527062553071126719088859654E-3L,
+ 1.321184892887881883489141186815457808785E-1L,
+ 1.528766555485015021144963194165165083312E0L,
+ 9.561463309176490874525827051566494939295E0L,
+ 3.203719484883967351729513662089163356911E1L,
+ 5.497294687660930446641539152123568668447E1L,
+ 4.391158169390578768508675452986948391118E1L,
+ 1.347836630730048077907818943625789418378E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 2.2e-35
+ 0.375 <= 1/x <= 0.4375 */
+#define NQ2r3_2r7N 9
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ 4.455027774980750211349941766420190722088E-7L,
+ 4.031998274578520170631601850866780366466E-5L,
+ 1.273987274325947007856695677491340636339E-3L,
+ 1.818754543377448509897226554179659122873E-2L,
+ 1.266748858326568264126353051352269875352E-1L,
+ 4.327578594728723821137731555139472880414E-1L,
+ 6.892532471436503074928194969154192615359E-1L,
+ 4.490775818438716873422163588640262036506E-1L,
+ 8.649615949297322440032000346117031581572E-2L,
+ 7.261345286655345047417257611469066147561E-4L,
+};
+#define NQ2r3_2r7D 8
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ 6.082600739680555266312417978064954793142E-6L,
+ 5.693622538165494742945717226571441747567E-4L,
+ 1.901625907009092204458328768129666975975E-2L,
+ 2.958689532697857335456896889409923371570E-1L,
+ 2.343124711045660081603809437993368799568E0L,
+ 9.665894032187458293568704885528192804376E0L,
+ 2.035273104990617136065743426322454881353E1L,
+ 2.044102010478792896815088858740075165531E1L,
+ 8.445937177863155827844146643468706599304E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.1e-36
+ 0.4375 <= 1/x <= 0.5 */
+#define NQ2_2r3N 9
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+ 2.817566786579768804844367382809101929314E-6L,
+ 2.122772176396691634147024348373539744935E-4L,
+ 5.501378031780457828919593905395747517585E-3L,
+ 6.355374424341762686099147452020466524659E-2L,
+ 3.539652320122661637429658698954748337223E-1L,
+ 9.571721066119617436343740541777014319695E-1L,
+ 1.196258777828426399432550698612171955305E0L,
+ 6.069388659458926158392384709893753793967E-1L,
+ 9.026746127269713176512359976978248763621E-2L,
+ 5.317668723070450235320878117210807236375E-4L,
+};
+#define NQ2_2r3D 8
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+ 3.846924354014260866793741072933159380158E-5L,
+ 3.017562820057704325510067178327449946763E-3L,
+ 8.356305620686867949798885808540444210935E-2L,
+ 1.068314930499906838814019619594424586273E0L,
+ 6.900279623894821067017966573640732685233E0L,
+ 2.307667390886377924509090271780839563141E1L,
+ 3.921043465412723970791036825401273528513E1L,
+ 3.167569478939719383241775717095729233436E1L,
+ 1.051023841699200920276198346301543665909E1L,
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order zero. */
+
+long double
+__ieee754_j0l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return 1;
+
+ xx = fabsl (x);
+ if (xx <= 2)
+ {
+ if (xx < 0x1p-57L)
+ return 1;
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+ p -= 0.25L * z;
+ p += 1;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (xx + xx);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * cc / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_j0l, __j0l_finite)
+
+
+/* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2)
+ Peak absolute error 1.7e-36 (relative where Y0 > 1)
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -1.062023609591350692692296993537002558155E19L,
+ 2.542000883190248639104127452714966858866E19L,
+ -1.984190771278515324281415820316054696545E18L,
+ 4.982586044371592942465373274440222033891E16L,
+ -5.529326354780295177243773419090123407550E14L,
+ 3.013431465522152289279088265336861140391E12L,
+ -7.959436160727126750732203098982718347785E9L,
+ 8.230845651379566339707130644134372793322E6L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 1.438972634353286978700329883122253752192E20L,
+ 1.856409101981569254247700169486907405500E18L,
+ 1.219693352678218589553725579802986255614E16L,
+ 5.389428943282838648918475915779958097958E13L,
+ 1.774125762108874864433872173544743051653E11L,
+ 4.522104832545149534808218252434693007036E8L,
+ 8.872187401232943927082914504125234454930E5L,
+ 1.251945613186787532055610876304669413955E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+
+/* Bessel function of the second kind, order zero. */
+
+long double
+ __ieee754_y0l(long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-57)
+ return U0 + TWOOPI * __ieee754_logl (x);
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j0l (x) + p;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (x, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (x + x);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (x);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
+ return z;
+}
+strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index c86e24f7c0..5126900f96 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -1,2 +1,885 @@
-/* Looks like we can use ieee854 e_j1l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j1l.c>
+/* Bessel function of order one. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.onrl.gov).
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <errno.h>
+#include <math.h>
+#include <math_private.h>
+#include <math-underflow.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
+
+/* J1(x) = .5x + x x^2 R(x^2)
+ Peak relative error 1.9e-35
+ 0 <= x <= 2 */
+#define NJ0_2N 6
+static const long double J0_2N[NJ0_2N + 1] = {
+ -5.943799577386942855938508697619735179660E16L,
+ 1.812087021305009192259946997014044074711E15L,
+ -2.761698314264509665075127515729146460895E13L,
+ 2.091089497823600978949389109350658815972E11L,
+ -8.546413231387036372945453565654130054307E8L,
+ 1.797229225249742247475464052741320612261E6L,
+ -1.559552840946694171346552770008812083969E3L
+};
+#define NJ0_2D 6
+static const long double J0_2D[NJ0_2D + 1] = {
+ 9.510079323819108569501613916191477479397E17L,
+ 1.063193817503280529676423936545854693915E16L,
+ 5.934143516050192600795972192791775226920E13L,
+ 2.168000911950620999091479265214368352883E11L,
+ 5.673775894803172808323058205986256928794E8L,
+ 1.080329960080981204840966206372671147224E6L,
+ 1.411951256636576283942477881535283304912E3L,
+ /* 1.000000000000000000000000000000000000000E0L */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0 <= 1/x <= .0625
+ Peak relative error 3.6e-36 */
+#define NP16_IN 9
+static const long double P16_IN[NP16_IN + 1] = {
+ 5.143674369359646114999545149085139822905E-16L,
+ 4.836645664124562546056389268546233577376E-13L,
+ 1.730945562285804805325011561498453013673E-10L,
+ 3.047976856147077889834905908605310585810E-8L,
+ 2.855227609107969710407464739188141162386E-6L,
+ 1.439362407936705484122143713643023998457E-4L,
+ 3.774489768532936551500999699815873422073E-3L,
+ 4.723962172984642566142399678920790598426E-2L,
+ 2.359289678988743939925017240478818248735E-1L,
+ 3.032580002220628812728954785118117124520E-1L,
+};
+#define NP16_ID 9
+static const long double P16_ID[NP16_ID + 1] = {
+ 4.389268795186898018132945193912677177553E-15L,
+ 4.132671824807454334388868363256830961655E-12L,
+ 1.482133328179508835835963635130894413136E-9L,
+ 2.618941412861122118906353737117067376236E-7L,
+ 2.467854246740858470815714426201888034270E-5L,
+ 1.257192927368839847825938545925340230490E-3L,
+ 3.362739031941574274949719324644120720341E-2L,
+ 4.384458231338934105875343439265370178858E-1L,
+ 2.412830809841095249170909628197264854651E0L,
+ 4.176078204111348059102962617368214856874E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0.0625 <= 1/x <= 0.125
+ Peak relative error 1.9e-36 */
+#define NP8_16N 11
+static const long double P8_16N[NP8_16N + 1] = {
+ 2.984612480763362345647303274082071598135E-16L,
+ 1.923651877544126103941232173085475682334E-13L,
+ 4.881258879388869396043760693256024307743E-11L,
+ 6.368866572475045408480898921866869811889E-9L,
+ 4.684818344104910450523906967821090796737E-7L,
+ 2.005177298271593587095982211091300382796E-5L,
+ 4.979808067163957634120681477207147536182E-4L,
+ 6.946005761642579085284689047091173581127E-3L,
+ 5.074601112955765012750207555985299026204E-2L,
+ 1.698599455896180893191766195194231825379E-1L,
+ 1.957536905259237627737222775573623779638E-1L,
+ 2.991314703282528370270179989044994319374E-2L,
+};
+#define NP8_16D 10
+static const long double P8_16D[NP8_16D + 1] = {
+ 2.546869316918069202079580939942463010937E-15L,
+ 1.644650111942455804019788382157745229955E-12L,
+ 4.185430770291694079925607420808011147173E-10L,
+ 5.485331966975218025368698195861074143153E-8L,
+ 4.062884421686912042335466327098932678905E-6L,
+ 1.758139661060905948870523641319556816772E-4L,
+ 4.445143889306356207566032244985607493096E-3L,
+ 6.391901016293512632765621532571159071158E-2L,
+ 4.933040207519900471177016015718145795434E-1L,
+ 1.839144086168947712971630337250761842976E0L,
+ 2.715120873995490920415616716916149586579E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0.125 <= 1/x <= 0.1875
+ Peak relative error 1.3e-36 */
+#define NP5_8N 10
+static const long double P5_8N[NP5_8N + 1] = {
+ 2.837678373978003452653763806968237227234E-12L,
+ 9.726641165590364928442128579282742354806E-10L,
+ 1.284408003604131382028112171490633956539E-7L,
+ 8.524624695868291291250573339272194285008E-6L,
+ 3.111516908953172249853673787748841282846E-4L,
+ 6.423175156126364104172801983096596409176E-3L,
+ 7.430220589989104581004416356260692450652E-2L,
+ 4.608315409833682489016656279567605536619E-1L,
+ 1.396870223510964882676225042258855977512E0L,
+ 1.718500293904122365894630460672081526236E0L,
+ 5.465927698800862172307352821870223855365E-1L
+};
+#define NP5_8D 10
+static const long double P5_8D[NP5_8D + 1] = {
+ 2.421485545794616609951168511612060482715E-11L,
+ 8.329862750896452929030058039752327232310E-9L,
+ 1.106137992233383429630592081375289010720E-6L,
+ 7.405786153760681090127497796448503306939E-5L,
+ 2.740364785433195322492093333127633465227E-3L,
+ 5.781246470403095224872243564165254652198E-2L,
+ 6.927711353039742469918754111511109983546E-1L,
+ 4.558679283460430281188304515922826156690E0L,
+ 1.534468499844879487013168065728837900009E1L,
+ 2.313927430889218597919624843161569422745E1L,
+ 1.194506341319498844336768473218382828637E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.4e-36
+ 0.1875 <= 1/x <= 0.25 */
+#define NP4_5N 10
+static const long double P4_5N[NP4_5N + 1] = {
+ 1.846029078268368685834261260420933914621E-10L,
+ 3.916295939611376119377869680335444207768E-8L,
+ 3.122158792018920627984597530935323997312E-6L,
+ 1.218073444893078303994045653603392272450E-4L,
+ 2.536420827983485448140477159977981844883E-3L,
+ 2.883011322006690823959367922241169171315E-2L,
+ 1.755255190734902907438042414495469810830E-1L,
+ 5.379317079922628599870898285488723736599E-1L,
+ 7.284904050194300773890303361501726561938E-1L,
+ 3.270110346613085348094396323925000362813E-1L,
+ 1.804473805689725610052078464951722064757E-2L,
+};
+#define NP4_5D 9
+static const long double P4_5D[NP4_5D + 1] = {
+ 1.575278146806816970152174364308980863569E-9L,
+ 3.361289173657099516191331123405675054321E-7L,
+ 2.704692281550877810424745289838790693708E-5L,
+ 1.070854930483999749316546199273521063543E-3L,
+ 2.282373093495295842598097265627962125411E-2L,
+ 2.692025460665354148328762368240343249830E-1L,
+ 1.739892942593664447220951225734811133759E0L,
+ 5.890727576752230385342377570386657229324E0L,
+ 9.517442287057841500750256954117735128153E0L,
+ 6.100616353935338240775363403030137736013E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 3.0e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NP3r2_4N 9
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+ 8.240803130988044478595580300846665863782E-8L,
+ 1.179418958381961224222969866406483744580E-5L,
+ 6.179787320956386624336959112503824397755E-4L,
+ 1.540270833608687596420595830747166658383E-2L,
+ 1.983904219491512618376375619598837355076E-1L,
+ 1.341465722692038870390470651608301155565E0L,
+ 4.617865326696612898792238245990854646057E0L,
+ 7.435574801812346424460233180412308000587E0L,
+ 4.671327027414635292514599201278557680420E0L,
+ 7.299530852495776936690976966995187714739E-1L,
+};
+#define NP3r2_4D 9
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+ 7.032152009675729604487575753279187576521E-7L,
+ 1.015090352324577615777511269928856742848E-4L,
+ 5.394262184808448484302067955186308730620E-3L,
+ 1.375291438480256110455809354836988584325E-1L,
+ 1.836247144461106304788160919310404376670E0L,
+ 1.314378564254376655001094503090935880349E1L,
+ 4.957184590465712006934452500894672343488E1L,
+ 9.287394244300647738855415178790263465398E1L,
+ 7.652563275535900609085229286020552768399E1L,
+ 2.147042473003074533150718117770093209096E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.0e-35
+ 0.3125 <= 1/x <= 0.375 */
+#define NP2r7_3r2N 9
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+ 4.599033469240421554219816935160627085991E-7L,
+ 4.665724440345003914596647144630893997284E-5L,
+ 1.684348845667764271596142716944374892756E-3L,
+ 2.802446446884455707845985913454440176223E-2L,
+ 2.321937586453963310008279956042545173930E-1L,
+ 9.640277413988055668692438709376437553804E-1L,
+ 1.911021064710270904508663334033003246028E0L,
+ 1.600811610164341450262992138893970224971E0L,
+ 4.266299218652587901171386591543457861138E-1L,
+ 1.316470424456061252962568223251247207325E-2L,
+};
+#define NP2r7_3r2D 8
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+ 3.924508608545520758883457108453520099610E-6L,
+ 4.029707889408829273226495756222078039823E-4L,
+ 1.484629715787703260797886463307469600219E-2L,
+ 2.553136379967180865331706538897231588685E-1L,
+ 2.229457223891676394409880026887106228740E0L,
+ 1.005708903856384091956550845198392117318E1L,
+ 2.277082659664386953166629360352385889558E1L,
+ 2.384726835193630788249826630376533988245E1L,
+ 9.700989749041320895890113781610939632410E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.7e-36
+ 0.3125 <= 1/x <= 0.4375 */
+#define NP2r3_2r7N 9
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+ 3.916766777108274628543759603786857387402E-6L,
+ 3.212176636756546217390661984304645137013E-4L,
+ 9.255768488524816445220126081207248947118E-3L,
+ 1.214853146369078277453080641911700735354E-1L,
+ 7.855163309847214136198449861311404633665E-1L,
+ 2.520058073282978403655488662066019816540E0L,
+ 3.825136484837545257209234285382183711466E0L,
+ 2.432569427554248006229715163865569506873E0L,
+ 4.877934835018231178495030117729800489743E-1L,
+ 1.109902737860249670981355149101343427885E-2L,
+};
+#define NP2r3_2r7D 8
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+ 3.342307880794065640312646341190547184461E-5L,
+ 2.782182891138893201544978009012096558265E-3L,
+ 8.221304931614200702142049236141249929207E-2L,
+ 1.123728246291165812392918571987858010949E0L,
+ 7.740482453652715577233858317133423434590E0L,
+ 2.737624677567945952953322566311201919139E1L,
+ 4.837181477096062403118304137851260715475E1L,
+ 3.941098643468580791437772701093795299274E1L,
+ 1.245821247166544627558323920382547533630E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.7e-35
+ 0.4375 <= 1/x <= 0.5 */
+#define NP2_2r3N 8
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+ 3.397930802851248553545191160608731940751E-4L,
+ 2.104020902735482418784312825637833698217E-2L,
+ 4.442291771608095963935342749477836181939E-1L,
+ 4.131797328716583282869183304291833754967E0L,
+ 1.819920169779026500146134832455189917589E1L,
+ 3.781779616522937565300309684282401791291E1L,
+ 3.459605449728864218972931220783543410347E1L,
+ 1.173594248397603882049066603238568316561E1L,
+ 9.455702270242780642835086549285560316461E-1L,
+};
+#define NP2_2r3D 8
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+ 2.899568897241432883079888249845707400614E-3L,
+ 1.831107138190848460767699919531132426356E-1L,
+ 3.999350044057883839080258832758908825165E0L,
+ 3.929041535867957938340569419874195303712E1L,
+ 1.884245613422523323068802689915538908291E2L,
+ 4.461469948819229734353852978424629815929E2L,
+ 5.004998753999796821224085972610636347903E2L,
+ 2.386342520092608513170837883757163414100E2L,
+ 3.791322528149347975999851588922424189957E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 8.0e-36
+ 0 <= 1/x <= .0625 */
+#define NQ16_IN 10
+static const long double Q16_IN[NQ16_IN + 1] = {
+ -3.917420835712508001321875734030357393421E-18L,
+ -4.440311387483014485304387406538069930457E-15L,
+ -1.951635424076926487780929645954007139616E-12L,
+ -4.318256438421012555040546775651612810513E-10L,
+ -5.231244131926180765270446557146989238020E-8L,
+ -3.540072702902043752460711989234732357653E-6L,
+ -1.311017536555269966928228052917534882984E-4L,
+ -2.495184669674631806622008769674827575088E-3L,
+ -2.141868222987209028118086708697998506716E-2L,
+ -6.184031415202148901863605871197272650090E-2L,
+ -1.922298704033332356899546792898156493887E-2L,
+};
+#define NQ16_ID 9
+static const long double Q16_ID[NQ16_ID + 1] = {
+ 3.820418034066293517479619763498400162314E-17L,
+ 4.340702810799239909648911373329149354911E-14L,
+ 1.914985356383416140706179933075303538524E-11L,
+ 4.262333682610888819476498617261895474330E-9L,
+ 5.213481314722233980346462747902942182792E-7L,
+ 3.585741697694069399299005316809954590558E-5L,
+ 1.366513429642842006385029778105539457546E-3L,
+ 2.745282599850704662726337474371355160594E-2L,
+ 2.637644521611867647651200098449903330074E-1L,
+ 1.006953426110765984590782655598680488746E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.9e-36
+ 0.0625 <= 1/x <= 0.125 */
+#define NQ8_16N 11
+static const long double Q8_16N[NQ8_16N + 1] = {
+ -2.028630366670228670781362543615221542291E-17L,
+ -1.519634620380959966438130374006858864624E-14L,
+ -4.540596528116104986388796594639405114524E-12L,
+ -7.085151756671466559280490913558388648274E-10L,
+ -6.351062671323970823761883833531546885452E-8L,
+ -3.390817171111032905297982523519503522491E-6L,
+ -1.082340897018886970282138836861233213972E-4L,
+ -2.020120801187226444822977006648252379508E-3L,
+ -2.093169910981725694937457070649605557555E-2L,
+ -1.092176538874275712359269481414448063393E-1L,
+ -2.374790947854765809203590474789108718733E-1L,
+ -1.365364204556573800719985118029601401323E-1L,
+};
+#define NQ8_16D 11
+static const long double Q8_16D[NQ8_16D + 1] = {
+ 1.978397614733632533581207058069628242280E-16L,
+ 1.487361156806202736877009608336766720560E-13L,
+ 4.468041406888412086042576067133365913456E-11L,
+ 7.027822074821007443672290507210594648877E-9L,
+ 6.375740580686101224127290062867976007374E-7L,
+ 3.466887658320002225888644977076410421940E-5L,
+ 1.138625640905289601186353909213719596986E-3L,
+ 2.224470799470414663443449818235008486439E-2L,
+ 2.487052928527244907490589787691478482358E-1L,
+ 1.483927406564349124649083853892380899217E0L,
+ 4.182773513276056975777258788903489507705E0L,
+ 4.419665392573449746043880892524360870944E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.5e-35
+ 0.125 <= 1/x <= 0.1875 */
+#define NQ5_8N 10
+static const long double Q5_8N[NQ5_8N + 1] = {
+ -3.656082407740970534915918390488336879763E-13L,
+ -1.344660308497244804752334556734121771023E-10L,
+ -1.909765035234071738548629788698150760791E-8L,
+ -1.366668038160120210269389551283666716453E-6L,
+ -5.392327355984269366895210704976314135683E-5L,
+ -1.206268245713024564674432357634540343884E-3L,
+ -1.515456784370354374066417703736088291287E-2L,
+ -1.022454301137286306933217746545237098518E-1L,
+ -3.373438906472495080504907858424251082240E-1L,
+ -4.510782522110845697262323973549178453405E-1L,
+ -1.549000892545288676809660828213589804884E-1L,
+};
+#define NQ5_8D 10
+static const long double Q5_8D[NQ5_8D + 1] = {
+ 3.565550843359501079050699598913828460036E-12L,
+ 1.321016015556560621591847454285330528045E-9L,
+ 1.897542728662346479999969679234270605975E-7L,
+ 1.381720283068706710298734234287456219474E-5L,
+ 5.599248147286524662305325795203422873725E-4L,
+ 1.305442352653121436697064782499122164843E-2L,
+ 1.750234079626943298160445750078631894985E-1L,
+ 1.311420542073436520965439883806946678491E0L,
+ 5.162757689856842406744504211089724926650E0L,
+ 9.527760296384704425618556332087850581308E0L,
+ 6.604648207463236667912921642545100248584E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.3e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NQ4_5N 10
+static const long double Q4_5N[NQ4_5N + 1] = {
+ -4.079513568708891749424783046520200903755E-11L,
+ -9.326548104106791766891812583019664893311E-9L,
+ -8.016795121318423066292906123815687003356E-7L,
+ -3.372350544043594415609295225664186750995E-5L,
+ -7.566238665947967882207277686375417983917E-4L,
+ -9.248861580055565402130441618521591282617E-3L,
+ -6.033106131055851432267702948850231270338E-2L,
+ -1.966908754799996793730369265431584303447E-1L,
+ -2.791062741179964150755788226623462207560E-1L,
+ -1.255478605849190549914610121863534191666E-1L,
+ -4.320429862021265463213168186061696944062E-3L,
+};
+#define NQ4_5D 9
+static const long double Q4_5D[NQ4_5D + 1] = {
+ 3.978497042580921479003851216297330701056E-10L,
+ 9.203304163828145809278568906420772246666E-8L,
+ 8.059685467088175644915010485174545743798E-6L,
+ 3.490187375993956409171098277561669167446E-4L,
+ 8.189109654456872150100501732073810028829E-3L,
+ 1.072572867311023640958725265762483033769E-1L,
+ 7.790606862409960053675717185714576937994E-1L,
+ 3.016049768232011196434185423512777656328E0L,
+ 5.722963851442769787733717162314477949360E0L,
+ 4.510527838428473279647251350931380867663E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 2.1e-35
+ 0.25 <= 1/x <= 0.3125 */
+#define NQ3r2_4N 9
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+ -1.087480809271383885936921889040388133627E-8L,
+ -1.690067828697463740906962973479310170932E-6L,
+ -9.608064416995105532790745641974762550982E-5L,
+ -2.594198839156517191858208513873961837410E-3L,
+ -3.610954144421543968160459863048062977822E-2L,
+ -2.629866798251843212210482269563961685666E-1L,
+ -9.709186825881775885917984975685752956660E-1L,
+ -1.667521829918185121727268867619982417317E0L,
+ -1.109255082925540057138766105229900943501E0L,
+ -1.812932453006641348145049323713469043328E-1L,
+};
+#define NQ3r2_4D 9
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+ 1.060552717496912381388763753841473407026E-7L,
+ 1.676928002024920520786883649102388708024E-5L,
+ 9.803481712245420839301400601140812255737E-4L,
+ 2.765559874262309494758505158089249012930E-2L,
+ 4.117921827792571791298862613287549140706E-1L,
+ 3.323769515244751267093378361930279161413E0L,
+ 1.436602494405814164724810151689705353670E1L,
+ 3.163087869617098638064881410646782408297E1L,
+ 3.198181264977021649489103980298349589419E1L,
+ 1.203649258862068431199471076202897823272E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.6e-36
+ 0.3125 <= 1/x <= 0.375 */
+#define NQ2r7_3r2N 9
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ -1.723405393982209853244278760171643219530E-7L,
+ -2.090508758514655456365709712333460087442E-5L,
+ -9.140104013370974823232873472192719263019E-4L,
+ -1.871349499990714843332742160292474780128E-2L,
+ -1.948930738119938669637865956162512983416E-1L,
+ -1.048764684978978127908439526343174139788E0L,
+ -2.827714929925679500237476105843643064698E0L,
+ -3.508761569156476114276988181329773987314E0L,
+ -1.669332202790211090973255098624488308989E0L,
+ -1.930796319299022954013840684651016077770E-1L,
+};
+#define NQ2r7_3r2D 9
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ 1.680730662300831976234547482334347983474E-6L,
+ 2.084241442440551016475972218719621841120E-4L,
+ 9.445316642108367479043541702688736295579E-3L,
+ 2.044637889456631896650179477133252184672E-1L,
+ 2.316091982244297350829522534435350078205E0L,
+ 1.412031891783015085196708811890448488865E1L,
+ 4.583830154673223384837091077279595496149E1L,
+ 7.549520609270909439885998474045974122261E1L,
+ 5.697605832808113367197494052388203310638E1L,
+ 1.601496240876192444526383314589371686234E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 9.5e-36
+ 0.375 <= 1/x <= 0.4375 */
+#define NQ2r3_2r7N 9
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ -8.603042076329122085722385914954878953775E-7L,
+ -7.701746260451647874214968882605186675720E-5L,
+ -2.407932004380727587382493696877569654271E-3L,
+ -3.403434217607634279028110636919987224188E-2L,
+ -2.348707332185238159192422084985713102877E-1L,
+ -7.957498841538254916147095255700637463207E-1L,
+ -1.258469078442635106431098063707934348577E0L,
+ -8.162415474676345812459353639449971369890E-1L,
+ -1.581783890269379690141513949609572806898E-1L,
+ -1.890595651683552228232308756569450822905E-3L,
+};
+#define NQ2r3_2r7D 8
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ 8.390017524798316921170710533381568175665E-6L,
+ 7.738148683730826286477254659973968763659E-4L,
+ 2.541480810958665794368759558791634341779E-2L,
+ 3.878879789711276799058486068562386244873E-1L,
+ 3.003783779325811292142957336802456109333E0L,
+ 1.206480374773322029883039064575464497400E1L,
+ 2.458414064785315978408974662900438351782E1L,
+ 2.367237826273668567199042088835448715228E1L,
+ 9.231451197519171090875569102116321676763E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.4e-36
+ 0.4375 <= 1/x <= 0.5 */
+#define NQ2_2r3N 9
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+ -5.552507516089087822166822364590806076174E-6L,
+ -4.135067659799500521040944087433752970297E-4L,
+ -1.059928728869218962607068840646564457980E-2L,
+ -1.212070036005832342565792241385459023801E-1L,
+ -6.688350110633603958684302153362735625156E-1L,
+ -1.793587878197360221340277951304429821582E0L,
+ -2.225407682237197485644647380483725045326E0L,
+ -1.123402135458940189438898496348239744403E0L,
+ -1.679187241566347077204805190763597299805E-1L,
+ -1.458550613639093752909985189067233504148E-3L,
+};
+#define NQ2_2r3D 8
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+ 5.415024336507980465169023996403597916115E-5L,
+ 4.179246497380453022046357404266022870788E-3L,
+ 1.136306384261959483095442402929502368598E-1L,
+ 1.422640343719842213484515445393284072830E0L,
+ 8.968786703393158374728850922289204805764E0L,
+ 2.914542473339246127533384118781216495934E1L,
+ 4.781605421020380669870197378210457054685E1L,
+ 3.693865837171883152382820584714795072937E1L,
+ 1.153220502744204904763115556224395893076E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order one. */
+
+long double
+__ieee754_j1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return x;
+ xx = fabsl (x);
+ if (xx <= 0x1p-58L)
+ {
+ long double ret = x * 0.5L;
+ math_check_force_underflow (ret);
+ if (ret == 0)
+ __set_errno (ERANGE);
+ return ret;
+ }
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+ p += 0.5L * xx;
+ if (x < 0)
+ p = -p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ {
+ z = ONEOSQPI * cc / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+ }
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+}
+strong_alias (__ieee754_j1l, __j1l_finite)
+
+
+/* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2)
+ Peak relative error 6.2e-38
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -6.804415404830253804408698161694720833249E19L,
+ 1.805450517967019908027153056150465849237E19L,
+ -8.065747497063694098810419456383006737312E17L,
+ 1.401336667383028259295830955439028236299E16L,
+ -1.171654432898137585000399489686629680230E14L,
+ 5.061267920943853732895341125243428129150E11L,
+ -1.096677850566094204586208610960870217970E9L,
+ 9.541172044989995856117187515882879304461E5L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 3.470629591820267059538637461549677594549E20L,
+ 4.120796439009916326855848107545425217219E18L,
+ 2.477653371652018249749350657387030814542E16L,
+ 9.954678543353888958177169349272167762797E13L,
+ 2.957927997613630118216218290262851197754E11L,
+ 6.748421382188864486018861197614025972118E8L,
+ 1.173453425218010888004562071020305709319E6L,
+ 1.450335662961034949894009554536003377187E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Bessel function of the second kind, order one. */
+
+long double
+__ieee754_y1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-114)
+ {
+ z = -TWOOPI / x;
+ if (isinf (z))
+ __set_errno (ERANGE);
+ return z;
+ }
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ SET_RESTORE_ROUNDL (FE_TONEAREST);
+ z = xx * xx;
+ p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = -TWOOPI / xx + p;
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 4a8ccb044e..71b3addfba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -60,6 +60,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
@@ -149,7 +150,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -385,7 +386,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 9bcaaf765a..5b628bedc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -1,3 +1,992 @@
-/* Looks like we can use ieee854 e_lgammal_r.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_lgammal_r.c>
+/* Natural logarithm of gamma function. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_lgammal_r.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
+static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
+static const long double one = 1;
+static const long double huge = LDBL_MAX;
+
+/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
+ 1/x <= 0.0741 (x >= 13.495...)
+ Peak relative error 1.5e-36 */
+static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
+#define NRASY 12
+static const long double RASY[NRASY + 1] =
+{
+ 8.333333333333333333333333333310437112111E-2L,
+ -2.777777777777777777777774789556228296902E-3L,
+ 7.936507936507936507795933938448586499183E-4L,
+ -5.952380952380952041799269756378148574045E-4L,
+ 8.417508417507928904209891117498524452523E-4L,
+ -1.917526917481263997778542329739806086290E-3L,
+ 6.410256381217852504446848671499409919280E-3L,
+ -2.955064066900961649768101034477363301626E-2L,
+ 1.796402955865634243663453415388336954675E-1L,
+ -1.391522089007758553455753477688592767741E0L,
+ 1.326130089598399157988112385013829305510E1L,
+ -1.420412699593782497803472576479997819149E2L,
+ 1.218058922427762808938869872528846787020E3L
+};
+
+
+/* log gamma(x+13) = log gamma(13) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 12.5 <= x+13 <= 13.5
+ Peak relative error 1.1e-36 */
+static const long double lgam13a = 1.9987213134765625E1L;
+static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
+#define NRN13 7
+static const long double RN13[NRN13 + 1] =
+{
+ 8.591478354823578150238226576156275285700E11L,
+ 2.347931159756482741018258864137297157668E11L,
+ 2.555408396679352028680662433943000804616E10L,
+ 1.408581709264464345480765758902967123937E9L,
+ 4.126759849752613822953004114044451046321E7L,
+ 6.133298899622688505854211579222889943778E5L,
+ 3.929248056293651597987893340755876578072E3L,
+ 6.850783280018706668924952057996075215223E0L
+};
+#define NRD13 6
+static const long double RD13[NRD13 + 1] =
+{
+ 3.401225382297342302296607039352935541669E11L,
+ 8.756765276918037910363513243563234551784E10L,
+ 8.873913342866613213078554180987647243903E9L,
+ 4.483797255342763263361893016049310017973E8L,
+ 1.178186288833066430952276702931512870676E7L,
+ 1.519928623743264797939103740132278337476E5L,
+ 7.989298844938119228411117593338850892311E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+12) = log gamma(12) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 11.5 <= x+12 <= 12.5
+ Peak relative error 4.1e-36 */
+static const long double lgam12a = 1.75023040771484375E1L;
+static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
+#define NRN12 7
+static const long double RN12[NRN12 + 1] =
+{
+ 4.709859662695606986110997348630997559137E11L,
+ 1.398713878079497115037857470168777995230E11L,
+ 1.654654931821564315970930093932954900867E10L,
+ 9.916279414876676861193649489207282144036E8L,
+ 3.159604070526036074112008954113411389879E7L,
+ 5.109099197547205212294747623977502492861E5L,
+ 3.563054878276102790183396740969279826988E3L,
+ 6.769610657004672719224614163196946862747E0L
+};
+#define NRD12 6
+static const long double RD12[NRD12 + 1] =
+{
+ 1.928167007860968063912467318985802726613E11L,
+ 5.383198282277806237247492369072266389233E10L,
+ 5.915693215338294477444809323037871058363E9L,
+ 3.241438287570196713148310560147925781342E8L,
+ 9.236680081763754597872713592701048455890E6L,
+ 1.292246897881650919242713651166596478850E5L,
+ 7.366532445427159272584194816076600211171E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+11) = log gamma(11) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 10.5 <= x+11 <= 11.5
+ Peak relative error 1.8e-35 */
+static const long double lgam11a = 1.5104400634765625E1L;
+static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
+#define NRN11 7
+static const long double RN11[NRN11 + 1] =
+{
+ 2.446960438029415837384622675816736622795E11L,
+ 7.955444974446413315803799763901729640350E10L,
+ 1.030555327949159293591618473447420338444E10L,
+ 6.765022131195302709153994345470493334946E8L,
+ 2.361892792609204855279723576041468347494E7L,
+ 4.186623629779479136428005806072176490125E5L,
+ 3.202506022088912768601325534149383594049E3L,
+ 6.681356101133728289358838690666225691363E0L
+};
+#define NRD11 6
+static const long double RD11[NRD11 + 1] =
+{
+ 1.040483786179428590683912396379079477432E11L,
+ 3.172251138489229497223696648369823779729E10L,
+ 3.806961885984850433709295832245848084614E9L,
+ 2.278070344022934913730015420611609620171E8L,
+ 7.089478198662651683977290023829391596481E6L,
+ 1.083246385105903533237139380509590158658E5L,
+ 6.744420991491385145885727942219463243597E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+10) = log gamma(10) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 9.5 <= x+10 <= 10.5
+ Peak relative error 5.4e-37 */
+static const long double lgam10a = 1.280181884765625E1L;
+static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
+#define NRN10 7
+static const long double RN10[NRN10 + 1] =
+{
+ -1.239059737177249934158597996648808363783E14L,
+ -4.725899566371458992365624673357356908719E13L,
+ -7.283906268647083312042059082837754850808E12L,
+ -5.802855515464011422171165179767478794637E11L,
+ -2.532349691157548788382820303182745897298E10L,
+ -5.884260178023777312587193693477072061820E8L,
+ -6.437774864512125749845840472131829114906E6L,
+ -2.350975266781548931856017239843273049384E4L
+};
+#define NRD10 7
+static const long double RD10[NRD10 + 1] =
+{
+ -5.502645997581822567468347817182347679552E13L,
+ -1.970266640239849804162284805400136473801E13L,
+ -2.819677689615038489384974042561531409392E12L,
+ -2.056105863694742752589691183194061265094E11L,
+ -8.053670086493258693186307810815819662078E9L,
+ -1.632090155573373286153427982504851867131E8L,
+ -1.483575879240631280658077826889223634921E6L,
+ -4.002806669713232271615885826373550502510E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+9) = log gamma(9) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 8.5 <= x+9 <= 9.5
+ Peak relative error 3.6e-36 */
+static const long double lgam9a = 1.06045989990234375E1L;
+static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
+#define NRN9 7
+static const long double RN9[NRN9 + 1] =
+{
+ -4.936332264202687973364500998984608306189E13L,
+ -2.101372682623700967335206138517766274855E13L,
+ -3.615893404644823888655732817505129444195E12L,
+ -3.217104993800878891194322691860075472926E11L,
+ -1.568465330337375725685439173603032921399E10L,
+ -4.073317518162025744377629219101510217761E8L,
+ -4.983232096406156139324846656819246974500E6L,
+ -2.036280038903695980912289722995505277253E4L
+};
+#define NRD9 7
+static const long double RD9[NRD9 + 1] =
+{
+ -2.306006080437656357167128541231915480393E13L,
+ -9.183606842453274924895648863832233799950E12L,
+ -1.461857965935942962087907301194381010380E12L,
+ -1.185728254682789754150068652663124298303E11L,
+ -5.166285094703468567389566085480783070037E9L,
+ -1.164573656694603024184768200787835094317E8L,
+ -1.177343939483908678474886454113163527909E6L,
+ -3.529391059783109732159524500029157638736E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+8) = log gamma(8) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 7.5 <= x+8 <= 8.5
+ Peak relative error 2.4e-37 */
+static const long double lgam8a = 8.525146484375E0L;
+static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
+#define NRN8 8
+static const long double RN8[NRN8 + 1] =
+{
+ 6.600775438203423546565361176829139703289E11L,
+ 3.406361267593790705240802723914281025800E11L,
+ 7.222460928505293914746983300555538432830E10L,
+ 8.102984106025088123058747466840656458342E9L,
+ 5.157620015986282905232150979772409345927E8L,
+ 1.851445288272645829028129389609068641517E7L,
+ 3.489261702223124354745894067468953756656E5L,
+ 2.892095396706665774434217489775617756014E3L,
+ 6.596977510622195827183948478627058738034E0L
+};
+#define NRD8 7
+static const long double RD8[NRD8 + 1] =
+{
+ 3.274776546520735414638114828622673016920E11L,
+ 1.581811207929065544043963828487733970107E11L,
+ 3.108725655667825188135393076860104546416E10L,
+ 3.193055010502912617128480163681842165730E9L,
+ 1.830871482669835106357529710116211541839E8L,
+ 5.790862854275238129848491555068073485086E6L,
+ 9.305213264307921522842678835618803553589E4L,
+ 6.216974105861848386918949336819572333622E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+7) = log gamma(7) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 6.5 <= x+7 <= 7.5
+ Peak relative error 3.2e-36 */
+static const long double lgam7a = 6.5792388916015625E0L;
+static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
+#define NRN7 8
+static const long double RN7[NRN7 + 1] =
+{
+ 2.065019306969459407636744543358209942213E11L,
+ 1.226919919023736909889724951708796532847E11L,
+ 2.996157990374348596472241776917953749106E10L,
+ 3.873001919306801037344727168434909521030E9L,
+ 2.841575255593761593270885753992732145094E8L,
+ 1.176342515359431913664715324652399565551E7L,
+ 2.558097039684188723597519300356028511547E5L,
+ 2.448525238332609439023786244782810774702E3L,
+ 6.460280377802030953041566617300902020435E0L
+};
+#define NRD7 7
+static const long double RD7[NRD7 + 1] =
+{
+ 1.102646614598516998880874785339049304483E11L,
+ 6.099297512712715445879759589407189290040E10L,
+ 1.372898136289611312713283201112060238351E10L,
+ 1.615306270420293159907951633566635172343E9L,
+ 1.061114435798489135996614242842561967459E8L,
+ 3.845638971184305248268608902030718674691E6L,
+ 7.081730675423444975703917836972720495507E4L,
+ 5.423122582741398226693137276201344096370E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+6) = log gamma(6) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 5.5 <= x+6 <= 6.5
+ Peak relative error 6.2e-37 */
+static const long double lgam6a = 4.7874908447265625E0L;
+static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
+#define NRN6 8
+static const long double RN6[NRN6 + 1] =
+{
+ -3.538412754670746879119162116819571823643E13L,
+ -2.613432593406849155765698121483394257148E13L,
+ -8.020670732770461579558867891923784753062E12L,
+ -1.322227822931250045347591780332435433420E12L,
+ -1.262809382777272476572558806855377129513E11L,
+ -7.015006277027660872284922325741197022467E9L,
+ -2.149320689089020841076532186783055727299E8L,
+ -3.167210585700002703820077565539658995316E6L,
+ -1.576834867378554185210279285358586385266E4L
+};
+#define NRD6 8
+static const long double RD6[NRD6 + 1] =
+{
+ -2.073955870771283609792355579558899389085E13L,
+ -1.421592856111673959642750863283919318175E13L,
+ -4.012134994918353924219048850264207074949E12L,
+ -6.013361045800992316498238470888523722431E11L,
+ -5.145382510136622274784240527039643430628E10L,
+ -2.510575820013409711678540476918249524123E9L,
+ -6.564058379709759600836745035871373240904E7L,
+ -7.861511116647120540275354855221373571536E5L,
+ -2.821943442729620524365661338459579270561E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+5) = log gamma(5) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 4.5 <= x+5 <= 5.5
+ Peak relative error 3.4e-37 */
+static const long double lgam5a = 3.17803955078125E0L;
+static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
+#define NRN5 9
+static const long double RN5[NRN5 + 1] =
+{
+ 2.010952885441805899580403215533972172098E11L,
+ 1.916132681242540921354921906708215338584E11L,
+ 7.679102403710581712903937970163206882492E10L,
+ 1.680514903671382470108010973615268125169E10L,
+ 2.181011222911537259440775283277711588410E9L,
+ 1.705361119398837808244780667539728356096E8L,
+ 7.792391565652481864976147945997033946360E6L,
+ 1.910741381027985291688667214472560023819E5L,
+ 2.088138241893612679762260077783794329559E3L,
+ 6.330318119566998299106803922739066556550E0L
+};
+#define NRD5 8
+static const long double RD5[NRD5 + 1] =
+{
+ 1.335189758138651840605141370223112376176E11L,
+ 1.174130445739492885895466097516530211283E11L,
+ 4.308006619274572338118732154886328519910E10L,
+ 8.547402888692578655814445003283720677468E9L,
+ 9.934628078575618309542580800421370730906E8L,
+ 6.847107420092173812998096295422311820672E7L,
+ 2.698552646016599923609773122139463150403E6L,
+ 5.526516251532464176412113632726150253215E4L,
+ 4.772343321713697385780533022595450486932E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+4) = log gamma(4) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 3.5 <= x+4 <= 4.5
+ Peak relative error 6.7e-37 */
+static const long double lgam4a = 1.791748046875E0L;
+static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
+#define NRN4 9
+static const long double RN4[NRN4 + 1] =
+{
+ -1.026583408246155508572442242188887829208E13L,
+ -1.306476685384622809290193031208776258809E13L,
+ -7.051088602207062164232806511992978915508E12L,
+ -2.100849457735620004967624442027793656108E12L,
+ -3.767473790774546963588549871673843260569E11L,
+ -4.156387497364909963498394522336575984206E10L,
+ -2.764021460668011732047778992419118757746E9L,
+ -1.036617204107109779944986471142938641399E8L,
+ -1.895730886640349026257780896972598305443E6L,
+ -1.180509051468390914200720003907727988201E4L
+};
+#define NRD4 9
+static const long double RD4[NRD4 + 1] =
+{
+ -8.172669122056002077809119378047536240889E12L,
+ -9.477592426087986751343695251801814226960E12L,
+ -4.629448850139318158743900253637212801682E12L,
+ -1.237965465892012573255370078308035272942E12L,
+ -1.971624313506929845158062177061297598956E11L,
+ -1.905434843346570533229942397763361493610E10L,
+ -1.089409357680461419743730978512856675984E9L,
+ -3.416703082301143192939774401370222822430E7L,
+ -4.981791914177103793218433195857635265295E5L,
+ -2.192507743896742751483055798411231453733E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+3) = log gamma(3) + x P(x)/Q(x)
+ -0.25 <= x <= 0.5
+ 2.75 <= x+3 <= 3.5
+ Peak relative error 6.0e-37 */
+static const long double lgam3a = 6.93145751953125E-1L;
+static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
+
+#define NRN3 9
+static const long double RN3[NRN3 + 1] =
+{
+ -4.813901815114776281494823863935820876670E11L,
+ -8.425592975288250400493910291066881992620E11L,
+ -6.228685507402467503655405482985516909157E11L,
+ -2.531972054436786351403749276956707260499E11L,
+ -6.170200796658926701311867484296426831687E10L,
+ -9.211477458528156048231908798456365081135E9L,
+ -8.251806236175037114064561038908691305583E8L,
+ -4.147886355917831049939930101151160447495E7L,
+ -1.010851868928346082547075956946476932162E6L,
+ -8.333374463411801009783402800801201603736E3L
+};
+#define NRD3 9
+static const long double RD3[NRD3 + 1] =
+{
+ -5.216713843111675050627304523368029262450E11L,
+ -8.014292925418308759369583419234079164391E11L,
+ -5.180106858220030014546267824392678611990E11L,
+ -1.830406975497439003897734969120997840011E11L,
+ -3.845274631904879621945745960119924118925E10L,
+ -4.891033385370523863288908070309417710903E9L,
+ -3.670172254411328640353855768698287474282E8L,
+ -1.505316381525727713026364396635522516989E7L,
+ -2.856327162923716881454613540575964890347E5L,
+ -1.622140448015769906847567212766206894547E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+2.5) = log gamma(2.5) + x P(x)/Q(x)
+ -0.125 <= x <= 0.25
+ 2.375 <= x+2.5 <= 2.75 */
+static const long double lgam2r5a = 2.8466796875E-1L;
+static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
+#define NRN2r5 8
+static const long double RN2r5[NRN2r5 + 1] =
+{
+ -4.676454313888335499356699817678862233205E9L,
+ -9.361888347911187924389905984624216340639E9L,
+ -7.695353600835685037920815799526540237703E9L,
+ -3.364370100981509060441853085968900734521E9L,
+ -8.449902011848163568670361316804900559863E8L,
+ -1.225249050950801905108001246436783022179E8L,
+ -9.732972931077110161639900388121650470926E6L,
+ -3.695711763932153505623248207576425983573E5L,
+ -4.717341584067827676530426007495274711306E3L
+};
+#define NRD2r5 8
+static const long double RD2r5[NRD2r5 + 1] =
+{
+ -6.650657966618993679456019224416926875619E9L,
+ -1.099511409330635807899718829033488771623E10L,
+ -7.482546968307837168164311101447116903148E9L,
+ -2.702967190056506495988922973755870557217E9L,
+ -5.570008176482922704972943389590409280950E8L,
+ -6.536934032192792470926310043166993233231E7L,
+ -4.101991193844953082400035444146067511725E6L,
+ -1.174082735875715802334430481065526664020E5L,
+ -9.932840389994157592102947657277692978511E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+2) = x P(x)/Q(x)
+ -0.125 <= x <= +0.375
+ 1.875 <= x+2 <= 2.375
+ Peak relative error 4.6e-36 */
+#define NRN2 9
+static const long double RN2[NRN2 + 1] =
+{
+ -3.716661929737318153526921358113793421524E9L,
+ -1.138816715030710406922819131397532331321E10L,
+ -1.421017419363526524544402598734013569950E10L,
+ -9.510432842542519665483662502132010331451E9L,
+ -3.747528562099410197957514973274474767329E9L,
+ -8.923565763363912474488712255317033616626E8L,
+ -1.261396653700237624185350402781338231697E8L,
+ -9.918402520255661797735331317081425749014E6L,
+ -3.753996255897143855113273724233104768831E5L,
+ -4.778761333044147141559311805999540765612E3L
+};
+#define NRD2 9
+static const long double RD2[NRD2 + 1] =
+{
+ -8.790916836764308497770359421351673950111E9L,
+ -2.023108608053212516399197678553737477486E10L,
+ -1.958067901852022239294231785363504458367E10L,
+ -1.035515043621003101254252481625188704529E10L,
+ -3.253884432621336737640841276619272224476E9L,
+ -6.186383531162456814954947669274235815544E8L,
+ -6.932557847749518463038934953605969951466E7L,
+ -4.240731768287359608773351626528479703758E6L,
+ -1.197343995089189188078944689846348116630E5L,
+ -1.004622911670588064824904487064114090920E3L
+/* 1.0E0 */
+};
+
+
+/* log gamma(x+1.75) = log gamma(1.75) + x P(x)/Q(x)
+ -0.125 <= x <= +0.125
+ 1.625 <= x+1.75 <= 1.875
+ Peak relative error 9.2e-37 */
+static const long double lgam1r75a = -8.441162109375E-2L;
+static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
+#define NRN1r75 8
+static const long double RN1r75[NRN1r75 + 1] =
+{
+ -5.221061693929833937710891646275798251513E7L,
+ -2.052466337474314812817883030472496436993E8L,
+ -2.952718275974940270675670705084125640069E8L,
+ -2.132294039648116684922965964126389017840E8L,
+ -8.554103077186505960591321962207519908489E7L,
+ -1.940250901348870867323943119132071960050E7L,
+ -2.379394147112756860769336400290402208435E6L,
+ -1.384060879999526222029386539622255797389E5L,
+ -2.698453601378319296159355612094598695530E3L
+};
+#define NRD1r75 8
+static const long double RD1r75[NRD1r75 + 1] =
+{
+ -2.109754689501705828789976311354395393605E8L,
+ -5.036651829232895725959911504899241062286E8L,
+ -4.954234699418689764943486770327295098084E8L,
+ -2.589558042412676610775157783898195339410E8L,
+ -7.731476117252958268044969614034776883031E7L,
+ -1.316721702252481296030801191240867486965E7L,
+ -1.201296501404876774861190604303728810836E6L,
+ -5.007966406976106636109459072523610273928E4L,
+ -6.155817990560743422008969155276229018209E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+x0) = y0 + x^2 P(x)/Q(x)
+ -0.0867 <= x <= +0.1634
+ 1.374932... <= x+x0 <= 1.625032...
+ Peak relative error 4.0e-36 */
+static const long double x0a = 1.4616241455078125L;
+static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
+static const long double y0a = -1.21490478515625E-1L;
+static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
+#define NRN1r5 8
+static const long double RN1r5[NRN1r5 + 1] =
+{
+ 6.827103657233705798067415468881313128066E5L,
+ 1.910041815932269464714909706705242148108E6L,
+ 2.194344176925978377083808566251427771951E6L,
+ 1.332921400100891472195055269688876427962E6L,
+ 4.589080973377307211815655093824787123508E5L,
+ 8.900334161263456942727083580232613796141E4L,
+ 9.053840838306019753209127312097612455236E3L,
+ 4.053367147553353374151852319743594873771E2L,
+ 5.040631576303952022968949605613514584950E0L
+};
+#define NRD1r5 8
+static const long double RD1r5[NRD1r5 + 1] =
+{
+ 1.411036368843183477558773688484699813355E6L,
+ 4.378121767236251950226362443134306184849E6L,
+ 5.682322855631723455425929877581697918168E6L,
+ 3.999065731556977782435009349967042222375E6L,
+ 1.653651390456781293163585493620758410333E6L,
+ 4.067774359067489605179546964969435858311E5L,
+ 5.741463295366557346748361781768833633256E4L,
+ 4.226404539738182992856094681115746692030E3L,
+ 1.316980975410327975566999780608618774469E2L,
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+1.25) = log gamma(1.25) + x P(x)/Q(x)
+ -.125 <= x <= +.125
+ 1.125 <= x+1.25 <= 1.375
+ Peak relative error = 4.9e-36 */
+static const long double lgam1r25a = -9.82818603515625E-2L;
+static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
+#define NRN1r25 9
+static const long double RN1r25[NRN1r25 + 1] =
+{
+ -9.054787275312026472896002240379580536760E4L,
+ -8.685076892989927640126560802094680794471E4L,
+ 2.797898965448019916967849727279076547109E5L,
+ 6.175520827134342734546868356396008898299E5L,
+ 5.179626599589134831538516906517372619641E5L,
+ 2.253076616239043944538380039205558242161E5L,
+ 5.312653119599957228630544772499197307195E4L,
+ 6.434329437514083776052669599834938898255E3L,
+ 3.385414416983114598582554037612347549220E2L,
+ 4.907821957946273805080625052510832015792E0L
+};
+#define NRD1r25 8
+static const long double RD1r25[NRD1r25 + 1] =
+{
+ 3.980939377333448005389084785896660309000E5L,
+ 1.429634893085231519692365775184490465542E6L,
+ 2.145438946455476062850151428438668234336E6L,
+ 1.743786661358280837020848127465970357893E6L,
+ 8.316364251289743923178092656080441655273E5L,
+ 2.355732939106812496699621491135458324294E5L,
+ 3.822267399625696880571810137601310855419E4L,
+ 3.228463206479133236028576845538387620856E3L,
+ 1.152133170470059555646301189220117965514E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ 0.0 <= x <= +0.125
+ 1.0 <= x+1 <= 1.125
+ Peak relative error 1.1e-35 */
+#define NRN1 8
+static const long double RN1[NRN1 + 1] =
+{
+ -9.987560186094800756471055681088744738818E3L,
+ -2.506039379419574361949680225279376329742E4L,
+ -1.386770737662176516403363873617457652991E4L,
+ 1.439445846078103202928677244188837130744E4L,
+ 2.159612048879650471489449668295139990693E4L,
+ 1.047439813638144485276023138173676047079E4L,
+ 2.250316398054332592560412486630769139961E3L,
+ 1.958510425467720733041971651126443864041E2L,
+ 4.516830313569454663374271993200291219855E0L
+};
+#define NRD1 7
+static const long double RD1[NRD1 + 1] =
+{
+ 1.730299573175751778863269333703788214547E4L,
+ 6.807080914851328611903744668028014678148E4L,
+ 1.090071629101496938655806063184092302439E5L,
+ 9.124354356415154289343303999616003884080E4L,
+ 4.262071638655772404431164427024003253954E4L,
+ 1.096981664067373953673982635805821283581E4L,
+ 1.431229503796575892151252708527595787588E3L,
+ 7.734110684303689320830401788262295992921E1L
+ /* 1.0E0 */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ -0.125 <= x <= 0
+ 0.875 <= x+1 <= 1.0
+ Peak relative error 7.0e-37 */
+#define NRNr9 8
+static const long double RNr9[NRNr9 + 1] =
+{
+ 4.441379198241760069548832023257571176884E5L,
+ 1.273072988367176540909122090089580368732E6L,
+ 9.732422305818501557502584486510048387724E5L,
+ -5.040539994443998275271644292272870348684E5L,
+ -1.208719055525609446357448132109723786736E6L,
+ -7.434275365370936547146540554419058907156E5L,
+ -2.075642969983377738209203358199008185741E5L,
+ -2.565534860781128618589288075109372218042E4L,
+ -1.032901669542994124131223797515913955938E3L,
+};
+#define NRDr9 8
+static const long double RDr9[NRDr9 + 1] =
+{
+ -7.694488331323118759486182246005193998007E5L,
+ -3.301918855321234414232308938454112213751E6L,
+ -5.856830900232338906742924836032279404702E6L,
+ -5.540672519616151584486240871424021377540E6L,
+ -3.006530901041386626148342989181721176919E6L,
+ -9.350378280513062139466966374330795935163E5L,
+ -1.566179100031063346901755685375732739511E5L,
+ -1.205016539620260779274902967231510804992E4L,
+ -2.724583156305709733221564484006088794284E2L
+/* 1.0E0 */
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+long double
+__ieee754_lgammal_r (long double x, int *signgamp)
+{
+ long double p, q, w, z, nx;
+ int i, nn;
+
+ *signgamp = 1;
+
+ if (! isfinite (x))
+ return x * x;
+
+ if (x == 0)
+ {
+ if (signbit (x))
+ *signgamp = -1;
+ }
+
+ if (x < 0)
+ {
+ if (x < -2 && x > -48)
+ return __lgamma_negl (x, signgamp);
+ q = -x;
+ p = __floorl (q);
+ if (p == q)
+ return (one / fabsl (p - p));
+ long double halfp = p * 0.5L;
+ if (halfp == __floorl (halfp))
+ *signgamp = -1;
+ else
+ *signgamp = 1;
+ if (q < 0x1p-120L)
+ return -__logl (q);
+ z = q - p;
+ if (z > 0.5L)
+ {
+ p += 1;
+ z = p - q;
+ }
+ z = q * __sinl (PIL * z);
+ w = __ieee754_lgammal_r (q, &i);
+ z = __logl (PIL / z) - w;
+ return (z);
+ }
+
+ if (x < 13.5L)
+ {
+ p = 0;
+ nx = __floorl (x + 0.5L);
+ nn = nx;
+ switch (nn)
+ {
+ case 0:
+ /* log gamma (x + 1) = log(x) + log gamma(x) */
+ if (x < 0x1p-120L)
+ return -__logl (x);
+ else if (x <= 0.125)
+ {
+ p = x * neval (x, RN1, NRN1) / deval (x, RD1, NRD1);
+ }
+ else if (x <= 0.375)
+ {
+ z = x - 0.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else if (x <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ z = x - 1;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ p = p - __logl (x);
+ break;
+
+ case 1:
+ if (x < 0.875L)
+ {
+ if (x <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75)
+ / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ z = x - 1;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ p = p - __logl (x);
+ }
+ else if (x < 1)
+ {
+ z = x - 1;
+ p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
+ }
+ else if (x == 1)
+ p = 0;
+ else if (x <= 1.125L)
+ {
+ z = x - 1;
+ p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
+ }
+ else if (x <= 1.375)
+ {
+ z = x - 1.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else
+ {
+ /* 1.375 <= x+x0 <= 1.625 */
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ break;
+
+ case 2:
+ if (x < 1.625L)
+ {
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x < 1.875L)
+ {
+ z = x - 1.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else if (x == 2)
+ p = 0;
+ else if (x < 2.375L)
+ {
+ z = x - 2;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ else
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ break;
+
+ case 3:
+ if (x < 2.75)
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ else
+ {
+ z = x - 3;
+ p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
+ p += lgam3b;
+ p += lgam3a;
+ }
+ break;
+
+ case 4:
+ z = x - 4;
+ p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
+ p += lgam4b;
+ p += lgam4a;
+ break;
+
+ case 5:
+ z = x - 5;
+ p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
+ p += lgam5b;
+ p += lgam5a;
+ break;
+
+ case 6:
+ z = x - 6;
+ p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
+ p += lgam6b;
+ p += lgam6a;
+ break;
+
+ case 7:
+ z = x - 7;
+ p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
+ p += lgam7b;
+ p += lgam7a;
+ break;
+
+ case 8:
+ z = x - 8;
+ p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
+ p += lgam8b;
+ p += lgam8a;
+ break;
+
+ case 9:
+ z = x - 9;
+ p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
+ p += lgam9b;
+ p += lgam9a;
+ break;
+
+ case 10:
+ z = x - 10;
+ p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
+ p += lgam10b;
+ p += lgam10a;
+ break;
+
+ case 11:
+ z = x - 11;
+ p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
+ p += lgam11b;
+ p += lgam11a;
+ break;
+
+ case 12:
+ z = x - 12;
+ p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
+ p += lgam12b;
+ p += lgam12a;
+ break;
+
+ case 13:
+ z = x - 13;
+ p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
+ p += lgam13b;
+ p += lgam13a;
+ break;
+ }
+ return p;
+ }
+
+ if (x > MAXLGM)
+ return (*signgamp * huge * huge);
+
+ if (x > 0x1p120L)
+ return x * (__logl (x) - 1);
+ q = ls2pi - x;
+ q = (x - 0.5L) * __logl (x) + q;
+ if (x > 1.0e18L)
+ return (q);
+
+ p = 1 / (x * x);
+ q += neval (p, RASY, NRASY) / x;
+ return (q);
+}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
index 7477791b77..62e3214ca4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
@@ -189,7 +189,7 @@ __ieee754_log10l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log10l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
index e39eaba72a..1f8b6e9d7f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
@@ -183,7 +183,7 @@ __ieee754_log2l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log2l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index 14acfc2db7..c44feca65b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -58,6 +58,7 @@
License along with this library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
#include <math_private.h>
/* log(1+x) = x - .5 x^2 + x^3 l(x)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
index 90340e890e..f59ad4e113 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
@@ -66,6 +66,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double bp[] = {
1.0L,
@@ -148,7 +149,7 @@ long double
__ieee754_powl (long double x, long double y)
{
long double z, ax, z_h, z_l, p_h, p_l;
- long double y1, t1, t2, r, s, t, u, v, w;
+ long double y1, t1, t2, r, s, sgn, t, u, v, w;
long double s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
uint32_t ix, iy;
@@ -165,11 +166,11 @@ __ieee754_powl (long double x, long double y)
iy = hy & 0x7fffffff;
/* y==zero: x**0 = 1 */
- if ((iy | ly) == 0)
+ if ((iy | ly) == 0 && !issignaling (x))
return one;
/* 1.0**y = 1; -1.0**+-Inf = 1 */
- if (x == one)
+ if (x == one && !issignaling (y))
return one;
if (x == -1.0L && ((iy - 0x7ff00000) | ly) == 0)
return one;
@@ -233,7 +234,7 @@ __ieee754_powl (long double x, long double y)
if (hy == 0x3fe00000)
{ /* y is 0.5 */
if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrtl (x);
+ return sqrtl (x);
}
}
}
@@ -260,9 +261,14 @@ __ieee754_powl (long double x, long double y)
}
/* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | yisint) == 0)
return (x - x) / (x - x);
+ /* sgn (sign of result -ve**odd) = -1 else = 1 */
+ sgn = one;
+ if (((((uint32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
+ sgn = -one; /* (-ve)**(odd int) */
+
/* |y| is huge.
2^-16495 = 1/2 of smallest representable value.
If (1 - 1/131072)^y underflows, y > 1.4986e9 */
@@ -272,15 +278,15 @@ __ieee754_powl (long double x, long double y)
if (iy > 0x47d654b0)
{
if (ix <= 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix >= 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
/* over/underflow if x is not close to one */
if (ix < 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix > 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
ay = y > 0 ? y : -y;
@@ -351,11 +357,6 @@ __ieee754_powl (long double x, long double y)
t1 = ldbl_high (t1);
t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
- /* s (sign of result -ve**odd) = -1 else = 1 */
- s = one;
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
- s = -one; /* (-ve)**(odd int) */
-
/* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
y1 = ldbl_high (y);
p_l = (y - y1) * t1 + y * t2;
@@ -367,22 +368,22 @@ __ieee754_powl (long double x, long double y)
{
/* if z > 16384 */
if (((j - 0x40d00000) | lj) != 0)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
else
{
if (p_l + ovt > z - p_h)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
}
}
else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */
{
/* z < -16495 */
if (((j - 0xc0d01bc0) | lj) != 0)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
else
{
if (p_l <= z - p_h)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
}
}
/* compute 2**(p_h+p_l) */
@@ -408,8 +409,8 @@ __ieee754_powl (long double x, long double y)
t1 = z - t * u / v;
r = (z * t1) / (t1 - two) - (w + z * w);
z = one - (r - z);
- z = __scalbnl (z, n);
- math_check_force_underflow_nonneg (z);
- return s * z;
+ z = __scalbnl (sgn * z, n);
+ math_check_force_underflow (z);
+ return z;
}
strong_alias (__ieee754_powl, __powl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
index cc2b235534..07cb1e8b4c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -200,7 +200,7 @@ int32_t __ieee754_rem_pio2l(long double x, long double *y)
double tx[8];
int exp;
int64_t n, ix, hx, ixd;
- u_int64_t lxd;
+ uint64_t lxd;
double xhi;
xhi = ldbl_high (x);
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
index 800416f29a..efa83bdab7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
@@ -31,7 +31,7 @@ long double
__ieee754_remainderl(long double x, long double p)
{
int64_t hx,hp;
- u_int64_t sx,lx,lp;
+ uint64_t sx,lx,lp;
long double p_half;
double xhi, xlo, phi, plo;
@@ -42,8 +42,14 @@ __ieee754_remainderl(long double x, long double p)
EXTRACT_WORDS64 (hp, phi);
EXTRACT_WORDS64 (lp, plo);
sx = hx&0x8000000000000000ULL;
+ lp ^= hp & 0x8000000000000000ULL;
hp &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
+ if (lp == 0x8000000000000000ULL)
+ lp = 0;
+ if (lx == 0x8000000000000000ULL)
+ lx = 0;
/* purge off exception values */
if(hp==0) return (x*p)/(x*p); /* p = 0 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
index 67d9d24ce7..f869fb068c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, shuge = 1.0e307;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
index 96845fe5f8..28b208883d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -91,11 +91,9 @@ long double __ieee754_sqrtl(long double x)
return c.x * i;
}
else {
- if (k>=INT64_C(0x7ff0000000000000)) {
- if (a.i[0] == INT64_C(0xfff0000000000000))
- return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */
- return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
- }
+ if (k>=INT64_C(0x7ff0000000000000))
+ /* sqrt (-Inf) = NaN, sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
+ return x * x + x;
if (x == 0) return x;
if (x < 0) return (big1-big1)/(big-big);
return tm256*__ieee754_sqrtl(x*t512);
diff --git a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
index b631f90a44..e4d9887b6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
index c07a6def4b..8017d9846f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ieee754.h
+++ b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
new file mode 100644
index 0000000000..bee080bd29
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
@@ -0,0 +1,5 @@
+#include_next <bits/iscanonical.h>
+
+#ifndef _ISOMAC
+libm_hidden_proto (__iscanonicall)
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
index 2a3189ad36..e40c53cad3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -86,7 +86,7 @@ __kernel_cosl(long double x, long double y)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
index 4e43c8622e..ba95337c31 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
index 44da02b0f3..46d1d7b52a 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
@@ -82,12 +83,12 @@ __kernel_sinl(long double x, long double y, int iy)
{
long double h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
double xhi, hhi;
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
index 3c1bf32af9..3927fca25c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
@@ -57,9 +57,11 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
+
static const long double
one = 1.0L,
pio4hi = 7.8539816339744830961566084581987569936977E-1L,
diff --git a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
index 4f550ef47c..0e265ff5b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,12 @@
bits (106 for long double) and an integral power of two (MPN
frexpl). */
+
+/* When signs differ, the actual value is the difference between the
+ significant double and the less significant double. Sometimes a
+ bit can be lost when we borrow from the significant mantissa. */
+#define EXTRA_INTERNAL_PRECISION (7)
+
mp_size_t
__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
@@ -45,10 +51,15 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;
hi = ((long long) u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;
+ /* Hold 7 extra bits of precision in the mantissa. This allows
+ the normalizing shifts below to prevent losing precision when
+ the signs differ and the exponents are sufficiently far apart. */
+ lo <<= EXTRA_INTERNAL_PRECISION;
+
/* If the lower double is not a denormal or zero then set the hidden
53rd bit. */
if (u.d[1].ieee.exponent != 0)
- lo |= 1ULL << 52;
+ lo |= 1ULL << (52 + EXTRA_INTERNAL_PRECISION);
else
lo = lo << 1;
@@ -72,12 +83,12 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
if (u.d[0].ieee.negative != u.d[1].ieee.negative
&& lo != 0)
{
- lo = (1ULL << 53) - lo;
+ lo = (1ULL << (53 + EXTRA_INTERNAL_PRECISION)) - lo;
if (hi == 0)
{
/* we have a borrow from the hidden bit, so shift left 1. */
- hi = 0x0ffffffffffffeLL | (lo >> 51);
- lo = 0x1fffffffffffffLL & (lo << 1);
+ hi = 0x000ffffffffffffeLL | (lo >> (52 + EXTRA_INTERNAL_PRECISION));
+ lo = 0x0fffffffffffffffLL & (lo << 1);
(*expt)--;
}
else
@@ -85,14 +96,14 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
}
#if BITS_PER_MP_LIMB == 32
/* Combine the mantissas to be contiguous. */
- res_ptr[0] = lo;
- res_ptr[1] = (hi << (53 - 32)) | (lo >> 32);
+ res_ptr[0] = lo >> EXTRA_INTERNAL_PRECISION;
+ res_ptr[1] = (hi << (53 - 32)) | (lo >> (32 + EXTRA_INTERNAL_PRECISION));
res_ptr[2] = hi >> 11;
res_ptr[3] = hi >> (32 + 11);
#define N 4
#elif BITS_PER_MP_LIMB == 64
/* Combine the two mantissas to be contiguous. */
- res_ptr[0] = (hi << 53) | lo;
+ res_ptr[0] = (hi << 53) | (lo >> EXTRA_INTERNAL_PRECISION);
res_ptr[1] = hi >> 11;
#define N 2
#else
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
index c2a5cd29b6..e00f7b9889 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
index c5fa81be8e..dc0e8dd723 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
index d827112446..653407597f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
@@ -1,5 +1,5 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128ibm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* NaN payload handling or ldbl-128ibm.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ibm_extended_long_double u; \
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
index 051352f9f7..ccb646620e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
@@ -1,6 +1,23 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_LDBL_H_
+#define _MATH_LDBL_H_ 1
#include <ieee754.h>
#include <stdint.h>
@@ -230,3 +247,44 @@ ldbl_nearbyint (double a)
}
return a;
}
+
+/* Canonicalize a result from an integer rounding function, in any
+ rounding mode. *A and *AA are finite and integers, with *A being
+ nonzero; if the result is not already canonical, *AA is plus or
+ minus a power of 2 that does not exceed the least set bit in
+ *A. */
+static inline void
+ldbl_canonicalize_int (double *a, double *aa)
+{
+ /* Previously we used EXTRACT_WORDS64 from math_private.h, but in order
+ to avoid including internal headers we duplicate that code here. */
+ uint64_t ax, aax;
+ union { double value; uint64_t word; } extractor;
+ extractor.value = *a;
+ ax = extractor.word;
+ extractor.value = *aa;
+ aax = extractor.word;
+
+ int expdiff = ((ax >> 52) & 0x7ff) - ((aax >> 52) & 0x7ff);
+ if (expdiff <= 53)
+ {
+ if (expdiff == 53)
+ {
+ /* Half way between two double values; noncanonical iff the
+ low bit of A's mantissa is 1. */
+ if ((ax & 1) != 0)
+ {
+ *a += 2 * *aa;
+ *aa = -*aa;
+ }
+ }
+ else
+ {
+ /* The sum can be represented in a single double. */
+ *a += *aa;
+ *aa = 0;
+ }
+ }
+}
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index 42f5e6a02d..ff9f6496bd 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
index 06be1c52d4..2908e8a819 100644
--- a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
index aa9a9ba213..d4977e5414 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
@@ -28,6 +28,7 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double
@@ -53,10 +54,10 @@ long double __asinhl(long double x)
w = __ieee754_logl(fabsl(x))+ln2;
} else if (ix>0x4000000000000000LL) { /* 2**56 >= |x| > 2.0 */
t = fabs(x);
- w = __ieee754_logl(2.0*t+one/(__ieee754_sqrtl(x*x+one)+t));
+ w = __ieee754_logl(2.0*t+one/(sqrtl(x*x+one)+t));
} else { /* 2.0 >= |x| >= 2**-56 */
t = x*x;
- w =__log1pl(fabsl(x)+t/(one+__ieee754_sqrtl(one+t)));
+ w =__log1pl(fabsl(x)+t/(one+sqrtl(one+t)));
}
if(hx>0) return w; else return -w;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index 0560d820ae..32cf36c65d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -62,6 +62,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
/* arctan(k/8), k = 0, ..., 82 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 010a671dce..317d238057 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -1,6 +1,102 @@
-/* Looks like we can use ieee854 s_cbrtl.c as is for IBM extended format. */
+/* Implementation of cbrtl. IBM Extended Precision version.
+ Cephes Math Library Release 2.2: January, 1991
+ Copyright 1984, 1991 by Stephen L. Moshier
+ Adapted for glibc October, 2001.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
+#include <math.h>
+#include <math_private.h>
+
+static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
+static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
+static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
+static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
+
+
+long double
+__cbrtl (long double x)
+{
+ int e, rem, sign;
+ long double z;
+
+ if (!isfinite (x))
+ return x + x;
+
+ if (x == 0)
+ return (x);
+
+ if (x > 0)
+ sign = 1;
+ else
+ {
+ sign = -1;
+ x = -x;
+ }
+
+ z = x;
+ /* extract power of 2, leaving mantissa between 0.5 and 1 */
+ x = __frexpl (x, &e);
+
+ /* Approximate cube root of number between .5 and 1,
+ peak relative error = 1.2e-6 */
+ x = ((((1.3584464340920900529734e-1L * x
+ - 6.3986917220457538402318e-1L) * x
+ + 1.2875551670318751538055e0L) * x
+ - 1.4897083391357284957891e0L) * x
+ + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L;
+
+ /* exponent divided by 3 */
+ if (e >= 0)
+ {
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2;
+ else if (rem == 2)
+ x *= CBRT4;
+ }
+ else
+ { /* argument less than 1 */
+ e = -e;
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2I;
+ else if (rem == 2)
+ x *= CBRT4I;
+ e = -e;
+ }
+
+ /* multiply by power of 2 */
+ x = __ldexpl (x, e);
+
+ /* Newton iteration */
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+
+ if (sign < 0)
+ x = -x;
+ return (x);
+}
+
long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
index ac649b7215..7dcff021c4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
@@ -1,6 +1,6 @@
/* Ceil (round to +inf) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,43 +36,26 @@ __ceill (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. ceill must
- round towards +Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
+ hi = __ceil (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_daddl.c b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
new file mode 100644
index 0000000000..28b7e06ace
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__daddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
new file mode 100644
index 0000000000..6bbbbcf09d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__ddivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dmull.c b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
new file mode 100644
index 0000000000..7b75b2b0f1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__dmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
new file mode 100644
index 0000000000..e0e80f26a4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__dsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
index 7b761b0afa..5302fee522 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@@ -105,6 +105,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
#include <fix-int-fp-convert-zero.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 66f75e1c80..42d57c6eec 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -106,8 +106,8 @@ __expm1l (long double x)
/* Infinity (which must be negative infinity). */
if (((ix - 0x7ff00000) | lx) == 0)
return -1.0L;
- /* NaN. No invalid exception. */
- return x;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
index c801c97065..54bf9b9cc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
long double __fabsl(long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_faddl.c b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
new file mode 100644
index 0000000000..55a391885c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__faddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
new file mode 100644
index 0000000000..dd34c05502
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fdivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
index 912230870a..4aae5ae608 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,36 +36,26 @@ __floorl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo += -1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
+ hi = __floor (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __floor (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index eb3ee3cfb8..e72a3e4d59 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
@@ -17,25 +17,240 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <fenv.h>
+#include <float.h>
#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
+#include <mul_split.h>
+#include <stdlib.h>
+
+/* Calculate X + Y exactly and store the result in *HI + *LO. It is
+ given that |X| >= |Y| and the values are small enough that no
+ overflow occurs. */
+
+static void
+add_split (double *hi, double *lo, double x, double y)
+{
+ /* Apply Dekker's algorithm. */
+ *hi = x + y;
+ *lo = (x - *hi) + y;
+}
+
+/* Value with extended range, used in intermediate computations. */
+typedef struct
+{
+ /* Value in [0.5, 1), as from frexp, or 0. */
+ double val;
+ /* Exponent of power of 2 it is multiplied by, or 0 for zero. */
+ int exp;
+} ext_val;
+
+/* Store D as an ext_val value. */
+
+static void
+store_ext_val (ext_val *v, double d)
+{
+ v->val = __frexp (d, &v->exp);
+}
+
+/* Store X * Y as ext_val values *V0 and *V1. */
+
+static void
+mul_ext_val (ext_val *v0, ext_val *v1, double x, double y)
+{
+ int xexp, yexp;
+ x = __frexp (x, &xexp);
+ y = __frexp (y, &yexp);
+ double hi, lo;
+ mul_split (&hi, &lo, x, y);
+ store_ext_val (v0, hi);
+ if (hi != 0)
+ v0->exp += xexp + yexp;
+ store_ext_val (v1, lo);
+ if (lo != 0)
+ v1->exp += xexp + yexp;
+}
+
+/* Compare absolute values of ext_val values pointed to by P and Q for
+ qsort. */
+
+static int
+compare (const void *p, const void *q)
+{
+ const ext_val *pe = p;
+ const ext_val *qe = q;
+ if (pe->val == 0)
+ return qe->val == 0 ? 0 : -1;
+ else if (qe->val == 0)
+ return 1;
+ else if (pe->exp < qe->exp)
+ return -1;
+ else if (pe->exp > qe->exp)
+ return 1;
+ else
+ {
+ double pd = fabs (pe->val);
+ double qd = fabs (qe->val);
+ if (pd < qd)
+ return -1;
+ else if (pd == qd)
+ return 0;
+ else
+ return 1;
+ }
+}
+
+/* Calculate *X + *Y exactly, storing the high part in *X (rounded to
+ nearest) and the low part in *Y. It is given that |X| >= |Y|. */
+
+static void
+add_split_ext (ext_val *x, ext_val *y)
+{
+ int xexp = x->exp, yexp = y->exp;
+ if (y->val == 0 || xexp - yexp > 53)
+ return;
+ double hi = x->val;
+ double lo = __scalbn (y->val, yexp - xexp);
+ add_split (&hi, &lo, hi, lo);
+ store_ext_val (x, hi);
+ if (hi != 0)
+ x->exp += xexp;
+ store_ext_val (y, lo);
+ if (lo != 0)
+ y->exp += xexp;
+}
long double
__fmal (long double x, long double y, long double z)
{
- /* An IBM long double 128 is really just 2 IEEE64 doubles, and in
- * the case of inf/nan only the first double counts. So we use the
- * (double) cast to avoid any data movement. */
- if ((isfinite ((double)x) && isfinite ((double)y)) && isinf ((double)z))
- return (z);
-
- /* If z is zero and x are y are nonzero, compute the result
- as x * y to avoid the wrong sign of a zero result if x * y
- underflows to 0. */
- if (z == 0 && x != 0 && y != 0)
- return x * y;
-
- return (x * y) + z;
+ double xhi, xlo, yhi, ylo, zhi, zlo;
+ int64_t hx, hy, hz;
+ int xexp, yexp, zexp;
+ double scale_val;
+ int scale_exp;
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ xexp = (hx & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+ yexp = (hy & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (z, &zhi, &zlo);
+ EXTRACT_WORDS64 (hz, zhi);
+ zexp = (hz & 0x7ff0000000000000LL) >> 52;
+
+ /* If z is Inf or NaN, but x and y are finite, avoid any exceptions
+ from computing x * y. */
+ if (zexp == 0x7ff && xexp != 0x7ff && yexp != 0x7ff)
+ return (z + x) + y;
+
+ /* If z is zero and x are y are nonzero, compute the result as x * y
+ to avoid the wrong sign of a zero result if x * y underflows to
+ 0. */
+ if (z == 0 && x != 0 && y != 0)
+ return x * y;
+
+ /* If x or y or z is Inf/NaN, or if x * y is zero, compute as x * y
+ + z. */
+ if (xexp == 0x7ff || yexp == 0x7ff || zexp == 0x7ff
+ || x == 0 || y == 0)
+ return (x * y) + z;
+
+ {
+ SET_RESTORE_ROUND (FE_TONEAREST);
+
+ ext_val vals[10];
+ store_ext_val (&vals[0], zhi);
+ store_ext_val (&vals[1], zlo);
+ mul_ext_val (&vals[2], &vals[3], xhi, yhi);
+ mul_ext_val (&vals[4], &vals[5], xhi, ylo);
+ mul_ext_val (&vals[6], &vals[7], xlo, yhi);
+ mul_ext_val (&vals[8], &vals[9], xlo, ylo);
+ qsort (vals, 10, sizeof (ext_val), compare);
+ /* Add up the values so that each element of VALS has absolute
+ value at most equal to the last set bit of the next nonzero
+ element. */
+ for (size_t i = 0; i <= 8; i++)
+ {
+ add_split_ext (&vals[i + 1], &vals[i]);
+ qsort (vals + i + 1, 9 - i, sizeof (ext_val), compare);
+ }
+ /* Add up the values in the other direction, so that each element
+ of VALS has absolute value less than 5ulp of the next
+ value. */
+ size_t dstpos = 9;
+ for (size_t i = 1; i <= 9; i++)
+ {
+ if (vals[dstpos].val == 0)
+ {
+ vals[dstpos] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ else
+ {
+ add_split_ext (&vals[dstpos], &vals[9 - i]);
+ if (vals[9 - i].val != 0)
+ {
+ if (9 - i < dstpos - 1)
+ {
+ vals[dstpos - 1] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ dstpos--;
+ }
+ }
+ }
+ /* If the result is an exact zero, it results from adding two
+ values with opposite signs; recompute in the original rounding
+ mode. */
+ if (vals[9].val == 0)
+ goto zero_out;
+ /* Adding the top three values will now give a result as accurate
+ as the underlying long double arithmetic. */
+ add_split_ext (&vals[9], &vals[8]);
+ if (compare (&vals[8], &vals[7]) < 0)
+ {
+ ext_val tmp = vals[7];
+ vals[7] = vals[8];
+ vals[8] = tmp;
+ }
+ add_split_ext (&vals[8], &vals[7]);
+ add_split_ext (&vals[9], &vals[8]);
+ if (vals[9].exp > DBL_MAX_EXP || vals[9].exp < DBL_MIN_EXP)
+ {
+ /* Overflow or underflow, with the result depending on the
+ original rounding mode, but not on the low part computed
+ here. */
+ scale_val = vals[9].val;
+ scale_exp = vals[9].exp;
+ goto scale_out;
+ }
+ double hi = __scalbn (vals[9].val, vals[9].exp);
+ double lo = __scalbn (vals[8].val, vals[8].exp);
+ /* It is possible that the low part became subnormal and was
+ rounded so that the result is no longer canonical. */
+ ldbl_canonicalize (&hi, &lo);
+ long double ret = ldbl_pack (hi, lo);
+ math_check_force_underflow (ret);
+ return ret;
+ }
+
+ scale_out:
+ scale_val = math_opt_barrier (scale_val);
+ scale_val = __scalbn (scale_val, scale_exp);
+ if (fabs (scale_val) == DBL_MAX)
+ return __copysignl (LDBL_MAX, scale_val);
+ math_check_force_underflow (scale_val);
+ return scale_val;
+
+ zero_out:;
+ double zero = 0.0;
+ zero = math_opt_barrier (zero);
+ return zero - zero;
}
#if IS_IN (libm)
long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmull.c b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
new file mode 100644
index 0000000000..d1988f168d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
index 83c3a8dc51..92c08cc995 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -44,7 +44,7 @@
int
___fpclassifyl (long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
int retval = FP_NORMAL;
double xhi, xlo;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
index 52d2d3ea90..210c5d2ed4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
@@ -47,7 +47,7 @@ long double __frexpl(long double x, int *eptr)
{
/* 0,inf,nan. */
*eptr = expon;
- return x;
+ return x + x;
}
expon = ix >> 52;
if (expon == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
new file mode 100644
index 0000000000..f3fdba33c1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpl, fromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
new file mode 100644
index 0000000000..76287c33dc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
@@ -0,0 +1,147 @@
+/* Round to integer type. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (long double x, int round, unsigned int width)
+{
+ double hi, lo;
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t hx, lx;
+ ldbl_unpack (x, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ bool negative = (hx & 0x8000000000000000ULL) != 0;
+ bool lo_negative = (lx & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ hx &= 0x7fffffffffffffffULL;
+ lx &= 0x7fffffffffffffffULL;
+ if ((hx | lx) == 0)
+ return 0;
+ int hi_exponent = hx >> (MANT_DIG - 1);
+ hi_exponent -= BIAS;
+ int exponent = hi_exponent;
+ hx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ if (hx == 0 && lx != 0 && lo_negative != negative)
+ exponent--;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+ int lo_exponent = lx >> (MANT_DIG - 1);
+ lo_exponent -= BIAS;
+
+ /* Convert the high part to integer. */
+ hx |= 1ULL << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (hi_exponent >= MANT_DIG - 1)
+ {
+ uret = hx;
+ uret <<= hi_exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (hi_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - hi_exponent);
+ half_bit = (hx & h) != 0;
+ more_bits = (hx & (h - 1)) != 0;
+ uret = hx >> (MANT_DIG - 1 - hi_exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+
+ /* Likewise, the low part. */
+ if (lx != 0)
+ {
+ uintmax_t lo_uret;
+ bool lo_half_bit, lo_more_bits;
+ lx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ lx |= 1ULL << (MANT_DIG - 1);
+ /* The high part exponent is at most 64, so the low part
+ exponent is at most 11. */
+ if (lo_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - lo_exponent);
+ lo_half_bit = (lx & h) != 0;
+ lo_more_bits = (lx & (h - 1)) != 0;
+ lo_uret = lx >> (MANT_DIG - 1 - lo_exponent);
+ }
+ else
+ {
+ lo_uret = 0;
+ lo_half_bit = false;
+ lo_more_bits = true;
+ }
+ if (lo_negative == negative)
+ {
+ uret += lo_uret;
+ half_bit |= lo_half_bit;
+ more_bits |= lo_more_bits;
+ }
+ else
+ {
+ uret -= lo_uret;
+ if (lo_half_bit)
+ {
+ uret--;
+ half_bit = true;
+ }
+ if (lo_more_bits && !more_bits)
+ {
+ if (half_bit)
+ {
+ half_bit = false;
+ more_bits = true;
+ }
+ else
+ {
+ uret--;
+ half_bit = true;
+ more_bits = true;
+ }
+ }
+ }
+ }
+
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
new file mode 100644
index 0000000000..9477cc2ea7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpxl, fromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
new file mode 100644
index 0000000000..aa6662de05
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
new file mode 100644
index 0000000000..5b24955353
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
@@ -0,0 +1,35 @@
+/* Get NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+long double
+__getpayloadl (const long double *x)
+{
+ double xhi = ldbl_high (*x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, xhi);
+ ix &= 0x7ffffffffffffULL;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0L;
+ return (long double) ix;
+}
+weak_alias (__getpayloadl, getpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
new file mode 100644
index 0000000000..91ce417992
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
@@ -0,0 +1,60 @@
+/* Test whether long double value is canonical. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+__iscanonicall (long double x)
+{
+ double xhi, xlo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ int64_t ix = hx & 0x7fffffffffffffffULL;
+ int64_t iy = lx & 0x7fffffffffffffffULL;
+ int hexp = (ix & 0x7ff0000000000000LL) >> 52;
+ int lexp = (iy & 0x7ff0000000000000LL) >> 52;
+
+ if (iy == 0)
+ /* Low part 0 is always OK. */
+ return 1;
+
+ if (hexp == 0x7ff)
+ /* If a NaN, the low part does not matter. If an infinity, the
+ low part must be 0, in which case we have already returned. */
+ return ix != 0x7ff0000000000000LL;
+
+ /* The high part is finite and the low part is nonzero. There must
+ be sufficient difference between the exponents. */
+ bool low_p2;
+ if (lexp == 0)
+ {
+ /* Adjust the exponent for subnormal low part. */
+ lexp = 12 - __builtin_clzll (iy);
+ low_p2 = iy == (1LL << (51 + lexp));
+ }
+ else
+ low_p2 = (iy & 0xfffffffffffffLL) == 0;
+ int expdiff = hexp - lexp;
+ return expdiff > 53 || (expdiff == 53 && low_p2 && (ix & 1) == 0);
+}
+libm_hidden_def (__iscanonicall)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
index 091513908b..126abce2de 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingl (long double x)
@@ -29,7 +30,7 @@ __issignalingl (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (xi, xhi);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
# error untested
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
index 860ede1e0b..9d4535103e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
index 9fba087d5b..de6a7b5be2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
index 743693bfd6..e499c9f604 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
@@ -131,8 +131,8 @@ __log1pl (long double xm1)
/* Test for NaN or infinity input. */
xhi = ldbl_high (xm1);
EXTRACT_WORDS (hx, lx, xhi);
- if (hx >= 0x7ff00000)
- return xm1;
+ if ((hx & 0x7fffffff) >= 0x7ff00000)
+ return xm1 + xm1 * xm1;
/* log1p(+- 0) = +- 0. */
if (((hx & 0x7fffffff) | lx) == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
index 988de70c5a..05fe7fefdf 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -84,7 +85,7 @@ __lrintl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -105,27 +106,27 @@ __lrintl (long double x)
return res;
if (xh < 0.0)
- res -= 1;
+ res -= 1UL;
else
- res += 1;
+ res += 1UL;
break;
case FE_TOWARDZERO:
if (res > 0 && (xh < 0.0 || (xh == 0.0 && xl < 0.0)))
- res -= 1;
+ res -= 1UL;
else if (res < 0 && (xh > 0.0 || (xh == 0.0 && xl > 0.0)))
- res += 1;
+ res += 1UL;
return res;
break;
case FE_UPWARD:
if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- res += 1;
+ res += 1UL;
break;
case FE_DOWNWARD:
if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- res -= 1;
+ res -= 1UL;
break;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
index aa48f680d4..bc8dda4c1d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -80,7 +81,7 @@ __lroundl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -92,21 +93,21 @@ __lroundl (long double x)
hi = res;
if (xh > 0.5)
{
- res += 1;
+ res += 1UL;
}
else if (xh == 0.5)
{
if (xl > 0.0 || (xl == 0.0 && res >= 0))
- res += 1;
+ res += 1UL;
}
else if (-xh > 0.5)
{
- res -= 1;
+ res -= 1UL;
}
else if (-xh == 0.5)
{
if (xl < 0.0 || (xl == 0.0 && res <= 0))
- res -= 1;
+ res -= 1UL;
}
if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
index 260cc3e33c..1dc6c40e9c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
@@ -36,7 +36,7 @@ static const long double one = 1.0;
long double __modfl(long double x, long double *iptr)
{
int64_t i0,i1,j0;
- u_int64_t i;
+ uint64_t i;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 08134edd10..bd691f3310 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values without raising inexact.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,110 +17,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This has been coded in assembler because GCC makes such a mess of it
- when it's coded in C. */
-
-#include <math.h>
-#include <math_private.h>
-#include <fenv.h>
-#include <math_ldbl_opt.h>
-#include <float.h>
-#include <ieee754.h>
-
-
-long double
-__nearbyintl (long double x)
-{
- fenv_t env;
- static const long double TWO52 = 4503599627370496.0L;
- union ibm_extended_long_double u;
- u.ld = x;
-
- if (!isfinite (u.d[0].d))
- return x;
- else if (fabs (u.d[0].d) < TWO52)
- {
- double xh = u.d[0].d;
- double high = u.d[0].d;
- feholdexcept (&env);
- if (high > 0.0)
- {
- high += TWO52;
- high -= TWO52;
- if (high == -0.0) high = 0.0;
- }
- else if (high < 0.0)
- {
- high -= TWO52;
- high += TWO52;
- if (high == 0.0) high = -0.0;
- }
- if (u.d[1].d > 0.0 && (xh - high == 0.5))
- high += 1.0;
- else if (u.d[1].d < 0.0 && (-(xh - high) == 0.5))
- high -= 1.0;
- u.d[0].d = high;
- u.d[1].d = 0.0;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
- else if (fabs (u.d[1].d) < TWO52 && u.d[1].d != 0.0)
- {
- double high = u.d[0].d, low = u.d[1].d, tau;
- /* In this case we have to round the low double and handle any
- adjustment to the high double that may be caused by rounding
- (up). This is complicated by the fact that the high double
- may already be rounded and the low double may have the
- opposite sign to compensate. */
- feholdexcept (&env);
- if (u.d[0].d > 0.0)
- {
- if (u.d[1].d > 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d < 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
-
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low += TWO52;
- low -= TWO52;
- }
- else if (u.d[0].d < 0.0)
- {
- if (u.d[1].d < 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d > 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low = TWO52 - low;
- low = -(low - TWO52);
- }
- u.d[0].d = high + low;
- u.d[1].d = high - u.d[0].d + low;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
-
- return u.ld;
-}
-
-long_double_symbol (libm, __nearbyintl, nearbyintl);
+#define USE_AS_NEARBYINTL
+#include "s_rintl.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
index 515aa1ef5b..e29f7d60a3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
@@ -87,6 +88,9 @@ long double __nextafterl(long double x, long double y)
math_force_eval (u); /* raise underflow flag */
__set_errno (ERANGE);
}
+ /* Avoid returning -0 in FE_DOWNWARD mode. */
+ if (x == 0.0L)
+ return 0.0L;
return x;
}
/* If the high double is an exact power of two and the low
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
index d8f4fc6523..8456bd5145 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
index 7c5d1cc112..960ffd9aee 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -43,7 +44,7 @@ float __nexttowardf(float x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
new file mode 100644
index 0000000000..9b532a3a25
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
@@ -0,0 +1,79 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+/* Return the least floating-point number greater than X. */
+long double
+__nextupl (long double x)
+{
+ int64_t hx, ihx, lx;
+ double xhi, xlo, yhi;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ ihx = hx & 0x7fffffffffffffffLL;
+
+ if (ihx > 0x7ff0000000000000LL) /* x is nan. */
+ return x + x; /* Signal the nan. */
+ if (ihx == 0)
+ return LDBL_TRUE_MIN;
+
+ long double u;
+ if ((hx == 0x7fefffffffffffffLL) && (lx == 0x7c8ffffffffffffeLL))
+ return INFINITY;
+ if ((uint64_t) hx >= 0xfff0000000000000ULL)
+ {
+ u = -0x1.fffffffffffff7ffffffffffff8p+1023L;
+ return u;
+ }
+ if (ihx <= 0x0360000000000000LL)
+ { /* x <= LDBL_MIN. */
+ x += LDBL_TRUE_MIN;
+ if (x == 0.0L) /* Handle negative LDBL_TRUE_MIN case. */
+ x = -0.0L;
+ return x;
+ }
+ /* If the high double is an exact power of two and the low
+ double is the opposite sign, then 1ulp is one less than
+ what we might determine from the high double. Similarly
+ if X is an exact power of two, and negative, because
+ making it a little larger will result in the exponent
+ decreasing by one and normalisation of the mantissa. */
+ if ((hx & 0x000fffffffffffffLL) == 0
+ && ((lx != 0 && lx != 0x8000000000000000LL && (hx ^ lx) < 0)
+ || ((lx == 0 || lx == 0x8000000000000000LL) && hx < 0)))
+ ihx -= 1LL << 52;
+ if (ihx < (106LL << 52))
+ { /* ulp will denormal. */
+ INSERT_WORDS64 (yhi, ihx & (0x7ffLL << 52));
+ u = yhi * 0x1p-105;
+ }
+ else
+ {
+ INSERT_WORDS64 (yhi, (ihx & (0x7ffLL << 52)) - (105LL << 52));
+ u = yhi;
+ }
+ return x + u;
+}
+
+weak_alias (__nextupl, nextupl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
index 20e17cc823..d87bce7982 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -31,7 +31,7 @@ long double
__remquol (long double x, long double y, int *quo)
{
int64_t hx,hy;
- u_int64_t sx,lx,ly,qs;
+ uint64_t sx,lx,ly,qs;
int cquo;
double xhi, xlo, yhi, ylo;
@@ -43,7 +43,9 @@ __remquol (long double x, long double y, int *quo)
EXTRACT_WORDS64 (ly, ylo);
sx = hx & 0x8000000000000000ULL;
qs = sx ^ (hy & 0x8000000000000000ULL);
+ ly ^= hy & 0x8000000000000000ULL;
hy &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
/* Purge off exception values. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
index 8c51ded1d6..f003609d95 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,10 +22,17 @@
#include <math.h>
#include <fenv.h>
+#include <math-barriers.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
+#ifdef USE_AS_NEARBYINTL
+# define rintl nearbyintl
+# define __rintl __nearbyintl
+#endif
+
long double
__rintl (long double x)
@@ -44,7 +51,11 @@ __rintl (long double x)
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
+#ifdef USE_AS_NEARBYINTL
+ SET_RESTORE_ROUND_NOEX (FE_TONEAREST);
+#else
fesetround (FE_TONEAREST);
+#endif
/* Convert the high double to integer. */
orig_xh = xh;
@@ -103,8 +114,16 @@ __rintl (long double x)
if (orig_xh < 0.0)
xh = -__builtin_fabs (xh);
+#ifdef USE_AS_NEARBYINTL
+ math_force_eval (xh);
+ math_force_eval (xl);
+#else
fesetround (save_round);
+#endif
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
new file mode 100644
index 0000000000..84950e215f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
@@ -0,0 +1,70 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+
+long double
+__roundevenl (long double x)
+{
+ double xh, xl, hi;
+
+ ldbl_unpack (x, &xh, &xl);
+
+ if (xh != 0 && isfinite (xh))
+ {
+ hi = __roundeven (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero in the
+ opposite direction to the rounding of the high part. */
+ double diff = hi - xh;
+ if (fabs (diff) == 0.5)
+ {
+ if (xl < 0 && diff > 0)
+ xh = hi - 1;
+ else if (xl > 0 && diff < 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. Rounding the low
+ part to nearest, ties round to even, is always correct,
+ as a high part that is an odd integer together with a low
+ part with magnitude 0.5 is not a valid long double. */
+ xl = __roundeven (xl);
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
+ }
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
+
+ return ldbl_pack (xh, xl);
+}
+weak_alias (__roundevenl, roundevenl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
index 20813ed366..94a62dcd6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -38,47 +39,48 @@ __roundl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is exactly 0.5. nearbyint
- rounds values halfway between integers to the nearest even
- integer. roundl must round away from zero.
- Also correct cases where nearbyint returns an incorrect value
- for LO. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
- if (xh == 0.5)
+ hi = __round (xh);
+ if (hi != xh)
{
- if (xl > 0.0 || (xl == 0.0 && orig_xh > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero with the
+ opposite sign. */
+ if (fabs (hi - xh) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xh = hi - 1;
+ else if (xh < 0 && xl > 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
}
- else if (-xh == 0.5)
+ else
{
- if (xl < 0.0 || (xl == 0.0 && orig_xh < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = __round (xl);
+ if (fabs (lo - xl) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xl = lo + 1;
+ else if (xh < 0 && lo > 0)
+ xl = lo - 1;
+ else
+ xl = lo;
+ }
+ else
+ xl = lo;
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
new file mode 100644
index 0000000000..bb07a3533a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadl, setpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
new file mode 100644
index 0000000000..e5b49d03a2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
@@ -0,0 +1,60 @@
+/* Set NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (long double *x, long double payload)
+{
+ double hi, lo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (payload, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ int exponent = hx >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. All valid
+ arguments have the low part zero. */
+ if ((lx & 0x7fffffffffffffffULL) != 0
+ || exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0))
+ || (hx & ((1ULL << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ *x = 0.0L;
+ return 1;
+ }
+ if (hx != 0)
+ {
+ hx &= (1ULL << EXPLICIT_MANT_DIG) - 1;
+ hx |= 1ULL << EXPLICIT_MANT_DIG;
+ hx >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ hx |= 0x7ff0000000000000ULL | (SET_HIGH_BIT ? 0x8000000000000ULL : 0);
+ INSERT_WORDS64 (hi, hx);
+ *x = ldbl_pack (hi, 0.0);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
new file mode 100644
index 0000000000..4e920360d4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadsigl, setpayloadsigl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
index b4e8256329..2f7eb62ee8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
index fae4020a7b..ca4f9dff2f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
index e6457a1c1c..3504862402 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@@ -41,6 +41,7 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double one=1.0L, two=2.0L, tiny = 1.0e-300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
new file mode 100644
index 0000000000..9f20e01adc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
@@ -0,0 +1,63 @@
+/* Total order operation. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorderl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t hx_sign = hx >> 63;
+ uint64_t hy_sign = hy >> 63;
+ int64_t hx_adj = hx ^ (hx_sign >> 1);
+ int64_t hy_adj = hy ^ (hy_sign >> 1);
+ if (hx_adj < hy_adj)
+ return 1;
+ else if (hx_adj > hy_adj)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if ((hx & 0x7fffffffffffffffULL) >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
+weak_alias (__totalorderl, totalorderl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
new file mode 100644
index 0000000000..d8027ffbb0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
@@ -0,0 +1,65 @@
+/* Total order operation on absolute values. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t x_sign = hx & 0x8000000000000000ULL;
+ uint64_t y_sign = hy & 0x8000000000000000ULL;
+ hx ^= x_sign;
+ hy ^= y_sign;
+ if (hx < hy)
+ return 1;
+ else if (hx > hy)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if (hx >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+ lx ^= x_sign;
+ ly ^= y_sign;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
+weak_alias (__totalordermagl, totalordermagl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
index df58b64b53..a915a01ac6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
@@ -1,6 +1,6 @@
/* Truncate (toward zero) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,51 +36,26 @@ __truncl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (orig_xh < 0.0)
+ hi = __trunc (xh);
+ if (hi != xh)
{
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
}
else
{
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = xh > 0 ? __floor (xl) : __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
new file mode 100644
index 0000000000..2176aa0cdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpl, ufromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
new file mode 100644
index 0000000000..2901151312
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpxl, ufromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
index a8181740a8..862fd533be 100644
--- a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,6 @@
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
-#include <xlocale.h>
/* The actual implementation for all floating point sizes is in strtod.c.
These macros tell it to produce the `long double' version, `strtold'. */
@@ -26,13 +25,13 @@
#define FLOAT long double
#define FLT LDBL
#ifdef USE_WIDE_CHAR
-extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t);
# define STRTOF __new_wcstold_l
# define __STRTOF ____new_wcstold_l
# define ____STRTOF_INTERNAL ____wcstold_l_internal
# define STRTOF_NAN __wcstold_nan
#else
-extern long double ____new_strtold_l (const char *, char **, __locale_t);
+extern long double ____new_strtold_l (const char *, char **, locale_t);
# define STRTOF __new_strtold_l
# define __STRTOF ____new_strtold_l
# define ____STRTOF_INTERNAL ____strtold_l_internal
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_expl.h b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
new file mode 100644
index 0000000000..ca2481caa1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
@@ -0,0 +1,970 @@
+/* Accurate table for expl().
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* __expl_table basically consists of four tables, T_EXPL_ARG{1,2} and
+ T_EXPL_RES{1,2}. All tables use positive and negative indexes, the 0 points
+ are marked by T_EXPL_* defines.
+ For ARG1 and RES1 tables lets B be 89 and S 256.0, for ARG2 and RES2 B is 65
+ and S 32768.0.
+ These table have the property that, for all integers -B <= i <= B
+ expl(__expl_table[T_EXPL_ARGN+2*i]+__expl_table[T_EXPL_ARGN+2*i+1]+r) ==
+ __expl_table[T_EXPL_RESN+i], __expl_table[T_EXPL_RESN+i] is some exact number
+ with the low 58 bits of the mantissa 0,
+ __expl_table[T_EXPL_ARGN+2*i] == i/S+s
+ where absl(s) <= 2^-54 and absl(r) <= 2^-212. */
+
+
+static const long double __expl_table [] = {
+ -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
+ 6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
+ -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
+ -7.16021898043268093462818380603370350E-33L, /* bf94296c8219427edc1431ac2498583e */
+ -3.39843750000000013418643523138766329E-01L, /* bffd5c000000000003de1f027a30e000 */
+ 8.16920774283317801641347327589583265E-32L, /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ -3.35937500000000014998092453039303051E-01L, /* bffd5800000000000452a9f4d8857000 */
+ -6.55865578425428447938248396879359670E-32L, /* bf97548b7d240f3d034b395e6eecfac8 */
+ -3.32031250000000000981984049529998541E-01L, /* bffd540000000000004875277cda5000 */
+ 6.91213046334032232108944519541512737E-32L, /* 3f9766e5f925338a19045c94443b66e1 */
+ -3.28124999999999986646017645350399708E-01L, /* bffd4ffffffffffffc26a667bf44d000 */
+ -6.16281060996110316602421505683742661E-32L, /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ -3.24218749999999991645717430645867963E-01L, /* bffd4bfffffffffffd97901063e48000 */
+ -7.90797211087760527593856542417304137E-32L, /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ -3.20312499999999998918211610690789652E-01L, /* bffd47ffffffffffffb02d9856d71000 */
+ 8.64024799457616856987630373786503376E-32L, /* 3f97c0a098623f95579d5d9b2b67342d */
+ -3.16406249999999998153974811017181883E-01L, /* bffd43ffffffffffff77c991f1076000 */
+ -2.73176610180696076418536105483668404E-32L, /* bf961baeccb32f9b1fcbb8e60468e95a */
+ -3.12500000000000011420976192575972779E-01L, /* bffd400000000000034ab8240483d000 */
+ 7.16573502812389453744433792609989420E-32L, /* 3f977410f4c2cfc4335f28446c0fb363 */
+ -3.08593750000000001735496343854851414E-01L, /* bffd3c000000000000800e995c176000 */
+ -1.56292999645122272621237565671593071E-32L, /* bf95449b9cbdaff6ac1246adb2c826ac */
+ -3.04687499999999982592401295899221626E-01L, /* bffd37fffffffffffafb8bc1e061a000 */
+ 6.48993208584888904958594509625158417E-32L, /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ -3.00781249999999999230616898937763959E-01L, /* bffd33ffffffffffffc73ac39da54000 */
+ 6.57082437496961397305801409357792029E-32L, /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ -2.96874999999999998788769281703245722E-01L, /* bffd2fffffffffffffa6a07fa5021000 */
+ -3.26588297198283968096426564544269170E-32L, /* bf9653260fc1802f46b629aee171809b */
+ -2.92968750000000015318089182805941695E-01L, /* bffd2c0000000000046a468614bd6000 */
+ -1.73291974845198589684358727559290718E-32L, /* bf9567e9d158f52e483c8d8dcb5961dd */
+ -2.89062500000000007736778942676309681E-01L, /* bffd280000000000023adf9f4c3d3000 */
+ -6.83629745986675744404029225571026236E-32L, /* bf9762f5face6281c1daf1c6aedbdb45 */
+ -2.85156250000000001367091555763661937E-01L, /* bffd2400000000000064dfa11e3fb000 */
+ -5.44898442619766878281110054067026237E-32L, /* bf971aed6d2db9f542986a785edae072 */
+ -2.81249999999999986958718100227029406E-01L, /* bffd1ffffffffffffc3db9265ca9d000 */
+ 1.13007318374506125723591889451107046E-32L, /* 3f94d569fe387f456a97902907ac3856 */
+ -2.77343750000000000356078829380495179E-01L, /* bffd1c0000000000001a462390083000 */
+ -4.98979365468978332358409063436543102E-32L, /* bf970315bbf3e0d14b5c94c900702d4c */
+ -2.73437499999999990276993957508540484E-01L, /* bffd17fffffffffffd32919bcdc94000 */
+ -8.79390484115892344533724650295100871E-32L, /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ -2.69531250000000002434203866460082225E-01L, /* bffd14000000000000b39ccf9e130000 */
+ 9.44060754687026590886751809927191596E-32L, /* 3f97ea2f32cfecca5c64a26137a9210f */
+ -2.65624999999999997296320716986257179E-01L, /* bffd0fffffffffffff3880f13a2bc000 */
+ 2.07142664067265697791007875348396921E-32L, /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ -2.61718750000000010237478733739017956E-01L, /* bffd0c000000000002f3648179d40000 */
+ -6.10552936159265665298996309192680256E-32L, /* bf973d0467d31e407515a3cca0f3b4e2 */
+ -2.57812500000000011948220522778370303E-01L, /* bffd08000000000003719f81275bd000 */
+ 6.72477169058908902499239631466443836E-32L, /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ -2.53906249999999991822993360536596860E-01L, /* bffd03fffffffffffda4a4b62f818000 */
+ -2.44868296623215865054704392917190994E-32L, /* bf95fc92516c6d057d29fc2528855976 */
+ -2.49999999999999986862019457428548084E-01L, /* bffcfffffffffffff86d2d20d5ff4000 */
+ -3.85302898949105073614122724961613078E-32L, /* bf96901f147cb7d643af71b6129ce929 */
+ -2.46093750000000000237554160737318435E-01L, /* bffcf8000000000000230e8ade26b000 */
+ -1.52823675242678363494345369284988589E-32L, /* bf953d6700c5f3fc303f79d0ec8c680a */
+ -2.42187500000000003023380963205457065E-01L, /* bffcf0000000000001be2c1a78bb0000 */
+ -7.78402037952209709489481182714311699E-34L, /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ -2.38281249999999995309623303145485725E-01L, /* bffce7fffffffffffd4bd2940f43f000 */
+ -3.54307216794236899443913216397197696E-32L, /* bf966fef03ab69c3f289436205b21d02 */
+ -2.34374999999999998425804947623207526E-01L, /* bffcdfffffffffffff17b097a6092000 */
+ -2.86038428948386602859761879407549696E-32L, /* bf96290a0eba0131efe3a05fe188f2e3 */
+ -2.30468749999999993822207406785200832E-01L, /* bffcd7fffffffffffc70519834eae000 */
+ -2.54339521031747516806893838749365762E-32L, /* bf96081f0ad7f9107ae6cddb32c178ab */
+ -2.26562499999999997823524030344489884E-01L, /* bffccffffffffffffebecf10093df000 */
+ 4.31904611473158635644635628922959401E-32L, /* 3f96c083f0b1faa7c4c686193e38d67c */
+ -2.22656250000000004835132405125162742E-01L, /* bffcc8000000000002c98a233f19f000 */
+ 2.54709791629335691650310168420597566E-33L, /* 3f92a735903f5eed07a716ab931e20d9 */
+ -2.18749999999999988969454021829236626E-01L, /* bffcbffffffffffff9a42dc14ce36000 */
+ -3.77236096429336082213752014054909454E-32L, /* bf9687be8e5b2fca54d3e81157eac660 */
+ -2.14843750000000010613256919115758495E-01L, /* bffcb80000000000061e3d828ecac000 */
+ -4.55194148712216691177097854305964738E-32L, /* bf96d8b35c776aa3e1a4768271380503 */
+ -2.10937499999999993204656148110447201E-01L, /* bffcaffffffffffffc152f2aea118000 */
+ -2.95044199165561453749332254271716417E-32L, /* bf96326433b00b2439094d9bef22ddd1 */
+ -2.07031250000000012233944895423355677E-01L, /* bffca80000000000070d695ee0e94000 */
+ 1.93146788688385419095981415411012357E-32L, /* 3f959126729135a5e390d4bb802a0bde */
+ -2.03125000000000008030983633336321863E-01L, /* bffca0000000000004a129fbc51af000 */
+ 2.37361904671826193563212931215900137E-32L, /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ -1.99218750000000001763815712796132779E-01L, /* bffc98000000000001044b12d9950000 */
+ -3.63171243370923753295192486732883239E-33L, /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ -1.95312500000000004883660234506677272E-01L, /* bffc90000000000002d0b3779d1f9000 */
+ -3.19989507343607877747980892249711601E-33L, /* bf9309d63de96bb3ef744c865f22f1bd */
+ -1.91406250000000013720152363227519348E-01L, /* bffc88000000000007e8bcb387121000 */
+ -1.89295754093147174148371614722178860E-32L, /* bf958926e2e67dfe812c508290add2e7 */
+ -1.87500000000000000182342082774432620E-01L, /* bffc800000000000001ae8b06a39f000 */
+ -2.96812835183184815200854214892983927E-32L, /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ -1.83593750000000012410147185883290345E-01L, /* bffc78000000000007276a1adda8d000 */
+ -2.02191931237489669058466239995304587E-32L, /* bf95a3efab92d26ec2df90df036a117f */
+ -1.79687499999999997439177363346082917E-01L, /* bffc6ffffffffffffe8616db2927d000 */
+ -9.92752326937775530007399526834009465E-33L, /* bf949c5f88ed17041e1a3f1829d543cd */
+ -1.75781249999999995824373974504785174E-01L, /* bffc67fffffffffffd97c94f13ea3000 */
+ 1.44184772065335613487885714828816178E-32L, /* 3f952b75c63476e7fcc2f5841c27bcce */
+ -1.71874999999999986685050259043077809E-01L, /* bffc5ffffffffffff8530f6bc531a000 */
+ -3.49007014971241147689894940544402482E-32L, /* bf966a6dfaa012aea8ffe6d90b02330f */
+ -1.67968749999999997316058782350439701E-01L, /* bffc57fffffffffffe73eb914f2aa000 */
+ 3.34025733574205019081305778794376391E-32L, /* 3f965adf4572561fd5456a6c13d8babf */
+ -1.64062499999999993322730602128318480E-01L, /* bffc4ffffffffffffc269be4f68f3000 */
+ -1.83345916769684984022099095506340635E-32L, /* bf957ccb69026cb2f6024c211576d5f4 */
+ -1.60156249999999992419000744447607979E-01L, /* bffc47fffffffffffba13df21784a000 */
+ 2.73442789798110494773517431626534726E-32L, /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ -1.56249999999999987665010524130393080E-01L, /* bffc3ffffffffffff8e3ad45e7508000 */
+ 2.02695576464836145806428118889332191E-32L, /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ -1.52343749999999989905291167951491803E-01L, /* bffc37fffffffffffa2e48aecfc24000 */
+ -3.61436631548815190395331054871041524E-32L, /* bf967756567ebd108075ae527cc2e7f0 */
+ -1.48437500000000006686107754967759751E-01L, /* bffc30000000000003dab20261b3c000 */
+ -2.15524270159131591469319477922198390E-32L, /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ -1.44531250000000005132889939177166485E-01L, /* bffc28000000000002f57b1969e7b000 */
+ 2.74741116529653547935086189244019604E-32L, /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ -1.40625000000000000707469094533647325E-01L, /* bffc2000000000000068676d3d5c4000 */
+ 4.40607097220049957013547629906723266E-33L, /* 3f936e0ac425daf795b42913cf0ef881 */
+ -1.36718749999999995713752139187543306E-01L, /* bffc17fffffffffffd87762255991000 */
+ -3.73751317180116492404578048203389108E-32L, /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ -1.32812500000000007198453630478482191E-01L, /* bffc10000000000004264de3a4379000 */
+ -3.97050085179660203884930593717220728E-32L, /* bf969c52048de14be3c9c1971e50869c */
+ -1.28906250000000006070486371645733082E-01L, /* bffc080000000000037fd87db2cb0000 */
+ 3.59610068058504988294019521946586131E-32L, /* 3f967570c10687cb8e9ebd0b280abf5a */
+ -1.25000000000000003700729208608337966E-01L, /* bffc00000000000002222198bbc74000 */
+ 3.23464851393124362331846965931995969E-33L, /* 3f930cb95da3bfc847e593716c91d57a */
+ -1.21093750000000013729038501177102555E-01L, /* bffbf000000000000fd418d1f5fda000 */
+ 2.45242487730722066611358741283977619E-32L, /* 3f95fd5945ad86a464292e26ac192a84 */
+ -1.17187499999999999765305306880205578E-01L, /* bffbdfffffffffffffbabaf869845000 */
+ -1.14557520298960389903199646350205537E-32L, /* bf94dbda735322179d9bcf392e1dd06d */
+ -1.13281250000000009579647893740755690E-01L, /* bffbd000000000000b0b69bae7ab9000 */
+ 2.37873962873837390105423621772752350E-32L, /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ -1.09375000000000008981153004560108539E-01L, /* bffbc000000000000a5ac4bc1d2c3000 */
+ 1.53152444860014076105003555837231015E-32L, /* 3f953e15ce931e12ef9a152522e32bdd */
+ -1.05468749999999992399063850363228723E-01L, /* bffbaffffffffffff73c998091408000 */
+ -8.75920903597804862471749360196688834E-33L, /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ -1.01562500000000007685885179918350550E-01L, /* bffba0000000000008dc7910a648c000 */
+ -4.63820993797174451904075397785059501E-33L, /* bf938153d0e54001a472da180fb5e8aa */
+ -9.76562499999999887262211517861331814E-02L, /* bffb8ffffffffffff300915aa6fd6000 */
+ -2.63767025974952608658936466715705903E-33L, /* bf92b64215bb8d520be5404620d38088 */
+ -9.37499999999999939650246024457439795E-02L, /* bffb7ffffffffffff90aca26bd0fc000 */
+ -1.72047822349322956713582039121348377E-32L, /* bf9565545015c5b9b56d02cfefca2c7d */
+ -8.98437500000000033088896383977486369E-02L, /* bffb70000000000003d09ca1e3cbe000 */
+ 3.04831994420989436248526129869697270E-33L, /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ -8.59374999999999947312400115121319225E-02L, /* bffb5ffffffffffff9ecefc03376e000 */
+ 1.50416954438393392150792422537312281E-32L, /* 3f9538675ee99bd722fad0023c09c915 */
+ -8.20312500000000054182280847004695514E-02L, /* bffb500000000000063f2dbd40200000 */
+ 2.68399664523430004488075638997207289E-33L, /* 3f92bdf49766629882c49a3da88928ed */
+ -7.81250000000000114767533968079748798E-02L, /* bffb4000000000000d3b56f81ba70000 */
+ 1.72318124201659121296305402819694281E-32L, /* 3f9565e407aaabfb359e8a567d760de3 */
+ -7.42187500000000035531829472486812869E-02L, /* bffb3000000000000418b6e9b5388000 */
+ 2.09401756478514117051383998628099655E-32L, /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ -7.03124999999999987474933134860732535E-02L, /* bffb1ffffffffffffe8e53453d2ac000 */
+ 2.28515798224350800271565551341211666E-32L, /* 3f95da9bd6adf00894f05b5cc5530125 */
+ -6.64062500000000042267533361089054159E-02L, /* bffb10000000000004df8473dbcf2000 */
+ 1.97576478800281368377376002585430031E-32L, /* 3f959a59acbddb2f53bd3096b66370e9 */
+ -6.25000000000000066329769382774201686E-02L, /* bffb00000000000007a5b5914e336000 */
+ -1.46422615813786836245343723048221678E-33L, /* bf91e69295f069fc0c4a9db181ea25a3 */
+ -5.85937500000000002823707957982406053E-02L, /* bffae0000000000000a6aeab10592000 */
+ 9.25637741701318872896718218457555829E-33L, /* 3f94807eb021f1f40a37d4015b1eb76b */
+ -5.46875000000000081586888005226044448E-02L, /* bffac0000000000012d00a3171e3a000 */
+ -4.87144542459404765480424673678105050E-33L, /* bf9394b42faba6b7036fe7b36269daf3 */
+ -5.07812499999999927720348253140567013E-02L, /* bffa9fffffffffffef555cc8dd914000 */
+ -3.01901021987395945826043649523451725E-33L, /* bf92f59e7e3025691f290f8f67277faf */
+ -4.68749999999999935349476738962633103E-02L, /* bffa7ffffffffffff117b4ea2b876000 */
+ 1.21521638219189777347767475937119750E-32L, /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ -4.29687500000000056305562847814228219E-02L, /* bffa6000000000000cfbb19be30c0000 */
+ -1.18643699217679276275559592978275214E-32L, /* bf94ecd39f0833a876550e83eb012b99 */
+ -3.90624999999999962692914526031373542E-02L, /* bffa3ffffffffffff765c743922f9000 */
+ -4.91277156857520035712509544689973679E-33L, /* bf939823189996193872e58ac0dececb */
+ -3.51562500000000108152468207687602886E-02L, /* bffa20000000000018f031e41177f000 */
+ 1.18599806302656253755207072755609820E-32L, /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ -3.12500000000000077376981036742289578E-02L, /* bffa00000000000011d787e0b386f000 */
+ 9.97730386477005171963635210799577079E-33L, /* 3f949e70e498c46a0173ac0d46c699fc */
+ -2.73437500000000139436129596418623235E-02L, /* bff9c00000000000404db66e70a08000 */
+ 2.25755321633070123579875157841633859E-33L, /* 3f927719b1a93074bdf9f3c2cb784785 */
+ -2.34375000000000088003629211828324876E-02L, /* bff98000000000002895a27d45feb000 */
+ 2.84374279216848803102126617873942975E-33L, /* 3f92d87f70e749d6da6c260b68dc210b */
+ -1.95312500000000107408831063404855424E-02L, /* bff9400000000000318898ba69f71000 */
+ 2.47348089686935458989103979140011912E-33L, /* 3f929afa3de45086fe909fdddb41edce */
+ -1.56250000000000081443917555362290635E-02L, /* bff9000000000000258f335e9cdd6000 */
+ -2.43379314483517422161458863218426254E-33L, /* bf9294621c8a9ccacf2b020ec19cad27 */
+ -1.17187500000000051490597418161403184E-02L, /* bff88000000000002f7ddfa26221f000 */
+ 1.83405297208145390679150568810924707E-33L, /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ -7.81249999999999715861805208310174953E-03L, /* bff7ffffffffffffcb95f3fff157d000 */
+ 3.51548384878710915171654413641872451E-34L, /* 3f8fd349b76c22966f77a39fc37ed704 */
+ -3.90625000000000309326013918295097128E-03L, /* bff7000000000000390f820c8e153000 */
+ 6.38058004651791109324060099097251911E-36L, /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+#define T_EXPL_ARG1 (2*89)
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 3.90625000000000245479958859972588985E-03L, /* 3ff70000000000002d48769ac9874000 */
+ -6.58439598384342854976169982902779828E-36L, /* bf8a1811b923e6c626b07ef29761482a */
+ 7.81250000000001311374391093664996358E-03L, /* 3ff800000000000078f3f3cd89111000 */
+ 2.60265650555493781464273319671555602E-33L, /* 3f92b070c3b635b87af426735a71fc87 */
+ 1.17187500000000269581156218247101912E-02L, /* 3ff8800000000000f8a50d02fe20d000 */
+ 1.00961747974945520631836275894919326E-33L, /* 3f914f80c1a4f8042044fe3b757b030b */
+ 1.56249999999999797878275270751825475E-02L, /* 3ff8ffffffffffff45935b69da62e000 */
+ 2.03174577741375590087897353146748580E-33L, /* 3f925194e863496e0f6e91cbf6b22e26 */
+ 1.95312499999999760319884511789111533E-02L, /* 3ff93fffffffffff917790ff9a8f4000 */
+ 4.62788519658803722282100289809515007E-33L, /* 3f9380783ba81295feeb3e4879d7d52d */
+ 2.34374999999999822953909016349145918E-02L, /* 3ff97fffffffffffae5a163bd3cd5000 */
+ -3.19499956304699705390404384504876533E-33L, /* bf93096e2037ced8194cf344c692f8d6 */
+ 2.73437500000000137220327275871555682E-02L, /* 3ff9c000000000003f481dea5dd51000 */
+ -2.25757776523031994464630107442723424E-33L, /* bf92771abcf988a02b414bf2614e3734 */
+ 3.12499999999999790857640618332718621E-02L, /* 3ff9ffffffffffff9f8cd40b51509000 */
+ -4.22479470489989916319395454536511458E-33L, /* bf935efb7245612f371deca17cb7b30c */
+ 3.51562499999999840753382405747597346E-02L, /* 3ffa1fffffffffffdb47bd275f722000 */
+ 1.08459658374118041980976756063083500E-34L, /* 3f8e2055d18b7117c9db1c318b1e889b */
+ 3.90624999999999989384433621470426757E-02L, /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ -7.41674226146122000759491297811091830E-33L, /* bf94341454e48029e5b0205d91baffdc */
+ 4.29687500000000107505739500500200462E-02L, /* 3ffa60000000000018ca04cd9085c000 */
+ -4.74689012756713017494437969420919847E-34L, /* bf903b7c268103c6f7fbaaa24142e287 */
+ 4.68749999999999978700749928325717352E-02L, /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ -1.06208165308448830117773486334902917E-32L, /* bf94b92be4b3b5b5a596a0a5187cc955 */
+ 5.07812499999999815072625435955786253E-02L, /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ -9.37038897148383660401929567549111394E-33L, /* bf94853b111b0175b491c80d00419416 */
+ 5.46874999999999809511553152189867394E-02L, /* 3ffabfffffffffffd4138bfa74a61000 */
+ 1.06642963074562437340498606682822123E-32L, /* 3f94bafa3fe991b39255d563dfa05d89 */
+ 5.85937500000000184331996330905145551E-02L, /* 3ffae000000000002a810a5f2f8bf000 */
+ -1.76639977694797200820296641773791945E-34L, /* bf8ed596f07ce4408f1705c8ec16864c */
+ 6.25000000000000021544696744852045001E-02L, /* 3ffb000000000000027be32045e2b000 */
+ 1.68616371995798354366633034788947149E-32L, /* 3f955e33d7440794d8a1b25233d086ab */
+ 6.64062499999999965563110718495802889E-02L, /* 3ffb0ffffffffffffc079a38a3fed000 */
+ -1.82463217667830160048872113565316215E-32L, /* bf957af6163bcdb97cefab44a942482a */
+ 7.03124999999999759989183341261898222E-02L, /* 3ffb1fffffffffffe454218acea05000 */
+ -1.07843770101525495515646940862541503E-32L, /* bf94bff72aada26d94e76e71c07e0580 */
+ 7.42187499999999898968873730710101412E-02L, /* 3ffb2ffffffffffff45a166496dc1000 */
+ 1.28629441689592874462780757154138223E-32L, /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+ 7.81249999999999957198938523510804668E-02L, /* 3ffb3ffffffffffffb10bc52adbc5000 */
+ 1.13297573459968118467100063135856856E-33L, /* 3f91787eea895b3c245899cf34ad0abd */
+ 8.20312500000000199911640621145851159E-02L, /* 3ffb500000000000170c59a661a89000 */
+ -1.51161335208135146756554123073528707E-32L, /* bf9539f326c5ca84e7db5401566f3775 */
+ 8.59375000000000134175373433347670743E-02L, /* 3ffb6000000000000f78287547af0000 */
+ 1.09763629458404270323909815379924900E-32L, /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+ 8.98437500000000036533922600308306335E-02L, /* 3ffb70000000000004364a83b7a14000 */
+ 3.11459653680110433194288029777718358E-33L, /* 3f9302c0248136d65cebeab69488d949 */
+ 9.37500000000000184977946245216914691E-02L, /* 3ffb800000000000155395d870b17000 */
+ -4.66656154468277949130395786965043927E-33L, /* bf9383aec9b993b6db492b1ede786d8a */
+ 9.76562500000000237839723100419376084E-02L, /* 3ffb9000000000001b6bca237f6c4000 */
+ -1.03028043424658760249140747856831301E-32L, /* bf94abf6352e3d2bb398e47919a343fb */
+ 1.01562500000000012345545575236836572E-01L, /* 3ffba000000000000e3bc30cd9a1f000 */
+ 2.15755372310795701322789783729456319E-32L, /* 3f95c01b3b819edd9d07548fafd61550 */
+ 1.05468749999999976493840484471911438E-01L, /* 3ffbafffffffffffe4e634cd77985000 */
+ 1.78771847038773333029677216592309083E-32L, /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+ 1.09375000000000002267015055992785402E-01L, /* 3ffbc00000000000029d1ad08de7b000 */
+ 6.23263106693943817730045115112427717E-33L, /* 3f9402e4b39ce2198a45e1d045868cd6 */
+ 1.13281250000000022354208618429577398E-01L, /* 3ffbd0000000000019c5cc3f9d2b5000 */
+ 5.40514416644786448581426756221178868E-33L, /* 3f93c10ab4021472c662f69435de9269 */
+ 1.17187500000000013252367133076817603E-01L, /* 3ffbe000000000000f47688cc561b000 */
+ -7.12412585457324989451327215568641325E-33L, /* bf9427ecb343a8d1758990565fcfbf45 */
+ 1.21093750000000020759863992944300792E-01L, /* 3ffbf0000000000017ef3af97bf04000 */
+ 6.26591408357572503875647872077266444E-33L, /* 3f940446a09a2da771b45fc075514d12 */
+ 1.25000000000000004739659392396765618E-01L, /* 3ffc00000000000002bb7344ecd89000 */
+ -1.55611398459729463981000080101758830E-32L, /* bf95433135febefa9e6aa4db39e263d2 */
+ 1.28906249999999982360888081057894783E-01L, /* 3ffc07fffffffffff5d4ed3154361000 */
+ -1.77531518652835570781208599686606474E-32L, /* bf9570b7f225ea076f97f418d11359c1 */
+ 1.32812500000000010568583998727400436E-01L, /* 3ffc1000000000000617a5d09526a000 */
+ 2.12104021624990594668286391598300893E-32L, /* 3f95b885d767a1048d93055927a27adc */
+ 1.36718749999999998434125157367005292E-01L, /* 3ffc17ffffffffffff18eaebc7970000 */
+ 2.50454798592543203967309921276955297E-32L, /* 3f9604164e5598528a76faff26cd1c97 */
+ 1.40625000000000015550032422969330356E-01L, /* 3ffc20000000000008f6c79d8928c000 */
+ 7.80972982879849783680252962992639832E-33L, /* 3f9444674acf2b3225c7647e0d95edf3 */
+ 1.44531250000000012402535562111122522E-01L, /* 3ffc28000000000007264a8bc1ff1000 */
+ 2.79662468716455159585514763921671876E-32L, /* 3f96226b095bd78aa650faf95a221993 */
+ 1.48437500000000007761020440087419948E-01L, /* 3ffc3000000000000479530ff8fe3000 */
+ 2.15518492972728435680556239996258527E-32L, /* 3f95bf9d49295e73a957906a029768cb */
+ 1.52343750000000001733189947520484032E-01L, /* 3ffc38000000000000ffc6109f71f000 */
+ 8.34032236093545825619420380704500188E-33L, /* 3f945a71851226a1d0ce5e656693153e */
+ 1.56249999999999988073295321246958484E-01L, /* 3ffc3ffffffffffff91fedd62ae0f000 */
+ 2.44119337150624789345260194989620908E-32L, /* 3f95fb041a57bc1c1280680ac1620bea */
+ 1.60156250000000002076894210913572460E-01L, /* 3ffc48000000000001327ed84a199000 */
+ -7.36124501128859978061216696286151753E-33L, /* bf9431c62f01e59d2c1e00f195a0037f */
+ 1.64062500000000000950861276373482172E-01L, /* 3ffc500000000000008c5285fba85000 */
+ -4.80566184447001164583855800470217373E-33L, /* bf938f3d1fcafd390f22f80e6c19421f */
+ 1.67968749999999989878071706155265999E-01L, /* 3ffc57fffffffffffa2a445c548c5000 */
+ -4.42154428718618459799673088733365064E-32L, /* bf96cb28cf1c1b28006d53ffe633b22a */
+ 1.71874999999999999459734108403218175E-01L, /* 3ffc5fffffffffffffb04554e9dd4000 */
+ -3.29736288190321377985697972236270628E-32L, /* bf96566af0ebc852e84be12859b24a31 */
+ 1.75781249999999997987525759778901845E-01L, /* 3ffc67fffffffffffed702df6ffff000 */
+ -1.28800728638468399687523924685844352E-32L, /* bf950b8236b88ca0c1b739dc91a7e3fc */
+ 1.79687500000000004929565820437175783E-01L, /* 3ffc70000000000002d779bb32d2e000 */
+ 1.60624461317978482424582320675174225E-32L, /* 3f954d9a9cc0c963fd081f3dc922d04e */
+ 1.83593750000000016873727045739708856E-01L, /* 3ffc78000000000009ba1f6263c9a000 */
+ -3.83390389582056606880506003118452558E-32L, /* bf968e22a5d826f77f19ee788474df22 */
+ 1.87500000000000013443068740761666872E-01L, /* 3ffc80000000000007bfd8c72a1bf000 */
+ -2.74141662712926256150154726565203091E-32L, /* bf961caf5ac59c7f941f928e324c2cc1 */
+ 1.91406249999999981494101786848611970E-01L, /* 3ffc87fffffffffff55502eeae001000 */
+ 3.68992437075565165346469517256118001E-32L, /* 3f967f2f03f9096793372a27b92ad79d */
+ 1.95312499999999989069921848800501648E-01L, /* 3ffc8ffffffffffff9b3015280394000 */
+ 3.69712249337856518452988332367785220E-32L, /* 3f967fee5fdb5bd501ff93516999faa0 */
+ 1.99218750000000021148042946919300804E-01L, /* 3ffc9800000000000c30e67939095000 */
+ 2.50142536781142175091322844848566649E-32L, /* 3f9603c34ae58e10b300b07137ee618a */
+ 2.03124999999999977732559198825437141E-01L, /* 3ffc9ffffffffffff329e7df079e4000 */
+ -2.41951877287895024779300892731537816E-32L, /* bf95f683aefe6965f080df8f59dd34a1 */
+ 2.07031249999999996744030653771913124E-01L, /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ -1.94346475904454000031592792989765585E-32L, /* bf9593a44f87870a3d100d498501ecc7 */
+ 2.10937500000000000251399259834392298E-01L, /* 3ffcb000000000000025199873310000 */
+ -1.33528748788094249098998693871759411E-33L, /* bf91bbb9b25c813668d6103d08acac35 */
+ 2.14843749999999993936323609611875097E-01L, /* 3ffcb7fffffffffffc8128c866236000 */
+ 1.14839877977014974625242788556545292E-32L, /* 3f94dd06b4655c9b83a1305b240e7a42 */
+ 2.18750000000000015181732784749663837E-01L, /* 3ffcc0000000000008c06da5fff24000 */
+ 1.42689085313142539755499441881408391E-32L, /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+ 2.22656249999999992172647770539596569E-01L, /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ -3.34421462850496887359128610229650547E-32L, /* bf965b487962b5c2d9056ca6ac0c2e5c */
+ 2.26562499999999989595607223847082419E-01L, /* 3ffccffffffffffffa0095277be5c000 */
+ -3.08983588107248752517344356508205569E-32L, /* bf9640dded57157f8eded311213bdbcd */
+ 2.30468749999999979130462438434567117E-01L, /* 3ffcd7fffffffffff3f8332996560000 */
+ -3.01407539802851697849105682795217019E-32L, /* bf9638ffde35dbdfe1a1ffe45185de5d */
+ 2.34375000000000012194252337217891971E-01L, /* 3ffce0000000000007078dd402c86000 */
+ -8.46879710915628592284714319904522657E-33L, /* bf945fc7b29a2ac6c9eff9eb258a510f */
+ 2.38281249999999982991877076137149870E-01L, /* 3ffce7fffffffffff6320b486eece000 */
+ -2.93563878880439245627127095245798544E-32L, /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+ 2.42187499999999981447559841442773990E-01L, /* 3ffceffffffffffff54e24a09a8d5000 */
+ -4.56766746558806021264215486909850481E-32L, /* bf96da556dee11f3113e5a3467b908e6 */
+ 2.46093749999999991067720539980207318E-01L, /* 3ffcf7fffffffffffad9d405dcb5d000 */
+ 2.14033004219908074003010247652128251E-32L, /* 3f95bc8776e8f9ae098884aa664cc3df */
+ 2.50000000000000016613825838126835953E-01L, /* 3ffd00000000000004c9e24c12bb3000 */
+ 2.57617532593749185996714235009382870E-32L, /* 3f960b867cc01178c0ec68226c6cb47d */
+ 2.53906250000000013372004437827044321E-01L, /* 3ffd04000000000003daae05b3168000 */
+ 7.20177123439204414298152646284640101E-32L, /* 3f9775eff59ddad7e7530b83934af87f */
+ 2.57812499999999995765234725413886085E-01L, /* 3ffd07fffffffffffec7878bad9d5000 */
+ 6.51253187532920882777046064603770602E-32L, /* 3f975226659ca241402e71c2011583b0 */
+ 2.61718750000000007647689994011222248E-01L, /* 3ffd0c000000000002344cc793a0f000 */
+ 3.02370610028725823590045201871491395E-32L, /* 3f9639ffe55fa2fa011674448b4e5b96 */
+ 2.65624999999999986893899042596554269E-01L, /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ -2.07683715950724761146070082510569258E-32L, /* bf95af579a92e872fef81abfdf06bae8 */
+ 2.69531249999999979842788204900639327E-01L, /* 3ffd13fffffffffffa30a908d67db000 */
+ 8.71465252506557329027658736641075706E-32L, /* 3f97c47d99e19830447a42b1c0ffac61 */
+ 2.73437500000000006712165837793818271E-01L, /* 3ffd18000000000001ef453a58edb000 */
+ -6.62704045767568912140550474455810301E-32L, /* bf9758187a204dcb06ece46588aeeaba */
+ 2.77343749999999994411329302988535617E-01L, /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ -4.87273466291944117406493607771338767E-32L, /* bf96fa0381b0844a0be46bac2d673f0c */
+ 2.81250000000000012677892447379453135E-01L, /* 3ffd20000000000003a7769e125d6000 */
+ -8.55871796664700790726282049552906783E-32L, /* bf97bc64e01332cf7616b0091b8dff2c */
+ 2.85156249999999998558643013736363981E-01L, /* 3ffd23ffffffffffff95a5894bccf000 */
+ -1.33068334720606220176455289635046875E-32L, /* bf95145f43290ecf5b7adcb24697bc73 */
+ 2.89062500000000008831431235621753924E-01L, /* 3ffd280000000000028ba504fac59000 */
+ -9.34157398616814623985483776710704237E-32L, /* bf97e50ad1115b941fcb5f0c88a428f7 */
+ 2.92968750000000019840235286110877063E-01L, /* 3ffd2c000000000005b7f372d184f000 */
+ 4.99302093775173155906059132992249671E-33L, /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+ 2.96875000000000015867911730971630513E-01L, /* 3ffd3000000000000492d860c79db000 */
+ 7.86107787827057767235127454590866211E-33L, /* 3f944689517ee8f16cdb97d6a6938f32 */
+ 3.00781250000000015814100002286124758E-01L, /* 3ffd340000000000048edfe73a17d000 */
+ -1.65419431293024229981937172317171504E-32L, /* bf9557900e3efca16c89646b57f68dc0 */
+ 3.04687499999999985213157159965287195E-01L, /* 3ffd37fffffffffffbbcec6f99b36000 */
+ 9.68753602893894024018934325652944198E-32L, /* 3f97f70170e5458660c33a7e8d43d049 */
+ 3.08593749999999989969324338045156215E-01L, /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+ 7.10268609610294706092252562643261106E-32L, /* 3f9770cae45cdf615010401a4b37d8d4 */
+ 3.12500000000000002971606591018488854E-01L, /* 3ffd40000000000000db440fbc06b000 */
+ 6.38924218802905979887732294952782964E-32L, /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+ 3.16406250000000006594921047402056305E-01L, /* 3ffd44000000000001e69e8954814000 */
+ 3.96079878754651470094149874444850097E-32L, /* 3f969b5017b9fa7a1e86975258c73d3d */
+ 3.20312500000000006713799366908329147E-01L, /* 3ffd48000000000001ef64159c065000 */
+ -1.86401314975634286055150437995880517E-32L, /* bf958323f0434911794e5fb8bfe136ba */
+ 3.24218749999999987061246567584951210E-01L, /* 3ffd4bfffffffffffc4549db9b928000 */
+ -3.18643523744758601387071062700407431E-32L, /* bf964ae5fa7e26c2c3981bed12e14372 */
+ 3.28124999999999991782776266707412953E-01L, /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ -4.46964199751314296839915534813144652E-32L, /* bf96d0277729ffd74727150df6d15547 */
+ 3.32031250000000000393816557756032682E-01L, /* 3ffd540000000000001d0efc04fad000 */
+ -9.03246333902065439930373230002688649E-33L, /* bf947731a008748cc6dee948839ef7ae */
+ 3.35937499999999983810482995064392173E-01L, /* 3ffd57fffffffffffb556cab8ae61000 */
+ 5.27742727066129518825981597650621794E-32L, /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+ 3.39843750000000004310441349760912471E-01L, /* 3ffd5c0000000000013e0def5ddc4000 */
+ -3.85927263474732591932884416445586106E-32L, /* bf9690c51088ef3db9ca000829c450c2 */
+ 3.43749999999999990248130003997484364E-01L, /* 3ffd5ffffffffffffd3070624a0af000 */
+ 9.62005170171527308106468341512327487E-34L, /* 3f913fae595cea84432eb01430817fca */
+ 3.47656250000000004085726414568625697E-01L, /* 3ffd640000000000012d79309e291000 */
+ -6.59664093705705297250259434519072507E-32L, /* bf97568465eafb0e662e64a5dbfaf35f */
+
+ -1.98364257812501251077851763965418372E-03L, /* bff6040000000001cd90f658cf0b1000 */
+ -3.71984513103117734260309047540278737E-34L, /* bf8fee73c54483194782aac4a6154d11 */
+ -1.95312500000000378520649630233891879E-03L, /* bff60000000000008ba643bb5e2e8000 */
+ -1.12194202736719050440745599339855038E-34L, /* bf8e2a436aeff7bc529873354f47a3f5 */
+ -1.92260742187499397430259771221991482E-03L, /* bff5f7fffffffffe4361cb51170da000 */
+ -2.30068299876822157331268484824540848E-34L, /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ -1.89208984375001137424603270262074989E-03L, /* bff5f0000000000347456ed490c23000 */
+ -1.15012507244426243338260435466985403E-34L, /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ -1.86157226562500172319250342061336738E-03L, /* bff5e800000000007f262fa3617b4000 */
+ -3.12438344643346437509767736937785561E-34L, /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ -1.83105468749999505256246872355430379E-03L, /* bff5dffffffffffe92f18c1c2b6fa000 */
+ -5.91130415288336591179087455220308942E-35L, /* bf8d3a4c80b42dc036bae446c9807f78 */
+ -1.80053710937499445182387245573120522E-03L, /* bff5d7fffffffffe669dea82b4a4c000 */
+ -1.92396289352411531324908916321392100E-34L, /* bf8eff7a2123fb573ba9778550d669bd */
+ -1.77001953125000387737631542516323906E-03L, /* bff5d000000000011e19915c3ddb7000 */
+ 7.91101758977203355387806553469731354E-36L, /* 3f8a507f5a70faaccf469e3461873dea */
+ -1.73950195312500034854670281415554486E-03L, /* bff5c8000000000019b7dc6ef97bd000 */
+ 1.55906551582436824067407021178835755E-34L, /* 3f8e9e7880333e34955aebcde3cfb053 */
+ -1.70898437499998955782591472611429852E-03L, /* bff5bffffffffffcfd80e88aa6b96000 */
+ 8.22951661962611381718215899498500357E-35L, /* 3f8db58e6031a779b59f6ece191de7cc */
+ -1.67846679687500586652037711131708544E-03L, /* bff5b80000000001b0df6fd21c133000 */
+ -8.96642618848426299713145894522897419E-35L, /* bf8ddcbcab46d531801bfae4121f2f8a */
+ -1.64794921875000109499161354039904782E-03L, /* bff5b0000000000050cbce8915575000 */
+ -2.88077905394253859590587789680486639E-34L, /* bf8f7eebd4dd860ef73b674d5e707959 */
+ -1.61743164062501133830507079150388351E-03L, /* bff5a80000000003449e8700c3e82000 */
+ -3.68271725851639066312899986829350273E-34L, /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ -1.58691406249999015546015764131101956E-03L, /* bff59ffffffffffd2999e668cdd28000 */
+ 8.48197657099957029953716507898788812E-35L, /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ -1.55639648437500317366570219290722587E-03L, /* bff5980000000000ea2cd9a40d256000 */
+ -3.45156704719737676412949957712570373E-36L, /* bf8925a079505516c8e317ac1ff53255 */
+ -1.52587890625000568759013197767046039E-03L, /* bff5900000000001a3ab8a3f6b698000 */
+ -1.01902948542497496574967177677556729E-34L, /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ -1.49536132812500945889014955936485340E-03L, /* bff5880000000002b9f1621b57743000 */
+ -3.32264697086631598830366079048117140E-34L, /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ -1.46484374999999931883259902869504725E-03L, /* bff57fffffffffffcdbd1c90e1b4a000 */
+ -1.76487524793892929381101031660811433E-34L, /* bf8ed52f2f724bc1ae870b18356337b4 */
+ -1.43432617187498876325946983333888768E-03L, /* bff577fffffffffcc2dff8faa5570000 */
+ -3.54550084538495708816233114576143814E-34L, /* bf8fd74724576915868c1e8ce9f430f1 */
+ -1.40380859374999215367421282192718062E-03L, /* bff56ffffffffffdbd0b18aac65ed000 */
+ -1.90585907028351204486765167064669639E-34L, /* bf8efaaa0c0e23e50c11b2120348054f */
+ -1.37329101562499692341771212945644892E-03L, /* bff567ffffffffff1cfd00f1b0577000 */
+ -3.59631150411372589637918252836880320E-34L, /* bf8fde08239ac74942a46298ea4fb715 */
+ -1.34277343749999137467356674296739172E-03L, /* bff55ffffffffffd839030b05d53d000 */
+ -1.49571076125940368185068762485268117E-35L, /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ -1.31225585937499247038404301859788734E-03L, /* bff557fffffffffdd469936e691e3000 */
+ 3.10375845385355395586146533282311300E-34L, /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ -1.28173828124999024755581675764821898E-03L, /* bff54ffffffffffd306589b0ab21d000 */
+ -1.98541096105909793397376077900810019E-34L, /* bf8f07e808bbb1e35106c294ffbb9687 */
+ -1.25122070312500340204619591143332523E-03L, /* bff5480000000000fb06d5f16ad2c000 */
+ 3.62884195935761446237911443317457521E-34L, /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ -1.22070312499999591578388993012071279E-03L, /* bff53ffffffffffed2a356c440074000 */
+ -2.96756662615653130862526710937493307E-35L, /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ -1.19018554687498821966212632349422735E-03L, /* bff537fffffffffc9ac3b585dda89000 */
+ 1.44659971891167323357060028901142644E-34L, /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ -1.15966796875000160938908064907298384E-03L, /* bff530000000000076c0800db9639000 */
+ 2.50088010538742402346270685365928513E-34L, /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ -1.12915039062500267151512523291939657E-03L, /* bff5280000000000c51f7e7315137000 */
+ 7.56402096465615210500092443924888831E-35L, /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ -1.09863281249998665006360103291051571E-03L, /* bff51ffffffffffc26f2d4c9ce2ba000 */
+ 1.43982174467233642713619821353592061E-34L, /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ -1.06811523437500522742248711752028025E-03L, /* bff518000000000181b7380f10446000 */
+ 5.41265133745862349181293024531133174E-35L, /* 3f8d1fc9313d018b30e790e06b6be723 */
+ -1.03759765624999980942114138999770552E-03L, /* bff50ffffffffffff1f01130490e1000 */
+ 1.21525139612685854366189534669623436E-34L, /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ -1.00708007812499602697537601515759439E-03L, /* bff507fffffffffedad7afcce7051000 */
+ 1.00020246351201558505328236381833392E-34L, /* 3f8e09e640992512b1300744a7e984ed */
+ -9.76562499999992592487302113340463694E-04L, /* bff4fffffffffffbbad8151f8adf6000 */
+ -1.64984406575162932060422892046851002E-34L, /* bf8eb69a919986e8054b86fc34300f24 */
+ -9.46044921874989085824996924138179594E-04L, /* bff4effffffffff9b55a204fd9792000 */
+ -9.29539174108308550334255350011347171E-35L, /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ -9.15527343750013735214860599791540029E-04L, /* bff4e00000000007eaf5bf103f82d000 */
+ 3.07557018309280519949818825519490586E-35L, /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ -8.85009765625012292294986105781516428E-04L, /* bff4d000000000071605c65403b97000 */
+ 4.77499983783821950338363358545463558E-35L, /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ -8.54492187499986941239470706817188192E-04L, /* bff4bffffffffff878ddf9cab264a000 */
+ -1.60128240346239526958630011447901568E-34L, /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ -8.23974609374996290174598690241743810E-04L, /* bff4affffffffffddc86c249ebe06000 */
+ 1.61677540391961912631535763471935882E-34L, /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ -7.93457031249988696952538334288757473E-04L, /* bff49ffffffffff97bf6f0aa85a5f000 */
+ 1.22318577008381887076634753347515709E-34L, /* 3f8e452db5b5d250878f71040da06d14 */
+ -7.62939453124996723316499040007097041E-04L, /* bff48ffffffffffe1c7265b431108000 */
+ -1.03845161748762410745671891558398468E-34L, /* bf8e14115ad884c96d1a820c73647220 */
+ -7.32421874999998242520117923997325794E-04L, /* bff47ffffffffffefca4498b7aa8a000 */
+ 5.64005211953031009549514026639438083E-35L, /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ -7.01904296874999772890934814265622012E-04L, /* bff46fffffffffffde7c0fe5d8041000 */
+ 5.90245467325173644235991233229525762E-35L, /* 3f8d39d40cc49002189243c194b1db0e */
+ -6.71386718750008699269643939210658742E-04L, /* bff460000000000503c91d798b60c000 */
+ -5.20515801723324452151498579012322191E-35L, /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ -6.40869140625005499535275057463709988E-04L, /* bff45000000000032b969184e9751000 */
+ -6.69469163285461870099846471658294534E-35L, /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ -6.10351562499999293780097329596079841E-04L, /* bff43fffffffffff97c7c433e35ed000 */
+ -1.16941808547394177991845382085515086E-34L, /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ -5.79833984375000068291972326409994795E-04L, /* bff43000000000000a13ff6dcf2bf000 */
+ 1.17885044988246219185041488459766001E-34L, /* 3f8e3964677e001a00412aab52790842 */
+ -5.49316406249990904622170867910987793E-04L, /* bff41ffffffffffac1c25739c716b000 */
+ -3.31875702128137033065075734368960972E-35L, /* bf8c60e928d8982c3c99aef4f885a121 */
+ -5.18798828125011293653756992177727236E-04L, /* bff410000000000682a62cff36775000 */
+ -5.69971237642088463334239430962628187E-35L, /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ -4.88281249999990512232251384917893121E-04L, /* bff3fffffffffff50fb48992320df000 */
+ 1.02144616714408655325510171265051108E-35L, /* 3f8ab279a3626612710b9b3ac71734ac */
+ -4.57763671874997554564967307956493434E-04L, /* bff3dffffffffffd2e3c272e3cca9000 */
+ -8.25484058867957231164162481843653503E-35L, /* bf8db6e71158e7bf93e2e683f07aa841 */
+ -4.27246093749991203999790346349633286E-04L, /* bff3bffffffffff5dbe103cba0eb2000 */
+ -3.51191203319375193921924105905691755E-35L, /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ -3.96728515624986649402960638705483281E-04L, /* bff39ffffffffff09b996882706ec000 */
+ -5.51925962073095883016589497244931171E-36L, /* bf89d586d49f22289cfc860bebb99056 */
+ -3.66210937499999945095511981300980754E-04L, /* bff37fffffffffffefcb88bfc7df6000 */
+ -2.11696465278144529364423332249588595E-35L, /* bf8bc23a84d28e5496c874ef9833be25 */
+ -3.35693359374992480958458008559640163E-04L, /* bff35ffffffffff754c548a8798f2000 */
+ -8.58941791799705081104736787493668352E-35L, /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ -3.05175781250009811036303273640122156E-04L, /* bff340000000000b4fb4f1aad1c76000 */
+ -8.61173897858769926480551302277426632E-35L, /* bf8dc9e0eabb1c0b33051011b64769fa */
+ -2.74658203124987298321920308390303850E-04L, /* bff31ffffffffff15b2056ac252fd000 */
+ 3.35152809454778381053519808988046631E-37L, /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ -2.44140624999999992770514819575735516E-04L, /* bff2fffffffffffffbbb82d6a7636000 */
+ 3.54445837111124472730013879165516908E-35L, /* 3f8c78e955b01378be647b1c92aa9a77 */
+ -2.13623046875012756463165168672749438E-04L, /* bff2c0000000001d6a1635fea6bbf000 */
+ 1.50050816288650121729916777279129473E-35L, /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ -1.83105468749991323078784464300306893E-04L, /* bff27fffffffffebfe0cbd0c82399000 */
+ -9.14919506501448661140572099029756008E-37L, /* bf873754bacaa9d9513b6127e791eb47 */
+ -1.52587890625013337032336300236461546E-04L, /* bff240000000001ec0cb57f2cc995000 */
+ 2.84906084373176180870418394956384516E-35L, /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ -1.22070312499990746786116828458007518E-04L, /* bff1ffffffffffd553bbb49f35a34000 */
+ 6.71618008964968339584520728412444537E-36L, /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ -9.15527343750029275602791047595142231E-05L, /* bff180000000000d8040cd6ecde28000 */
+ -1.95753652091078750312541716951402172E-35L, /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ -6.10351562499913258461494008080572701E-05L, /* bff0ffffffffffaffebbb92d7f6a9000 */
+ 5.69868489273961111703398456218119973E-36L, /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ -3.05175781250092882818419203884960853E-05L, /* bff0000000000055ab55de88fac1d000 */
+ 9.03341100018476837609128961872915953E-36L, /* 3f8a803d229fa3a0e834a63abb06662b */
+#define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 3.05175781249814607084128277672749162E-05L, /* 3feffffffffffeaa02abb9102f499000 */
+ 1.00271855391179733380665816525889949E-36L, /* 3f8755351afa042ac3f58114824d4c10 */
+ 6.10351562500179243748093427073421439E-05L, /* 3ff1000000000052a95de07a4c26d000 */
+ 1.67231624299180373502350811501181670E-36L, /* 3f881c87a53691cae9d77f4e40d66616 */
+ 9.15527343749970728685313252158399200E-05L, /* 3ff17ffffffffff28040cc2acde28000 */
+ 2.43665747834893104318707597514407880E-36L, /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+ 1.22070312500027751961838150070880064E-04L, /* 3ff200000000003ffddde6c153b53000 */
+ -1.73322146370624186623546452226755405E-35L, /* bf8b709d8d658ed5dbbe943de56ee84e */
+ 1.52587890624995916105682628143179430E-04L, /* 3ff23ffffffffff6954b56e285d23000 */
+ 1.23580432650945898349135528000443828E-35L, /* 3f8b06d396601dde16de7d7bc27346e6 */
+ 1.83105468750008670314358488289621794E-04L, /* 3ff2800000000013fe0cdc8c823b7000 */
+ 4.30446229148833293310207915930740796E-35L, /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+ 2.13623046875005741337455947623248132E-04L, /* 3ff2c0000000000d3d1662de21a3f000 */
+ -3.96110759869520786681660669615255057E-35L, /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+ 2.44140624999981493573336463433440506E-04L, /* 3ff2ffffffffffd553bbdf48e0534000 */
+ -1.39617373942387888957350179316792928E-35L, /* bf8b28eeedc286015802b63f96b8c5cd */
+ 2.74658203124984920706309918754626834E-04L, /* 3ff31fffffffffee9d60c8439ec1d000 */
+ -3.16168080483901830349738314447356223E-36L, /* bf890cf74f81c77a611abc1243812444 */
+ 3.05175781250008648918265055410966055E-04L, /* 3ff3400000000009f8b5c9a346636000 */
+ 8.54421306185008998867856704677221443E-35L, /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+ 3.35693359374988945462612499316774515E-04L, /* 3ff35ffffffffff34146c540f15b2000 */
+ 7.96443137431639500475160850431097078E-35L, /* 3f8da77638ed3148fc4d99d1c9e13446 */
+ 3.66210937500027690542093987739604535E-04L, /* 3ff380000000001fecce34bea89c4000 */
+ 2.14507323877752361258862577769090367E-35L, /* 3f8bc834e554d38894cf91957b0253d3 */
+ 3.96728515625003928083564943615052121E-04L, /* 3ff3a00000000004875d9a4acf6ab000 */
+ 4.88358523466632050664019922448605508E-35L, /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+ 4.27246093750017799227172345607351585E-04L, /* 3ff3c00000000014856794c3ee850000 */
+ 6.66520494592631402182216588784828935E-35L, /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+ 4.57763671875002108342364320152138181E-04L, /* 3ff3e000000000026e45d855410b9000 */
+ 7.21799615960261390920033272189522298E-35L, /* 3f8d7fc645cff8879462296af975c9fd */
+ 4.88281249999999768797631616370963356E-04L, /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ -5.30564629906905979452258114088325361E-35L, /* bf8d1a18b71929a30d67a217a27ae851 */
+ 5.18798828124997339054881383202487041E-04L, /* 3ff40ffffffffffe775055eea5851000 */
+ -4.03682911253647925867848180522846377E-35L, /* bf8cad44f0f3e5199d8a589d9332acad */
+ 5.49316406249980511907933706754958501E-04L, /* 3ff41ffffffffff4c410b29bb62fb000 */
+ -2.08166843948323917121806956728438051E-35L, /* bf8bbab8cf691403249fe5b699e25143 */
+ 5.79833984374989593561576568548497165E-04L, /* 3ff42ffffffffffa0047df328d817000 */
+ -1.72745033420153042445343706432627539E-34L, /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+ 6.10351562500008540711511259540838154E-04L, /* 3ff4400000000004ec62f54f8c271000 */
+ 7.41889382604319545724663095428976499E-35L, /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+ 6.40869140625020444702875407535884986E-04L, /* 3ff450000000000bc91b09718515d000 */
+ -4.47321009727305792048065440180490107E-35L, /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+ 6.71386718750007531635964622352684074E-04L, /* 3ff460000000000457792973db05c000 */
+ 5.13698959677949336513874456684462092E-35L, /* 3f8d112114436949c5ef38d8049004ab */
+ 7.01904296875006634673332887754430334E-04L, /* 3ff4700000000003d31adf2cb8b1d000 */
+ -8.25665755717729437292989870760751482E-35L, /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+ 7.32421874999998244664170215504673504E-04L, /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ -5.64005234937832153139057628112753364E-35L, /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+ 7.62939453125017456345986752604096408E-04L, /* 3ff490000000000a101a1b093d4a8000 */
+ -1.11084094120417622468550608896588329E-34L, /* bf8e274feabd2d94f6694507a46accb1 */
+ 7.93457031249987558617598988993908016E-04L, /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ -1.22966480225449015129079129940978828E-34L, /* bf8e46e6a65eef8fa9e42eddf3da305e */
+ 8.23974609374997378723747633335135819E-04L, /* 3ff4affffffffffe7d2afbaa55b26000 */
+ -1.62270010016794279091906973366704963E-34L, /* bf8eaf633f057ebdb664a34566401c4e */
+ 8.54492187500023938282350821569920958E-04L, /* 3ff4c0000000000dccaabce399e59000 */
+ -1.39076361712838158775374263169606160E-34L, /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+ 8.85009765624987932362186815286691297E-04L, /* 3ff4cffffffffff90b218886edc2a000 */
+ 4.07328275060905585228261577392403980E-35L, /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+ 9.15527343749975579461305518559161974E-04L, /* 3ff4dffffffffff1ec2a21f25df33000 */
+ 1.16855112459192484947855553716334015E-35L, /* 3f8af10bf319e9f5270cf249eeffbe5c */
+ 9.46044921875016761584725882821122521E-04L, /* 3ff4f00000000009a992c46c16d71000 */
+ 9.51660680007524262741115611071680436E-35L, /* 3f8df9fd56e81f8edf133843910ee831 */
+ 9.76562499999974118878133088548272636E-04L, /* 3ff4fffffffffff1149edc46a6df6000 */
+ -5.65271128977550656964071208289181661E-36L, /* bf89e0e12689dd721aa2314c81eb6429 */
+ 1.00708007812498671732140389760347830E-03L, /* 3ff507fffffffffc2be94b90ed091000 */
+ -1.43355074891483635310132767255371379E-34L, /* bf8e7d1a688c247b16022daab1316d55 */
+ 1.03759765625002637786192745235343007E-03L, /* 3ff51000000000079a57b966bc158000 */
+ 2.95905815240957629366749917020106928E-34L, /* 3f8f895387fc73bb38f8a1b254c01a60 */
+ 1.06811523437500860568717813047520763E-03L, /* 3ff51800000000027afcd5b35f5e6000 */
+ -5.98328495358586628195372356742878314E-35L, /* bf8d3e204130013bf6328f1b70ff8c76 */
+ 1.09863281250001439958487251556220070E-03L, /* 3ff5200000000004268077c6c66bd000 */
+ 2.41371837889426603334113000868144760E-34L, /* 3f8f40d6948edf864054ccf151f9815e */
+ 1.12915039062501298413451613770002366E-03L, /* 3ff5280000000003be0f5dd8fe81b000 */
+ -1.28815268997394164973472617519705703E-34L, /* bf8e567321172ea089dce4bc8354ecb7 */
+ 1.15966796874997272036339054191407232E-03L, /* 3ff52ffffffffff8231e3bcfff1e8000 */
+ 1.02996064554316248496839462594377804E-34L, /* 3f8e11cf7d402789244f68e2d4f985b1 */
+ 1.19018554687502744121802585360546796E-03L, /* 3ff5380000000007e8cdf3f8f6c20000 */
+ -1.43453217726255628994625761307322163E-34L, /* bf8e7d5d3370d85a374f5f4802fc517a */
+ 1.22070312499997743541996266398850614E-03L, /* 3ff53ffffffffff97f0722561f454000 */
+ -1.41086259180534339713692694428211646E-34L, /* bf8e77125519ff76244dfec5fbd58402 */
+ 1.25122070312501024092560690174507039E-03L, /* 3ff5480000000002f3a59d8820691000 */
+ 3.84102646020099293168698506729765213E-34L, /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+ 1.28173828124997986521442660131425390E-03L, /* 3ff54ffffffffffa3250a764439d9000 */
+ 1.44644589735033114377952806106652650E-34L, /* 3f8e808801b80dcf38323cdbfdca2549 */
+ 1.31225585937501665804856968749058137E-03L, /* 3ff5580000000004cd25a414c6d62000 */
+ 1.67474574742200577294563576414361377E-34L, /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+ 1.34277343749997290265837386401818888E-03L, /* 3ff55ffffffffff83091b042cfd59000 */
+ -1.55650565030381326742591837551559103E-34L, /* bf8e9dca490d7fecfadba9625ffb91c5 */
+ 1.37329101562497720784949380297774268E-03L, /* 3ff567fffffffff96e3c7312f5ccf000 */
+ 1.65279335325630026116581677369221748E-34L, /* 3f8eb763496f5bd7404f2298b402074f */
+ 1.40380859374999099958354100336136647E-03L, /* 3ff56ffffffffffd67e2f09f2a381000 */
+ 1.89919944388961890195706641264717076E-34L, /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+ 1.43432617187497484122173130998160625E-03L, /* 3ff577fffffffff8bf9c1d71af8a8000 */
+ 2.57638517142061429772064578590009568E-34L, /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+ 1.46484374999999929342158925502052945E-03L, /* 3ff57fffffffffffcbdd1c7671b46000 */
+ 1.76487201934184070490166772482073801E-34L, /* 3f8ed52ef732458f6e4c5c07504f33cc */
+ 1.49536132812502318451070466256902933E-03L, /* 3ff5880000000006aeb7066c8ad43000 */
+ 2.38068367275295804321313550609246656E-34L, /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+ 1.52587890625000448053340248672949543E-03L, /* 3ff59000000000014a9ae2104b3bc000 */
+ 1.01174455568392813258454590274740959E-34L, /* 3f8e0cf7c434762991bb38e12acee215 */
+ 1.55639648437501113499837053523090913E-03L, /* 3ff5980000000003359e2c204355e000 */
+ -2.82398418808099749023517211651363693E-35L, /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+ 1.58691406249999937955142588308171026E-03L, /* 3ff59fffffffffffd2380ecbc87c2000 */
+ -1.27361695572422741562701199136538047E-34L, /* bf8e5295e0e206dfb0f0266c07225448 */
+ 1.61743164062498000531048954475329309E-03L, /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ -1.22606548862580061633942923016222044E-34L, /* bf8e45f1b17bb61039d21a351bb207b8 */
+ 1.64794921875001835451453858682255576E-03L, /* 3ff5b000000000054a52fa20f6565000 */
+ 1.39132339594152335892305491425264583E-34L, /* 3f8e71e0904c5449b414ee49b191cef2 */
+ 1.67846679687501263995029340691547953E-03L, /* 3ff5b80000000003a4a9e912c910b000 */
+ 6.67245854693585315412242764786197029E-35L, /* 3f8d62c4ccac1e7511a617d469468ccd */
+ 1.70898437500002646861403514115369655E-03L, /* 3ff5c00000000007a109fbaa7e015000 */
+ 6.87367172354719289559624829652240928E-36L, /* 3f8a245fa835eceb42bae8128d9336db */
+ 1.73950195312501174308226096992992128E-03L, /* 3ff5c80000000003627c8d637a005000 */
+ -2.20824271875474985927385878948759352E-34L, /* bf8f25869b1cbefb25e735992f232f57 */
+ 1.77001953124997491747605207736194513E-03L, /* 3ff5cffffffffff8c53c84b6883b8000 */
+ 3.43123048533596296514343180408963705E-34L, /* 3f8fc816b91d173ddadbbf09b1287906 */
+ 1.80053710937497698911127570705069398E-03L, /* 3ff5d7fffffffff95e1899f4a8430000 */
+ 3.99231237340890073475077494556136100E-35L, /* 3f8ca889148f62fa854da5674df41279 */
+ 1.83105468750002267094899598630423914E-03L, /* 3ff5e0000000000688d21e62ba674000 */
+ -3.22274595655810623999007524769365273E-34L, /* bf8fac605cb9ae01eb719675ced25560 */
+ 1.86157226562500499224728040579690330E-03L, /* 3ff5e80000000001705ce28a6d89e000 */
+ 3.07094985075881613489605622068441083E-34L, /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+ 1.89208984374998234666824993196980949E-03L, /* 3ff5effffffffffae969fdc7cd8cf000 */
+ -3.06287628722973914692165056776495733E-34L, /* bf8f9720477d9cfa10e464df7f91020c */
+ 1.92260742187501225343755557292811682E-03L, /* 3ff5f800000000038824e428ed49a000 */
+ 6.30049124729794620592961282769623368E-35L, /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+ 1.95312499999998514894032051116231258E-03L, /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ -6.14610057507500948543216998736262902E-35L, /* bf8d46c862d39255370e7974d48daa7e */
+ 1.98364257812501222021119324146882732E-03L, /* 3ff6040000000001c2d8a1aa5188d000 */
+ 3.71942298418113774118754986159801984E-34L, /* 3f8fee6567d9940495519ffe62cbc9a4 */
+
+ 7.06341639425619532977052017486130353E-01L, /* 3ffe69a59c8245a9ac00000000000000 */
+ 7.09106182437398424589503065362805501E-01L, /* 3ffe6b0ff72deb89d000000000000000 */
+ 7.11881545564596485142772053222870454E-01L, /* 3ffe6c7bbce9a6d93000000000000000 */
+ 7.14667771155948150507697391731198877E-01L, /* 3ffe6de8ef213d71e000000000000000 */
+ 7.17464901725936049503573599395167548E-01L, /* 3ffe6f578f41e1a9e400000000000000 */
+ 7.20272979955439790478166628417966422E-01L, /* 3ffe70c79eba33c06c00000000000000 */
+ 7.23092048692387218133958981525211129E-01L, /* 3ffe72391efa434c7400000000000000 */
+ 7.25922150952408251622927082280511968E-01L, /* 3ffe73ac117390acd800000000000000 */
+ 7.28763329919491220643124052003258839E-01L, /* 3ffe752077990e79d000000000000000 */
+ 7.31615628946641782803794740175362676E-01L, /* 3ffe769652df22f7e000000000000000 */
+ 7.34479091556544505525749855223693885E-01L, /* 3ffe780da4bba98c4800000000000000 */
+ 7.37353761442226890432394270646909717E-01L, /* 3ffe79866ea5f432d400000000000000 */
+ 7.40239682467726090031590047146892175E-01L, /* 3ffe7b00b216ccf53000000000000000 */
+ 7.43136898668758316688354170764796436E-01L, /* 3ffe7c7c70887763c000000000000000 */
+ 7.46045454253390638577059235103661194E-01L, /* 3ffe7df9ab76b20fd000000000000000 */
+ 7.48965393602715662213498148958024103E-01L, /* 3ffe7f78645eb8076400000000000000 */
+ 7.51896761271528629722027403659012634E-01L, /* 3ffe80f89cbf42526400000000000000 */
+ 7.54839601989007347171423134568613023E-01L, /* 3ffe827a561889716000000000000000 */
+ 7.57793960659394638668118204805068672E-01L, /* 3ffe83fd91ec46ddc000000000000000 */
+ 7.60759882362683631518152083117456641E-01L, /* 3ffe858251bdb68b8c00000000000000 */
+ 7.63737412355305483879774897104653064E-01L, /* 3ffe87089711986c9400000000000000 */
+ 7.66726596070820082262642358728044201E-01L, /* 3ffe8890636e31f54400000000000000 */
+ 7.69727479120609181517664865168626420E-01L, /* 3ffe8a19b85b4fa2d800000000000000 */
+ 7.72740107294572486917871856348938309E-01L, /* 3ffe8ba4976246833800000000000000 */
+ 7.75764526561826289752232810315035749E-01L, /* 3ffe8d31020df5be4400000000000000 */
+ 7.78800783071404878477039801509818062E-01L, /* 3ffe8ebef9eac820b000000000000000 */
+ 7.81848923152964780936002853195532225E-01L, /* 3ffe904e8086b5a87800000000000000 */
+ 7.84908993317491698871180005880887620E-01L, /* 3ffe91df97714512d800000000000000 */
+ 7.87981040258010162480317717381694820E-01L, /* 3ffe9372403b8d6bcc00000000000000 */
+ 7.91065110850296016042904057030682452E-01L, /* 3ffe95067c78379f2800000000000000 */
+ 7.94161252153591734614934694036492147E-01L, /* 3ffe969c4dbb800b4800000000000000 */
+ 7.97269511411324433014513601847284008E-01L, /* 3ffe9833b59b38154400000000000000 */
+ 8.00389936051826789142893403550260700E-01L, /* 3ffe99ccb5aec7bec800000000000000 */
+ 8.03522573689060742863077280162542593E-01L, /* 3ffe9b674f8f2f3d7c00000000000000 */
+ 8.06667472123343942680406826184480451E-01L, /* 3ffe9d0384d70893f800000000000000 */
+ 8.09824679342079301047618855591281317E-01L, /* 3ffe9ea15722892c7800000000000000 */
+ 8.12994243520486992160556383169023320E-01L, /* 3ffea040c80f8374f000000000000000 */
+ 8.16176213022339780422953481320291758E-01L, /* 3ffea1e1d93d687d0000000000000000 */
+ 8.19370636400700819157449927843117621E-01L, /* 3ffea3848c4d49954c00000000000000 */
+ 8.22577562398664585696650419777142815E-01L, /* 3ffea528e2e1d9f09800000000000000 */
+ 8.25797039950100647542896581398963463E-01L, /* 3ffea6cede9f70467c00000000000000 */
+ 8.29029118180400342863478613253391813E-01L, /* 3ffea876812c0877bc00000000000000 */
+ 8.32273846407226292054559735333896242E-01L, /* 3ffeaa1fcc2f45343800000000000000 */
+ 8.35531274141265073440720811959181447E-01L, /* 3ffeabcac15271a2a400000000000000 */
+ 8.38801451086982535754188461396552157E-01L, /* 3ffead7762408309bc00000000000000 */
+ 8.42084427143382358016410194068157580E-01L, /* 3ffeaf25b0a61a7b4c00000000000000 */
+ 8.45380252404767357221615498019673396E-01L, /* 3ffeb0d5ae318680c400000000000000 */
+ 8.48688977161503960155997106085123960E-01L, /* 3ffeb2875c92c4c99400000000000000 */
+ 8.52010651900789478530029441571969073E-01L, /* 3ffeb43abd7b83db1c00000000000000 */
+ 8.55345327307422548246407245642330963E-01L, /* 3ffeb5efd29f24c26400000000000000 */
+ 8.58693054264576483003423845730139874E-01L, /* 3ffeb7a69db2bcc77800000000000000 */
+ 8.62053883854575708767242758767679334E-01L, /* 3ffeb95f206d17228000000000000000 */
+ 8.65427867359675251357487013592617586E-01L, /* 3ffebb195c86b6b29000000000000000 */
+ 8.68815056262843166123843730019871145E-01L, /* 3ffebcd553b9d7b62000000000000000 */
+ 8.72215502248546159513864495238522068E-01L, /* 3ffebe9307c271855000000000000000 */
+ 8.75629257203538208242932228131394368E-01L, /* 3ffec0527a5e384ddc00000000000000 */
+ 8.79056373217652342599848225290770642E-01L, /* 3ffec213ad4c9ed0d800000000000000 */
+ 8.82496902584595399599010079327854328E-01L, /* 3ffec3d6a24ed8221800000000000000 */
+ 8.85950897802745995779361010136199184E-01L, /* 3ffec59b5b27d9696800000000000000 */
+ 8.89418411575955636383383762222365476E-01L, /* 3ffec761d99c5ba58800000000000000 */
+ 8.92899496814352794382685374330321793E-01L, /* 3ffec92a1f72dd70d400000000000000 */
+ 8.96394206635150403439382671422208659E-01L, /* 3ffecaf42e73a4c7d800000000000000 */
+ 8.99902594363456265202927397695020773E-01L, /* 3ffeccc00868c0d18800000000000000 */
+ 9.03424713533086704009278378180169966E-01L, /* 3ffece8daf1e0ba94c00000000000000 */
+ 9.06960617887383580004723171441582963E-01L, /* 3ffed05d24612c2af000000000000000 */
+ 9.10510361380034133338412516422977205E-01L, /* 3ffed22e6a0197c02c00000000000000 */
+ 9.14073998175894436579724811053893063E-01L, /* 3ffed40181d094303400000000000000 */
+ 9.17651582651815816982221463149471674E-01L, /* 3ffed5d66da13970f400000000000000 */
+ 9.21243169397474526149949269893113524E-01L, /* 3ffed7ad2f48737a2000000000000000 */
+ 9.24848813216204823639543519675498828E-01L, /* 3ffed985c89d041a3000000000000000 */
+ 9.28468569125835141431224428743007593E-01L, /* 3ffedb603b7784cd1800000000000000 */
+ 9.32102492359527579068867453315760940E-01L, /* 3ffedd3c89b26894e000000000000000 */
+ 9.35750638366620729469147477175283711E-01L, /* 3ffedf1ab529fdd41c00000000000000 */
+ 9.39413062813475779888605643463961314E-01L, /* 3ffee0fabfbc702a3c00000000000000 */
+ 9.43089821584325888048638830696290825E-01L, /* 3ffee2dcab49ca51b400000000000000 */
+ 9.46780970782128888929563004239753354E-01L, /* 3ffee4c079b3f8000400000000000000 */
+ 9.50486566729423443256052905780961737E-01L, /* 3ffee6a62cdec7c7b000000000000000 */
+ 9.54206665969188322362626308859034907E-01L, /* 3ffee88dc6afecfbfc00000000000000 */
+ 9.57941325265705301283958306157728657E-01L, /* 3ffeea77490f0196b000000000000000 */
+ 9.61690601605425299247542625380447134E-01L, /* 3ffeec62b5e5881fb000000000000000 */
+ 9.65454552197837823079851204965962097E-01L, /* 3ffeee500f1eed967000000000000000 */
+ 9.69233234476344074348475032820715569E-01L, /* 3ffef03f56a88b5d7800000000000000 */
+ 9.73026706099133165128733935489435680E-01L, /* 3ffef2308e71a927a800000000000000 */
+ 9.76835024950062025261843245971249416E-01L, /* 3ffef423b86b7ee79000000000000000 */
+ 9.80658249139538557015427500118676107E-01L, /* 3ffef618d68936c09c00000000000000 */
+ 9.84496437005408397968864164795377292E-01L, /* 3ffef80feabfeefa4800000000000000 */
+ 9.88349647113845042323276857132441364E-01L, /* 3ffefa08f706bbf53800000000000000 */
+ 9.92217938260243514925207364285597578E-01L, /* 3ffefc03fd56aa225000000000000000 */
+ 9.96101369470117486981664001177705359E-01L, /* 3ffefe00ffaabffbbc00000000000000 */
+#define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
+ 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ 1.00391388933834757590801700644078664E+00L, /* 3fff0100802ab5577800000000000000 */
+ 1.00784309720644799091004983893071767E+00L, /* 3fff0202015600445c00000000000000 */
+ 1.01178768355933151879000320150225889E+00L, /* 3fff0304848362076c00000000000000 */
+ 1.01574770858668572692806719715008512E+00L, /* 3fff04080ab55de39000000000000000 */
+ 1.01972323271377413034244341361045372E+00L, /* 3fff050c94ef7a206c00000000000000 */
+ 1.02371431660235789884438872832106426E+00L, /* 3fff06122436410dd000000000000000 */
+ 1.02772102115162167201845022646011785E+00L, /* 3fff0718b98f42085000000000000000 */
+ 1.03174340749910264936062276319717057E+00L, /* 3fff08205601127ec800000000000000 */
+ 1.03578153702162378824169763902318664E+00L, /* 3fff0928fa934ef90800000000000000 */
+ 1.03983547133622999947277776300325058E+00L, /* 3fff0a32a84e9c1f5800000000000000 */
+ 1.04390527230112850620713516036630608E+00L, /* 3fff0b3d603ca7c32800000000000000 */
+ 1.04799100201663270004459604933799710E+00L, /* 3fff0c49236829e8bc00000000000000 */
+ 1.05209272282610977189420964350574650E+00L, /* 3fff0d55f2dce5d1e800000000000000 */
+ 1.05621049731693195106174698594259098E+00L, /* 3fff0e63cfa7ab09d000000000000000 */
+ 1.06034438832143151909548350886325352E+00L, /* 3fff0f72bad65671b800000000000000 */
+ 1.06449445891785943185681162503897212E+00L, /* 3fff1082b577d34ed800000000000000 */
+ 1.06866077243134810492719566354935523E+00L, /* 3fff1193c09c1c595c00000000000000 */
+ 1.07284339243487741866189821848820429E+00L, /* 3fff12a5dd543ccc4c00000000000000 */
+ 1.07704238275024494209120007326419000E+00L, /* 3fff13b90cb25176a400000000000000 */
+ 1.08125780744903959851299646288680378E+00L, /* 3fff14cd4fc989cd6400000000000000 */
+ 1.08548973085361949442173568058933597E+00L, /* 3fff15e2a7ae28fecc00000000000000 */
+ 1.08973821753809324563988525369495619E+00L, /* 3fff16f9157587069400000000000000 */
+ 1.09400333232930546678574046381982043E+00L, /* 3fff18109a3611c35000000000000000 */
+ 1.09828514030782586896606289883493446E+00L, /* 3fff192937074e0cd800000000000000 */
+ 1.10258370680894224324930519287590869E+00L, /* 3fff1a42ed01d8cbc800000000000000 */
+ 1.10689909742365749645287564817408565E+00L, /* 3fff1b5dbd3f68122400000000000000 */
+ 1.11123137799969046168868658241990488E+00L, /* 3fff1c79a8dacc350c00000000000000 */
+ 1.11558061464248076122274255794764031E+00L, /* 3fff1d96b0eff0e79400000000000000 */
+ 1.11994687371619722204840741142106708E+00L, /* 3fff1eb4d69bde569c00000000000000 */
+ 1.12433022184475073235176978414529003E+00L, /* 3fff1fd41afcba45e800000000000000 */
+ 1.12873072591281087273529237791080959E+00L, /* 3fff20f47f31c92e4800000000000000 */
+ 1.13314845306682632219974493636982515E+00L, /* 3fff2216045b6f5cd000000000000000 */
+ 1.13758347071604959399593326452304609E+00L, /* 3fff2338ab9b32134800000000000000 */
+ 1.14203584653356560174586320499656722E+00L, /* 3fff245c7613b8a9b000000000000000 */
+ 1.14650564845732405583333957110880874E+00L, /* 3fff258164e8cdb0d800000000000000 */
+ 1.15099294469117646722011727433709893E+00L, /* 3fff26a7793f60164400000000000000 */
+ 1.15549780370591653744227755851170514E+00L, /* 3fff27ceb43d84490400000000000000 */
+ 1.16002029424032515603215642840950750E+00L, /* 3fff28f7170a755fd800000000000000 */
+ 1.16456048530221917269855680387991015E+00L, /* 3fff2a20a2ce96406400000000000000 */
+ 1.16911844616950438835445424956560601E+00L, /* 3fff2b4b58b372c79400000000000000 */
+ 1.17369424639123270948104504896036815E+00L, /* 3fff2c7739e3c0f32c00000000000000 */
+ 1.17828795578866324378353169777255971E+00L, /* 3fff2da4478b620c7400000000000000 */
+ 1.18289964445632783673900689791480545E+00L, /* 3fff2ed282d763d42400000000000000 */
+ 1.18752938276310060494722620205720887E+00L, /* 3fff3001ecf601af7000000000000000 */
+ 1.19217724135327157730657177125976887E+00L, /* 3fff31328716a5d63c00000000000000 */
+ 1.19684329114762477708211463323095813E+00L, /* 3fff32645269ea829000000000000000 */
+ 1.20152760334452030077656559114984702E+00L, /* 3fff339750219b212c00000000000000 */
+ 1.20623024942098072687102217059873510E+00L, /* 3fff34cb8170b5835400000000000000 */
+ 1.21095130113378179892436037334846333E+00L, /* 3fff3600e78b6b11d000000000000000 */
+ 1.21569083052054743854242246925423387E+00L, /* 3fff373783a722012400000000000000 */
+ 1.22044890990084875515009343871497549E+00L, /* 3fff386f56fa7686e800000000000000 */
+ 1.22522561187730755216662714701669756E+00L, /* 3fff39a862bd3c106400000000000000 */
+ 1.23002100933670455162882717559114099E+00L, /* 3fff3ae2a8287e7a8000000000000000 */
+ 1.23483517545109100499445276000187732E+00L, /* 3fff3c1e2876834aa800000000000000 */
+ 1.23966818367890557750499169742397498E+00L, /* 3fff3d5ae4e2cae92c00000000000000 */
+ 1.24452010776609517384017067342938390E+00L, /* 3fff3e98deaa11dcbc00000000000000 */
+ 1.24939102174724003813111039562500082E+00L, /* 3fff3fd8170a52071800000000000000 */
+ 1.25428099994668373895478907797951251E+00L, /* 3fff41188f42c3e32000000000000000 */
+ 1.25919011697966698459794088194030337E+00L, /* 3fff425a4893dfc3f800000000000000 */
+ 1.26411844775346637881341393949696794E+00L, /* 3fff439d443f5f159000000000000000 */
+ 1.26906606746853711786826579555054195E+00L, /* 3fff44e183883d9e4800000000000000 */
+ 1.27403305161966090564007458851847332E+00L, /* 3fff462707b2bac20c00000000000000 */
+ 1.27901947599709753244923149395617656E+00L, /* 3fff476dd2045ac67800000000000000 */
+ 1.28402541668774150540599521264084615E+00L, /* 3fff48b5e3c3e8186800000000000000 */
+ 1.28905095007628295311619126550795045E+00L, /* 3fff49ff3e397492bc00000000000000 */
+ 1.29409615284637330434591717676084954E+00L, /* 3fff4b49e2ae5ac67400000000000000 */
+ 1.29916110198179535206719492634874769E+00L, /* 3fff4c95d26d3f440800000000000000 */
+ 1.30424587476763775839572190307080746E+00L, /* 3fff4de30ec211e60000000000000000 */
+ 1.30935054879147461104338390214252286E+00L, /* 3fff4f3198fa0f1cf800000000000000 */
+ 1.31447520194454914310711046709911898E+00L, /* 3fff50817263c13cd000000000000000 */
+ 1.31961991242296217130558488861424848E+00L, /* 3fff51d29c4f01cb3000000000000000 */
+ 1.32478475872886558573071624778094701E+00L, /* 3fff5325180cfacf7800000000000000 */
+ 1.32996981967165983640200010995613411E+00L, /* 3fff5478e6f02823d000000000000000 */
+ 1.33517517436919680440254865061433520E+00L, /* 3fff55ce0a4c58c7bc00000000000000 */
+ 1.34040090224898678084031189428060316E+00L, /* 3fff57248376b033d800000000000000 */
+ 1.34564708304941055283521222918352578E+00L, /* 3fff587c53c5a7af0400000000000000 */
+ 1.35091379682093615244298234756570309E+00L, /* 3fff59d57c910fa4e000000000000000 */
+ 1.35620112392734021300455538039386738E+00L, /* 3fff5b2fff3210fd9400000000000000 */
+ 1.36150914504693443252136830778908916E+00L, /* 3fff5c8bdd032e770800000000000000 */
+ 1.36683794117379636690046140756749082E+00L, /* 3fff5de9176045ff5400000000000000 */
+ 1.37218759361900544124779344201670028E+00L, /* 3fff5f47afa69210a800000000000000 */
+ 1.37755818401188367960941150158760138E+00L, /* 3fff60a7a734ab0e8800000000000000 */
+ 1.38294979430124120867162673675920814E+00L, /* 3fff6208ff6a88a46000000000000000 */
+ 1.38836250675662681297595213436579797E+00L, /* 3fff636bb9a983258400000000000000 */
+ 1.39379640396958309755959248832368758E+00L, /* 3fff64cfd75454ee7c00000000000000 */
+ 1.39925156885490681313299887733592186E+00L, /* 3fff663559cf1bc7c400000000000000 */
+ 1.40472808465191417726103395580139477E+00L, /* 3fff679c427f5a49f400000000000000 */
+ 1.41022603492571069194738697660795879E+00L, /* 3fff690492cbf9432c00000000000000 */
+ 1.41574550356846662335641440222389065E+00L, /* 3fff6a6e4c1d491e1800000000000000 */
+
+ 9.98018323540573404351050612604012713E-01L, /* 3ffefefc41f8d4bdb000000000000000 */
+ 9.98048781107475468932221929208026268E-01L, /* 3ffeff003ff556aa8800000000000000 */
+ 9.98079239603882895082165305211674422E-01L, /* 3ffeff043df9d4986000000000000000 */
+ 9.98109699029824021243584297735651489E-01L, /* 3ffeff083c064e972c00000000000000 */
+ 9.98140159385327269125909310787392315E-01L, /* 3ffeff0c3a1ac4b6ec00000000000000 */
+ 9.98170620670420977171843901487591211E-01L, /* 3ffeff10383737079400000000000000 */
+ 9.98201082885133511579667242585856002E-01L, /* 3ffeff14365ba5991c00000000000000 */
+ 9.98231546029493238547658506831794512E-01L, /* 3ffeff183488107b7c00000000000000 */
+ 9.98262010103528552029672482603928074E-01L, /* 3ffeff1c32bc77beb000000000000000 */
+ 9.98292475107267818223988342651864514E-01L, /* 3ffeff2030f8db72b000000000000000 */
+ 9.98322941040739375573309644096298143E-01L, /* 3ffeff242f3d3ba77000000000000000 */
+ 9.98353407903971645787066790944663808E-01L, /* 3ffeff282d89986cf000000000000000 */
+ 9.98383875696992967307963340317655820E-01L, /* 3ffeff2c2bddf1d32400000000000000 */
+ 9.98414344419831761845429696222709026E-01L, /* 3ffeff302a3a47ea0c00000000000000 */
+ 9.98444814072516340086593800151604228E-01L, /* 3ffeff34289e9ac19800000000000000 */
+ 9.98475284655075123740886056111776270E-01L, /* 3ffeff38270aea69c800000000000000 */
+ 9.98505756167536479006585636852832977E-01L, /* 3ffeff3c257f36f29400000000000000 */
+ 9.98536228609928799837547330753295682E-01L, /* 3ffeff4023fb806bf800000000000000 */
+ 9.98566701982280452432050310562772211E-01L, /* 3ffeff44227fc6e5ec00000000000000 */
+ 9.98597176284619802988373749030870385E-01L, /* 3ffeff48210c0a706800000000000000 */
+ 9.98627651516975245460372434536111541E-01L, /* 3ffeff4c1fa04b1b6800000000000000 */
+ 9.98658127679375173801901155457017012E-01L, /* 3ffeff501e3c88f6e800000000000000 */
+ 9.98688604771847954211239084543194622E-01L, /* 3ffeff541ce0c412e000000000000000 */
+ 9.98719082794421980642241010173165705E-01L, /* 3ffeff581b8cfc7f4c00000000000000 */
+ 9.98749561747125619293186105096538085E-01L, /* 3ffeff5c1a41324c2400000000000000 */
+ 9.98780041629987291873504773320746608E-01L, /* 3ffeff6018fd65896800000000000000 */
+ 9.98810522443035364581476187595399097E-01L, /* 3ffeff6417c196471000000000000000 */
+ 9.98841004186298203615379520670103375E-01L, /* 3ffeff68168dc4951400000000000000 */
+ 9.98871486859804230684645176552294288E-01L, /* 3ffeff6c1561f0837400000000000000 */
+ 9.98901970463581839743127943620493170E-01L, /* 3ffeff70143e1a222c00000000000000 */
+ 9.98932454997659369233531378995394334E-01L, /* 3ffeff74132241813000000000000000 */
+ 9.98962940462065268620861502313346136E-01L, /* 3ffeff78120e66b08400000000000000 */
+ 9.98993426856827904103397486323956400E-01L, /* 3ffeff7c110289c02000000000000000 */
+ 9.99023914181975669634994119405746460E-01L, /* 3ffeff800ffeaac00000000000000000 */
+ 9.99054402437536959169506189937237650E-01L, /* 3ffeff840f02c9c02000000000000000 */
+ 9.99084891623540138905212870668037795E-01L, /* 3ffeff880e0ee6d07800000000000000 */
+ 9.99115381740013658307120181234495249E-01L, /* 3ffeff8c0d2302010c00000000000000 */
+ 9.99145872786985911329082910015131347E-01L, /* 3ffeff900c3f1b61d800000000000000 */
+ 9.99176364764485236413804614130640402E-01L, /* 3ffeff940b633302d000000000000000 */
+ 9.99206857672540083026291313217370771E-01L, /* 3ffeff980a8f48f3f800000000000000 */
+ 9.99237351511178817364822180024930276E-01L, /* 3ffeff9c09c35d454800000000000000 */
+ 9.99267846280429861138827618560753763E-01L, /* 3ffeffa008ff7006c000000000000000 */
+ 9.99298341980321608302162417203362565E-01L, /* 3ffeffa4084381485c00000000000000 */
+ 9.99328838610882452808681364331278019E-01L, /* 3ffeffa8078f911a1800000000000000 */
+ 9.99359336172140816367814863951934967E-01L, /* 3ffeffac06e39f8bf400000000000000 */
+ 9.99389834664125092933417704443854745E-01L, /* 3ffeffb0063facadec00000000000000 */
+ 9.99420334086863676459344674185558688E-01L, /* 3ffeffb405a3b88ffc00000000000000 */
+ 9.99450834440384988655026177184481639E-01L, /* 3ffeffb8050fc3422400000000000000 */
+ 9.99481335724717395718741386190231424E-01L, /* 3ffeffbc0483ccd45c00000000000000 */
+ 9.99511837939889374871071936468069907E-01L, /* 3ffeffc003ffd556ac00000000000000 */
+ 9.99542341085929264554721385138691403E-01L, /* 3ffeffc40383dcd90800000000000000 */
+ 9.99572845162865514234695751838444266E-01L, /* 3ffeffc8030fe36b7400000000000000 */
+ 9.99603350170726517864849824945849832E-01L, /* 3ffeffcc02a3e91dec00000000000000 */
+ 9.99633856109540669399038392839429434E-01L, /* 3ffeffd0023fee006c00000000000000 */
+ 9.99664362979336418302267475155531429E-01L, /* 3ffeffd401e3f222f800000000000000 */
+ 9.99694870780142130772816244643763639E-01L, /* 3ffeffd8018ff5958800000000000000 */
+ 9.99725379511986284031266336569387931E-01L, /* 3ffeffdc0143f8682400000000000000 */
+ 9.99755889174897216520321308053098619E-01L, /* 3ffeffe000fffaaac000000000000000 */
+ 9.99786399768903377704987178731244057E-01L, /* 3ffeffe400c3fc6d6000000000000000 */
+ 9.99816911294033217050269968240172602E-01L, /* 3ffeffe8008ffdc00800000000000000 */
+ 9.99847423750315072998873233700578567E-01L, /* 3ffeffec0063feb2ac00000000000000 */
+ 9.99877937137777450526954226006637327E-01L, /* 3ffefff0003fff555800000000000000 */
+ 9.99908451456448688077216502279043198E-01L, /* 3ffefff40023ffb80000000000000000 */
+ 9.99938966706357262870241697783058044E-01L, /* 3ffefff8000fffeaac00000000000000 */
+ 9.99969482887531541104308985268289689E-01L, /* 3ffefffc0003fffd5400000000000000 */
+#define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
+ 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ 1.00003051804379100575559391472779680E+00L, /* 3fff0002000200015400000000000000 */
+ 1.00006103701893306334724798034585547E+00L, /* 3fff00040008000aac00000000000000 */
+ 1.00009155692545448346209013834595680E+00L, /* 3fff0006001200240000000000000000 */
+ 1.00012207776338379883185325525118969E+00L, /* 3fff0008002000555800000000000000 */
+ 1.00015259953274932014366527255333494E+00L, /* 3fff000a003200a6ac00000000000000 */
+ 1.00018312223357958012925905677548144E+00L, /* 3fff000c004801200400000000000000 */
+ 1.00021364586590294498691378066723701E+00L, /* 3fff000e006201c95c00000000000000 */
+ 1.00024417042974783642605984823603649E+00L, /* 3fff0010008002aab400000000000000 */
+ 1.00027469592514273166727889474714175E+00L, /* 3fff001200a203cc1000000000000000 */
+ 1.00030522235211605242000132420798764E+00L, /* 3fff001400c805357000000000000000 */
+ 1.00033574971069616488250630936818197E+00L, /* 3fff001600f206eed000000000000000 */
+ 1.00036627800091160178652671675081365E+00L, /* 3fff0018012009003800000000000000 */
+ 1.00039680722279067381919048784766346E+00L, /* 3fff001a01520b71a000000000000000 */
+ 1.00042733737636191371223048918182030E+00L, /* 3fff001c01880e4b1000000000000000 */
+ 1.00045786846165368766392589350289200E+00L, /* 3fff001e01c211948400000000000000 */
+ 1.00048840047869447289485833607614040E+00L, /* 3fff0020020015560000000000000000 */
+ 1.00051893342751269111445822090900037E+00L, /* 3fff0022024219978400000000000000 */
+ 1.00054946730813676403215595200890675E+00L, /* 3fff002402881e611000000000000000 */
+ 1.00058000212059516886853316464112140E+00L, /* 3fff002602d223baa800000000000000 */
+ 1.00061053786491632733302026281307917E+00L, /* 3fff0028032029ac4c00000000000000 */
+ 1.00064107454112866113504765053221490E+00L, /* 3fff002a0372303dfc00000000000000 */
+ 1.00067161214926059198404573180596344E+00L, /* 3fff002c03c83777b800000000000000 */
+ 1.00070215068934059710059614189958666E+00L, /* 3fff002e04223f618400000000000000 */
+ 1.00073269016139709819412928482051939E+00L, /* 3fff0030048048036000000000000000 */
+ 1.00076323056545857248522679583402351E+00L, /* 3fff003204e251655000000000000000 */
+ 1.00079377190155338617216784768970683E+00L, /* 3fff003405485b8f5000000000000000 */
+ 1.00082431416971007198668530691065826E+00L, /* 3fff003605b266896800000000000000 */
+ 1.00085485736995705163820957750431262E+00L, /* 3fff00380620725b9800000000000000 */
+ 1.00088540150232269132501983222027775E+00L, /* 3fff003a06927f0ddc00000000000000 */
+ 1.00091594656683552377884893758164253E+00L, /* 3fff003c07088ca83c00000000000000 */
+ 1.00094649256352402622027852885366883E+00L, /* 3fff003e07829b32bc00000000000000 */
+ 1.00097703949241650933643654752813745E+00L, /* 3fff00400800aab55400000000000000 */
+ 1.00100758735354156137020709138596430E+00L, /* 3fff00420882bb381000000000000000 */
+ 1.00103813614692760403102056443458423E+00L, /* 3fff00440908ccc2f000000000000000 */
+ 1.00106868587260300351715613942360505E+00L, /* 3fff00460992df5df000000000000000 */
+ 1.00109923653059629256034668287611566E+00L, /* 3fff00480a20f3111800000000000000 */
+ 1.00112978812093589287002259879955091E+00L, /* 3fff004a0ab307e46800000000000000 */
+ 1.00116034064365022615561429120134562E+00L, /* 3fff004c0b491ddfe000000000000000 */
+ 1.00119089409876788066000585786241572E+00L, /* 3fff004e0be3350b8c00000000000000 */
+ 1.00122144848631711155917400901671499E+00L, /* 3fff00500c814d6f6000000000000000 */
+ 1.00125200380632656260715407370298635E+00L, /* 3fff00520d2367136c00000000000000 */
+ 1.00128256005882454449107399341301061E+00L, /* 3fff00540dc981ffa800000000000000 */
+ 1.00131311724383964545381786592770368E+00L, /* 3fff00560e739e3c2000000000000000 */
+ 1.00134367536140017618251363273884635E+00L, /* 3fff00580f21bbd0cc00000000000000 */
+ 1.00137423441153472492004539162735455E+00L, /* 3fff005a0fd3dac5b800000000000000 */
+ 1.00140479439427171337584354660066310E+00L, /* 3fff005c1089fb22e400000000000000 */
+ 1.00143535530963956325933850166620687E+00L, /* 3fff005e11441cf05000000000000000 */
+ 1.00146591715766680730226312334707472E+00L, /* 3fff0060120240360400000000000000 */
+ 1.00149647993838186721404781565070152E+00L, /* 3fff006212c464fc0000000000000000 */
+ 1.00152704365181316470412298258452211E+00L, /* 3fff0064138a8b4a4400000000000000 */
+ 1.00155760829798923250422149067162536E+00L, /* 3fff00661454b328d800000000000000 */
+ 1.00158817387693849232377374391944613E+00L, /* 3fff00681522dc9fbc00000000000000 */
+ 1.00161874038868942138336137759324629E+00L, /* 3fff006a15f507b6f400000000000000 */
+ 1.00164930783327055241471725821611471E+00L, /* 3fff006c16cb34768800000000000000 */
+ 1.00167987621071025161612055853765924E+00L, /* 3fff006e17a562e67400000000000000 */
+ 1.00171044552103705171930414508096874E+00L, /* 3fff00701883930ec000000000000000 */
+ 1.00174101576427937443369842185347807E+00L, /* 3fff00721965c4f76c00000000000000 */
+ 1.00177158694046569697988502412044909E+00L, /* 3fff00741a4bf8a87c00000000000000 */
+ 1.00180215904962455208959681840497069E+00L, /* 3fff00761b362e29f800000000000000 */
+ 1.00183273209178441698341543997230474E+00L, /* 3fff00781c246583e400000000000000 */
+ 1.00186330606697365785962006157205906E+00L, /* 3fff007a1d169ebe3c00000000000000 */
+ 1.00189388097522080744994354972732253E+00L, /* 3fff007c1e0cd9e10800000000000000 */
+ 1.00192445681655439848611877096118405E+00L, /* 3fff007e1f0716f45000000000000000 */
+ 1.00195503359100279716642489802325144E+00L, /* 3fff0080200556001000000000000000 */
+ 1.00198561129859459173374602869444061E+00L, /* 3fff00822107970c5400000000000000 */
+};
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
index 737c7c73fa..daeba17942 100644
--- a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
new file mode 100644
index 0000000000..a2571649ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
@@ -0,0 +1,230 @@
+/* Test iscanonical and canonicalizel for ldbl-128ibm.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo;
+ bool canonical;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 0.0, true },
+ { __builtin_nan (""), DBL_MAX, true },
+ { __builtin_nan (""), __builtin_inf (), true },
+ { __builtin_nan (""), __builtin_nan (""), true },
+ { __builtin_nan (""), __builtin_nans (""), true },
+ { __builtin_nans (""), 0.0, true },
+ { __builtin_nans (""), DBL_MAX, true },
+ { __builtin_nans (""), __builtin_inf (), true },
+ { __builtin_nans (""), __builtin_nan (""), true },
+ { __builtin_nans (""), __builtin_nans (""), true },
+ { __builtin_inf (), 0.0, true },
+ { __builtin_inf (), -0.0, true },
+ { -__builtin_inf (), 0.0, true },
+ { -__builtin_inf (), -0.0, true },
+ { __builtin_inf (), DBL_TRUE_MIN, false },
+ { __builtin_inf (), -DBL_TRUE_MIN, false },
+ { -__builtin_inf (), DBL_TRUE_MIN, false },
+ { -__builtin_inf (), -DBL_TRUE_MIN, false },
+ { __builtin_inf (), DBL_MIN, false },
+ { __builtin_inf (), -DBL_MIN, false },
+ { -__builtin_inf (), DBL_MIN, false },
+ { -__builtin_inf (), -DBL_MIN, false },
+ { __builtin_inf (), __builtin_inf (), false },
+ { __builtin_inf (), -__builtin_inf (), false },
+ { -__builtin_inf (), __builtin_inf (), false },
+ { -__builtin_inf (), -__builtin_inf (), false },
+ { __builtin_inf (), __builtin_nan (""), false },
+ { __builtin_inf (), -__builtin_nan (""), false },
+ { -__builtin_inf (), __builtin_nan (""), false },
+ { -__builtin_inf (), -__builtin_nan (""), false },
+ { 0.0, 0.0, true },
+ { 0.0, -0.0, true },
+ { -0.0, 0.0, true },
+ { -0.0, -0.0, true },
+ { 0.0, DBL_TRUE_MIN, false },
+ { 0.0, -DBL_TRUE_MIN, false },
+ { -0.0, DBL_TRUE_MIN, false },
+ { -0.0, -DBL_TRUE_MIN, false },
+ { 0.0, DBL_MAX, false },
+ { 0.0, -DBL_MAX, false },
+ { -0.0, DBL_MAX, false },
+ { -0.0, -DBL_MAX, false },
+ { 0.0, __builtin_inf (), false },
+ { 0.0, -__builtin_inf (), false },
+ { -0.0, __builtin_inf (), false },
+ { -0.0, -__builtin_inf (), false },
+ { 0.0, __builtin_nan (""), false },
+ { 0.0, -__builtin_nan (""), false },
+ { -0.0, __builtin_nan (""), false },
+ { -0.0, -__builtin_nan (""), false },
+ { 1.0, 0.0, true },
+ { 1.0, -0.0, true },
+ { -1.0, 0.0, true },
+ { -1.0, -0.0, true },
+ { 1.0, DBL_TRUE_MIN, true },
+ { 1.0, -DBL_TRUE_MIN, true },
+ { -1.0, DBL_TRUE_MIN, true },
+ { -1.0, -DBL_TRUE_MIN, true },
+ { 1.0, DBL_MAX, false },
+ { 1.0, -DBL_MAX, false },
+ { -1.0, DBL_MAX, false },
+ { -1.0, -DBL_MAX, false },
+ { 1.0, __builtin_inf (), false },
+ { 1.0, -__builtin_inf (), false },
+ { -1.0, __builtin_inf (), false },
+ { -1.0, -__builtin_inf (), false },
+ { 1.0, __builtin_nan (""), false },
+ { 1.0, -__builtin_nan (""), false },
+ { -1.0, __builtin_nan (""), false },
+ { -1.0, -__builtin_nan (""), false },
+ { 0x1p1023, 0x1.1p969, true },
+ { 0x1p1023, -0x1.1p969, true },
+ { -0x1p1023, 0x1.1p969, true },
+ { -0x1p1023, -0x1.1p969, true },
+ { 0x1p1023, 0x1.1p970, false },
+ { 0x1p1023, -0x1.1p970, false },
+ { -0x1p1023, 0x1.1p970, false },
+ { -0x1p1023, -0x1.1p970, false },
+ { 0x1p1023, 0x1p970, true },
+ { 0x1p1023, -0x1p970, true },
+ { -0x1p1023, 0x1p970, true },
+ { -0x1p1023, -0x1p970, true },
+ { 0x1.0000000000001p1023, 0x1p970, false },
+ { 0x1.0000000000001p1023, -0x1p970, false },
+ { -0x1.0000000000001p1023, 0x1p970, false },
+ { -0x1.0000000000001p1023, -0x1p970, false },
+ { 0x1p-969, 0x1.1p-1023, true },
+ { 0x1p-969, -0x1.1p-1023, true },
+ { -0x1p-969, 0x1.1p-1023, true },
+ { -0x1p-969, -0x1.1p-1023, true },
+ { 0x1p-969, 0x1.1p-1022, false },
+ { 0x1p-969, -0x1.1p-1022, false },
+ { -0x1p-969, 0x1.1p-1022, false },
+ { -0x1p-969, -0x1.1p-1022, false },
+ { 0x1p-969, 0x1p-1022, true },
+ { 0x1p-969, -0x1p-1022, true },
+ { -0x1p-969, 0x1p-1022, true },
+ { -0x1p-969, -0x1p-1022, true },
+ { 0x1.0000000000001p-969, 0x1p-1022, false },
+ { 0x1.0000000000001p-969, -0x1p-1022, false },
+ { -0x1.0000000000001p-969, 0x1p-1022, false },
+ { -0x1.0000000000001p-969, -0x1p-1022, false },
+ { 0x1p-970, 0x1.1p-1024, true },
+ { 0x1p-970, -0x1.1p-1024, true },
+ { -0x1p-970, 0x1.1p-1024, true },
+ { -0x1p-970, -0x1.1p-1024, true },
+ { 0x1p-970, 0x1.1p-1023, false },
+ { 0x1p-970, -0x1.1p-1023, false },
+ { -0x1p-970, 0x1.1p-1023, false },
+ { -0x1p-970, -0x1.1p-1023, false },
+ { 0x1p-970, 0x1p-1023, true },
+ { 0x1p-970, -0x1p-1023, true },
+ { -0x1p-970, 0x1p-1023, true },
+ { -0x1p-970, -0x1p-1023, true },
+ { 0x1.0000000000001p-970, 0x1p-1023, false },
+ { 0x1.0000000000001p-970, -0x1p-1023, false },
+ { -0x1.0000000000001p-970, 0x1p-1023, false },
+ { -0x1.0000000000001p-970, -0x1p-1023, false },
+ { 0x1p-1000, 0x1.1p-1054, true },
+ { 0x1p-1000, -0x1.1p-1054, true },
+ { -0x1p-1000, 0x1.1p-1054, true },
+ { -0x1p-1000, -0x1.1p-1054, true },
+ { 0x1p-1000, 0x1.1p-1053, false },
+ { 0x1p-1000, -0x1.1p-1053, false },
+ { -0x1p-1000, 0x1.1p-1053, false },
+ { -0x1p-1000, -0x1.1p-1053, false },
+ { 0x1p-1000, 0x1p-1053, true },
+ { 0x1p-1000, -0x1p-1053, true },
+ { -0x1p-1000, 0x1p-1053, true },
+ { -0x1p-1000, -0x1p-1053, true },
+ { 0x1.0000000000001p-1000, 0x1p-1053, false },
+ { 0x1.0000000000001p-1000, -0x1p-1053, false },
+ { -0x1.0000000000001p-1000, 0x1p-1053, false },
+ { -0x1.0000000000001p-1000, -0x1p-1053, false },
+ { 0x1p-1021, 0x1p-1074, true },
+ { 0x1p-1021, -0x1p-1074, true },
+ { -0x1p-1021, 0x1p-1074, true },
+ { -0x1p-1021, -0x1p-1074, true },
+ { 0x1.0000000000001p-1021, 0x1p-1074, false },
+ { 0x1.0000000000001p-1021, -0x1p-1074, false },
+ { -0x1.0000000000001p-1021, 0x1p-1074, false },
+ { -0x1.0000000000001p-1021, -0x1p-1074, false },
+ { 0x1p-1022, 0x1p-1074, false },
+ { 0x1p-1022, -0x1p-1074, false },
+ { -0x1p-1022, 0x1p-1074, false },
+ { -0x1p-1022, -0x1p-1074, false },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ld = ldbl_pack (tests[i].hi, tests[i].lo);
+ bool canonical = iscanonical (ld);
+ if (canonical == tests[i].canonical)
+ {
+ printf ("PASS: iscanonical test %zu\n", i);
+ long double ldc = 12345.0L;
+ bool canonicalize_ret = canonicalizel (&ldc, &ld);
+ if (canonicalize_ret == !canonical)
+ {
+ printf ("PASS: canonicalizel test %zu\n", i);
+ bool canon_ok;
+ if (!canonical)
+ canon_ok = ldc == 12345.0L;
+ else if (isnan (ld))
+ canon_ok = isnan (ldc) && !issignaling (ldc);
+ else
+ canon_ok = ldc == ld;
+ if (canon_ok)
+ printf ("PASS: canonicalized value test %zu\n", i);
+ else
+ {
+ printf ("FAIL: canonicalized value test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: canonicalizel test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: iscanonical test %zu\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
index 969fadc205..c717616e3c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
@@ -1,5 +1,5 @@
-/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Test for ldbl-128ibm fmodl handling of equal values (bug 19602).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log1pl.c>
-long_double_symbol (libm, __w_log1pl, log1pl);
+#define FUNC fmodl
+#define SETUP
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
new file mode 100644
index 0000000000..ce959faf90
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
@@ -0,0 +1,84 @@
+/* Test for ldbl-128ibm fmodl etc. handling of equal values.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+/* FUNC is defined to be the name of the function to test. */
+#define STRX(x) #x
+#define STR(x) STRX (x)
+#define SFUNC STR (FUNC)
+
+union u
+{
+ long double ld;
+ double d[2];
+};
+
+volatile union u p1 = { .d = { DBL_MIN, 0.0 } };
+volatile union u p2 = { .d = { DBL_MIN, -0.0 } };
+volatile union u m1 = { .d = { -DBL_MIN, 0.0 } };
+volatile union u m2 = { .d = { -DBL_MIN, -0.0 } };
+
+static int
+test_func (const char *s, long double x, long double y, long double expected)
+{
+ volatile long double r;
+ r = FUNC (x, y);
+ if (r != expected || copysignl (1.0, r) != copysignl (1.0, expected))
+ {
+ printf ("FAIL: " SFUNC " (%s)\n", s);
+ return 1;
+ }
+ else
+ {
+ printf ("PASS: " SFUNC " (%s)\n", s);
+ return 0;
+ }
+}
+
+#define TEST_FUNC(a, b, e) test_func (#a ", " #b, a, b, e)
+
+static int
+do_test (void)
+{
+ int result = 0;
+ SETUP;
+ result |= TEST_FUNC (p1.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (m1.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m2.ld, -0.0L);
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
index 7e73c9abf8..829cf48c89 100644
--- a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
@@ -1,5 +1,5 @@
-/* Wrapper for __scalblnl handles setting errno.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Test for ldbl-128ibm remainderl handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(name, alias)
-#include <math/w_scalblnl.c>
-long_double_symbol (libm, __w_scalblnl, scalblnl);
+#define FUNC remainderl
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
new file mode 100644
index 0000000000..446e84146d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
@@ -0,0 +1,30 @@
+/* Test for ldbl-128ibm remquol handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+static long double
+wrap_remquol (long double x, long double y)
+{
+ int quo;
+ return remquol (x, y, &quo);
+}
+
+#define FUNC wrap_remquol
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..6412e1781d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
@@ -0,0 +1,73 @@
+/* Test totalorderl and totalordermagl for ldbl-128ibm.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo1, lo2;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 1, __builtin_nans ("") },
+ { -__builtin_nan (""), 1, __builtin_nans ("") },
+ { __builtin_nans (""), 1, __builtin_nan ("") },
+ { -__builtin_nans (""), 1, __builtin_nan ("") },
+ { __builtin_inf (), 0.0, -0.0 },
+ { -__builtin_inf (), 0.0, -0.0 },
+ { 1.5, 0.0, -0.0 },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ldx = ldbl_pack (tests[i].hi, tests[i].lo1);
+ long double ldy = ldbl_pack (tests[i].hi, tests[i].lo2);
+ bool to1 = totalorderl (ldx, ldy);
+ bool to2 = totalorderl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu\n", i);
+ else
+ {
+ printf ("FAIL: test %zu\n", i);
+ result = 1;
+ }
+ to1 = totalordermagl (ldx, ldy);
+ to2 = totalordermagl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu (totalordermagl)\n", i);
+ else
+ {
+ printf ("FAIL: test %zu (totalordermagl)\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
index 14dc683619..1893c04dda 100644
--- a/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
+++ b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
@@ -1,5 +1,5 @@
/* Test for ldbl-128ibm strtold overflow to infinity (bug 14551).
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl.c b/sysdeps/ieee754/ldbl-128ibm/w_expl.c
deleted file mode 100644
index c9d44b61dd..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/w_expl.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <math.h>
-#include <math_private.h>
-#include <math_ldbl_opt.h>
-
-long double __expl(long double x) /* wrapper exp */
-{
- long double z;
- z = __ieee754_expl(x);
- if (_LIB_VERSION == _IEEE_)
- return z;
- if (isfinite(x))
- {
- if (!isfinite (z))
- return __kernel_standard_l(x,x,206); /* exp overflow */
- else if (z == 0.0L)
- return __kernel_standard_l(x,x,207); /* exp underflow */
- }
- return z;
-}
-hidden_def (__expl)
-long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
index da2e929175..e299c48748 100644
--- a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */