summaryrefslogtreecommitdiff
path: root/libquadmath
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-10-30 09:35:42 +0000
committer <>2015-01-09 11:51:27 +0000
commitc27a97d04853380f1e80525391b3f0d156ed4c84 (patch)
tree68ffaade7c605bc80cffa18360799c98a810976f /libquadmath
parent6af3fdec2262dd94954acc5e426ef71cbd4521d3 (diff)
downloadgcc-tarball-c27a97d04853380f1e80525391b3f0d156ed4c84.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.9.2.tar.bz2.gcc-4.9.2
Diffstat (limited to 'libquadmath')
-rw-r--r--libquadmath/ChangeLog249
-rw-r--r--libquadmath/Makefile.am6
-rw-r--r--libquadmath/Makefile.in63
-rw-r--r--libquadmath/acinclude.m417
-rw-r--r--libquadmath/config.h.in3
-rwxr-xr-xlibquadmath/configure63
-rw-r--r--libquadmath/configure.ac1
-rw-r--r--libquadmath/libquadmath.info662
-rw-r--r--libquadmath/libquadmath.texi2
-rw-r--r--libquadmath/math/acoshq.c4
-rw-r--r--libquadmath/math/acosq.c4
-rw-r--r--libquadmath/math/asinhq.c2
-rw-r--r--libquadmath/math/asinq.c2
-rw-r--r--libquadmath/math/atan2q.c2
-rw-r--r--libquadmath/math/atanhq.c2
-rw-r--r--libquadmath/math/atanq.c17
-rw-r--r--libquadmath/math/cacoshq.c16
-rw-r--r--libquadmath/math/casinhq.c5
-rw-r--r--libquadmath/math/cbrtq.c182
-rw-r--r--libquadmath/math/ccoshq.c145
-rw-r--r--libquadmath/math/ceilq.c2
-rw-r--r--libquadmath/math/cexpq.c152
-rw-r--r--libquadmath/math/clog10q.c116
-rw-r--r--libquadmath/math/clogq.c111
-rw-r--r--libquadmath/math/complex.c202
-rw-r--r--libquadmath/math/copysignq.c2
-rw-r--r--libquadmath/math/coshq.c22
-rw-r--r--libquadmath/math/cosq.c10
-rw-r--r--libquadmath/math/cosq_kernel.c12
-rw-r--r--libquadmath/math/csinhq.c166
-rw-r--r--libquadmath/math/csinq.c171
-rw-r--r--libquadmath/math/csqrtq.c143
-rw-r--r--libquadmath/math/ctanhq.c120
-rw-r--r--libquadmath/math/ctanq.c120
-rw-r--r--libquadmath/math/erfq.c4
-rw-r--r--libquadmath/math/expm1q.c11
-rw-r--r--libquadmath/math/expq.c22
-rw-r--r--libquadmath/math/fabsq.c2
-rw-r--r--libquadmath/math/finiteq.c7
-rw-r--r--libquadmath/math/floorq.c2
-rw-r--r--libquadmath/math/fmaq.c134
-rw-r--r--libquadmath/math/fmodq.c2
-rw-r--r--libquadmath/math/frexpq.c2
-rw-r--r--libquadmath/math/ilogbq.c22
-rw-r--r--libquadmath/math/isinf_nsq.c19
-rw-r--r--libquadmath/math/isnanq.c2
-rw-r--r--libquadmath/math/j0q.c7
-rw-r--r--libquadmath/math/j1q.c12
-rw-r--r--libquadmath/math/jnq.c19
-rw-r--r--libquadmath/math/ldexpq.c2
-rw-r--r--libquadmath/math/lgammaq.c25
-rw-r--r--libquadmath/math/llroundq.c2
-rw-r--r--libquadmath/math/log10q.c8
-rw-r--r--libquadmath/math/log1pq.c12
-rw-r--r--libquadmath/math/log2q.c8
-rw-r--r--libquadmath/math/logq.c8
-rw-r--r--libquadmath/math/lroundq.c2
-rw-r--r--libquadmath/math/modfq.c2
-rw-r--r--libquadmath/math/nearbyintq.c25
-rw-r--r--libquadmath/math/nextafterq.c2
-rw-r--r--libquadmath/math/powq.c8
-rw-r--r--libquadmath/math/rem_pio2q.c4
-rw-r--r--libquadmath/math/remainderq.c2
-rw-r--r--libquadmath/math/rintq.c41
-rw-r--r--libquadmath/math/roundq.c2
-rw-r--r--libquadmath/math/scalblnq.c17
-rw-r--r--libquadmath/math/scalbnq.c18
-rw-r--r--libquadmath/math/sincosq_kernel.c14
-rw-r--r--libquadmath/math/sinhq.c20
-rw-r--r--libquadmath/math/sinq.c10
-rw-r--r--libquadmath/math/sinq_kernel.c8
-rw-r--r--libquadmath/math/sqrtq.c9
-rw-r--r--libquadmath/math/tanq.c6
-rw-r--r--libquadmath/math/tgammaq.c5
-rw-r--r--libquadmath/math/x2y2m1q.c93
-rw-r--r--libquadmath/printf/fpioconst.c911
-rw-r--r--libquadmath/printf/fpioconst.h10
-rw-r--r--libquadmath/printf/gmp-impl.h2
-rw-r--r--libquadmath/printf/printf_fp.c98
-rw-r--r--libquadmath/printf/printf_fphex.c53
-rw-r--r--libquadmath/quadmath-imp.h14
-rw-r--r--libquadmath/quadmath-rounding-mode.h74
-rw-r--r--libquadmath/quadmath.h8
-rw-r--r--libquadmath/strtod/strtod_l.c399
84 files changed, 3939 insertions, 1046 deletions
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 855bdacdc8..2722ed3fc3 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,32 +1,251 @@
-2013-04-11 Release Manager
+2014-10-30 Release Manager
- * GCC 4.7.3 released.
+ * GCC 4.9.2 released.
-2013-02-01 Jakub Jelinek <jakub@redhat.com>
+2014-07-16 Release Manager
- Backported from mainline
- 2013-01-22 Jakub Jelinek <jakub@redhat.com>
+ * GCC 4.9.1 released.
+
+2014-04-22 Release Manager
+
+ * GCC 4.9.0 released.
+
+2014-01-02 Tobias Burnus <burnus@net-b.de>
+
+ * libquadmath.texi: Bump @copying's copyright year.
+
+2013-12-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * Makefile.am (AM_CPPFLAGS): Define.
+ * Makefile.in: Regenerate.
+ * printf/gmp-impl.h: Remove path from longlong.h include.
+
+2013-09-20 Alan Modra <amodra@gmail.com>
+
+ * configure: Regenerate.
+
+2013-03-06 Shakthi Kannan <shakthimaan@gmail.com>
+
+ PR libquadmath/55473
+ * quadmath.h: Add 'extern "C"' block for C++ use.
+
+2013-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR libquadmath/56379
+ * strtod/strtod_l.c (mpn_lshift_1): Rewritten as function-like
+ macro.
+
+2013-02-17 Tobias Burnus <burnus@net-b.de>
+
+ * math/cacoshq.c (cacoshq): Call signbitq instead of signbit.
+
+2013-02-06 Richard Sandiford <rdsandiford@googlemail.com>
+
+ Revert previous patch.
+
+2013-02-03 Richard Sandiford <rdsandiford@googlemail.com>
+
+ Update copyright years.
+
+2013-01-22 Jakub Jelinek <jakub@redhat.com>
PR libquadmath/56072
* libquadmath.texi (M_PI_2q, M_PI_4q): Fix up description.
-2012-09-20 Release Manager
+2012-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ * math/cbrtq.c (cbrtq): Use Q suffixed floating point constants
+ instead of L suffixed ones.
+ * math/fmaq.c (fmaq): Likewise.
+ * math/rintq.c (TWO112): Likewise.
- * GCC 4.7.2 released.
+2012-12-03 Tobias Burnus <burnus@net-b.de>
-2012-06-14 Release Manager
+ * strtod/strtod_l.c (___STRTOF_INTERNAL): Fix exponent
+ reading.
- * GCC 4.7.1 released.
+2012-11-25 Tobias Burnus <burnus@net-b.de>
-2012-05-31 Benjamin Kosnik <bkoz@redhat.com>
+ PR libquadmath/55462
+ * strtod/strtod_l.c (round_and_return): Use HAVE_FENV_H
+ instead of nonexisting HAVE_GET_ROUNDING_MODE.
- PR libstdc++/52007
- * configure.ac: Allow gnu, gnu* variants for --enable-symvers argument.
- * configure: Regenerated.
+2012-11-23 H.J. Lu <hongjiu.lu@intel.com>
-2012-03-22 Release Manager
+ PR bootstrap/55455
+ * quadmath-rounding-mode.h (get_rounding_mode): Don't pass
+ void to fegetround.
- * GCC 4.7.0 released.
+2012-11-23 Tobias Burnus <burnus@net-b.de>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * quadmath-rounding-mode.h: New.
+ * printf/fpioconst.c: Update from GLIBC. Fix strtod rounding.
+ * printf/fpioconst.h: Ditto.
+ * printf/printf_fp.c (__quadmath_printf_fp): Update from GLIBC.
+ Make printf respect the rounding mode for decimal output.
+ * printf/printf_fphex.c (__quadmath_printf_fphex): Update from
+ GLIBC. Make printf respect the rounding mode for hex output.
+ * strtod/strtod_l.c: Update from GLIBC. Make strtod respect the
+ rounding mode. Fix strtod handling of underflow.
+
+2012-11-22 David S. Miller <davem@davemloft.net>
+ Tobias Burnus <burnus@net-b.de>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * math/atanq.c (atanq): Update from GLIBC. Handle tiny and
+ very large arguments properly.
+ * math/j0q.c (y0q): Update from GLIBC. Avoid arithmetic
+ underflow when 'x' is very small.
+ * math/j1q.c (y1q): Ditto.
+ * math/log1pq.c (log1pq): Update from GLIBC. Saturate
+ nonzero exponents with absolute value below 0x1p-128 to
+ +/- 0x1p-128.
+ * math/powq.c (powq): Update from GLIBC. If xm1 is
+ smaller than LDBL_EPSILON/2.0L, just return xm1.
+
+2012-11-21 Tobias Burnus <burnus@net-b.de>
+
+ PR libquadmath/55225
+ * math/lgammaq.c (lgammaq): Use local variable if
+ math.h does not provide signgam.
+ * acinclude.m4 (LIBQUAD_CHECK_MATH_H_SIGNGAM): New check.
+ * configure.ac: Use it.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+2012-11-15 Tobias Burnus <burnus@net-b.de>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * math/fmaq.c (fmaq): Merge from GLIBC. Fix fma
+ underflows with small x * y; Fix overflow results
+ outside round-to-nearest mode; make use of Dekker
+ and Knuth algorithms use round-to-nearest.
+
+2012-11-01 Tobias Burnus <burnus@net-b.de>
+
+ * math/fmaq.c (fmaq): Fix build.
+
+2012-11-01 Tobias Burnus <burnus@net-b.de>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * math/fmaq.c (fmaq): Merge from GLIBC. Handle cases
+ with small x * y using scaling, not as x * y + z.
+ * math/lgammaq.c (lgammaq): Fix signgam handling.
+
+2012-11-01 Tobias Burnus <burnus@net-b.de>
+
+ * Makefile.am (libquadmath_la_SOURCES): Add new math/* files.
+ * Makefile.in: Regenerated.
+ * math/acoshq.c: Update comment.
+ * math/acosq.c: Ditto.
+ * math/asinhq.c: Ditto.
+ * math/asinq.c: Ditto.
+ * math/atan2q.c: Ditto.
+ * math/atanhq.c: Ditto.
+ * math/ceilq.c: Ditto.
+ * math/copysignq.c: Ditto.
+ * math/cosq.c: Ditto.
+ * math/coshq.c: Ditto.
+ * math/erfq.c: Ditto.
+ * math/fabsq.c: Ditto.
+ * math/finiteq.c: Ditto.
+ * math/floorq.c: Ditto.
+ * math/fmodq.c: Ditto.
+ * math/frexpq.c: Ditto.
+ * math/isnanq.c: Ditto.
+ * math/j0q.c: Ditto.
+ * math/j1q.c: Ditto.
+ * math/ldexpq.c: Ditto.
+ * math/llroundq.c: Ditto.
+ * math/log10q.c: Ditto.
+ * math/log1pq.c: Ditto.
+ * math/log2q.c: Ditto.
+ * math/logq.c: Ditto.
+ * math/lroundq.c: Ditto.
+ * math/modfq.c: Ditto.
+ * math/nextafterq.c: Ditto.
+ * math/powq.c: Ditto.
+ * math/rem_pio2q.c: Ditto.
+ * math/remainderq.c: Ditto.
+ * math/rintq.c: Ditto.
+ * math/roundq.c: Ditto.
+ * math/scalblnq.c: Ditto.
+ * math/scalbnq.c: Ditto.
+ * math/sincosq_kernel.c: Ditto.
+ * math/sinq.c: Ditto.
+ * math/tanq.c: Ditto.
+ * math/expq.c: Ditto.
+ (__expq_table, expq): Renamed local array from __expl_table.
+ * math/cosq_kernel.c (__quadmath_kernel_cosq): Fix sign handling.
+ * math/cacoshq.c: Changes from GLIBC; fix returned sign.
+ * math/casinhq.c: Changes from GLIBC to fix special-case.
+ * math/cbrtq.c: Use modified GLIBC version.
+ * math/complex.c (ccoshd, cexpq, clog10q, clogq, csinhq, csinq,
+ ctanhq, ctanq): Moved to separates files.
+ (mult_c128, div_c128): Removed no longer needed functions.
+ (cexpiq): Call sincosq instead of sinq and cosq.
+ (cosq): Call cosh(-re,im) instead of cosq/sinq/sinh/cosh.
+ * math/ccoshq.c (ccoshq): New file, moved from complex.c and
+ modified based on GLIBC.
+ * math/cexpq.c (cexp): Ditto.
+ * math/clog10q.c (clog10q): Ditto.
+ * math/clogq.c (clogq): Ditto.
+ * math/csinhq.c: Ditto.
+ * math/csinq.c: Ditto.
+ * math/csqrtq.c: Ditto.
+ * math/ctanhq.c: Ditto.
+ * math/ctanq.c: Ditto.
+ * math/fmaq.c (fmaq): Port TININESS_AFTER_ROUNDING handling
+ from GLIBC.
+ * math/ilogbq.c (ilogbq): Add errno = EDOM handling.
+ * math/isinf_nsq.c (__quadmath_isinf_nsq): New file, ported
+ from GLIBC.
+ * math/lgammaq.c (lgammaq): Add signgam handling.
+ * math/sinhq.c (sinhq): Fix sign handling.
+ * math/sinq_kernel.c (__quadmath_kernel_sinq): Ditto.
+ * math/tgammaq.c (tgammaq): Ditto.
+ * math/x2y2m1q.c: New file.
+ * quadmath-imp.h (TININESS_AFTER_ROUNDING): New define.
+ (__quadmath_x2y2m1q, __quadmath_isinf_nsq): New prototypes.
+
+2012-10-31 Tobias Burnus <burnus@net-b.de>
+ Joseph Myers <joseph@codesourcery.com>
+ David S. Miller <davem@davemloft.net>
+ Ulrich Drepper <drepper@redhat.com>
+ Marek Polacek <polacek@redhat.com>:
+ Petr Baudis <pasky@suse.cz>
+
+ * math/complex.c (csqrtq): NaN and INF fixes.
+ * math/sqrtq.c (sqrt): NaN, INF and < 0 fixes.
+ * math/expm1q.c (expm1q): Changes from GLIBC. Use expq for
+ large parameters. Fix errno for boundary conditions.
+ * math/finiteq.c (finiteq): Add comment.
+ * math/fmaq.c (fmaq): Changes from GLIBC. Fix missing underflows
+ and bad results for some subnormal results. Fix sign of inexact
+ zero return. Fix sign of exact zero return.
+ Ensure additions are not scheduled after fetestexcept.
+ * math/jnq.c (jnq): Changes from GLIBC. Set up errno properly
+ for ynq. Fix jnq precision.
+ * math/nearbyintq.c (nearbyintq): Changes from GLIBC. Do not
+ manipulate bits before adding and subtracting TWO112[sx].
+ * math/rintq.c (rintq): Ditto.
+ * math/scalbnq.c (scalbnq): Changes from GLIBC. Fix integer
+ overflow.
+
+2012-09-14 David Edelsohn <dje.gcc@gmail.com>
+
+ * configure: Regenerated.
+
+2012-05-29 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/51007
+ * configure.ac: Allow gnu, gnu* variants for --enable-symvers argument.
+ * configure: Regenerated.
+
+2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure: Regenerated.
2011-11-21 Andreas Tobler <andreast@fgznet.ch>
diff --git a/libquadmath/Makefile.am b/libquadmath/Makefile.am
index c7be3e5541..6519731b9b 100644
--- a/libquadmath/Makefile.am
+++ b/libquadmath/Makefile.am
@@ -6,6 +6,7 @@ AUTOMAKE_OPTIONS = 1.8 foreign
## Skip over everything if the quadlib is not available:
if BUILD_LIBQUADMATH
ACLOCAL_AMFLAGS = -I .. -I ../config
+AM_CPPFLAGS = -I $(top_srcdir)/../include
## May be used by toolexeclibdir.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@@ -43,7 +44,8 @@ nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h
libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
libquadmath_la_SOURCES = \
- math/acoshq.c math/fmodq.c math/acosq.c math/frexpq.c \
+ math/x2y2m1q.c math/isinf_nsq.c math/acoshq.c math/fmodq.c \
+ math/acosq.c math/frexpq.c \
math/rem_pio2q.c math/asinhq.c math/hypotq.c math/remainderq.c \
math/asinq.c math/rintq.c math/atan2q.c math/isinfq.c \
math/roundq.c math/atanhq.c math/isnanq.c math/scalblnq.c math/atanq.c \
@@ -60,6 +62,8 @@ libquadmath_la_SOURCES = \
math/catanhq.c math/catanq.c math/cimagq.c math/conjq.c math/cprojq.c \
math/crealq.c math/fdimq.c math/fmaxq.c math/fminq.c math/ilogbq.c \
math/llrintq.c math/log2q.c math/lrintq.c math/nearbyintq.c math/remquoq.c \
+ math/ccoshq.c math/cexpq.c math/clog10q.c math/clogq.c math/csinq.c \
+ math/csinhq.c math/csqrtq.c math/ctanq.c math/ctanhq.c \
printf/addmul_1.c printf/add_n.c printf/cmp.c printf/divrem.c \
printf/flt1282mpn.c printf/fpioconst.c printf/lshift.c printf/mul_1.c \
printf/mul_n.c printf/mul.c printf/printf_fphex.c printf/printf_fp.c \
diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in
index 6e389cf6af..331780931a 100644
--- a/libquadmath/Makefile.in
+++ b/libquadmath/Makefile.in
@@ -87,7 +87,8 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(libsubincludedir)"
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
am__dirstamp = $(am__leading_dot)dirstamp
-@BUILD_LIBQUADMATH_TRUE@am_libquadmath_la_OBJECTS = math/acoshq.lo \
+@BUILD_LIBQUADMATH_TRUE@am_libquadmath_la_OBJECTS = math/x2y2m1q.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/isinf_nsq.lo math/acoshq.lo \
@BUILD_LIBQUADMATH_TRUE@ math/fmodq.lo math/acosq.lo \
@BUILD_LIBQUADMATH_TRUE@ math/frexpq.lo math/rem_pio2q.lo \
@BUILD_LIBQUADMATH_TRUE@ math/asinhq.lo math/hypotq.lo \
@@ -126,9 +127,13 @@ am__dirstamp = $(am__leading_dot)dirstamp
@BUILD_LIBQUADMATH_TRUE@ math/ilogbq.lo math/llrintq.lo \
@BUILD_LIBQUADMATH_TRUE@ math/log2q.lo math/lrintq.lo \
@BUILD_LIBQUADMATH_TRUE@ math/nearbyintq.lo math/remquoq.lo \
-@BUILD_LIBQUADMATH_TRUE@ printf/addmul_1.lo printf/add_n.lo \
-@BUILD_LIBQUADMATH_TRUE@ printf/cmp.lo printf/divrem.lo \
-@BUILD_LIBQUADMATH_TRUE@ printf/flt1282mpn.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/ccoshq.lo math/cexpq.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/clog10q.lo math/clogq.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/csinq.lo math/csinhq.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/csqrtq.lo math/ctanq.lo \
+@BUILD_LIBQUADMATH_TRUE@ math/ctanhq.lo printf/addmul_1.lo \
+@BUILD_LIBQUADMATH_TRUE@ printf/add_n.lo printf/cmp.lo \
+@BUILD_LIBQUADMATH_TRUE@ printf/divrem.lo printf/flt1282mpn.lo \
@BUILD_LIBQUADMATH_TRUE@ printf/fpioconst.lo printf/lshift.lo \
@BUILD_LIBQUADMATH_TRUE@ printf/mul_1.lo printf/mul_n.lo \
@BUILD_LIBQUADMATH_TRUE@ printf/mul.lo printf/printf_fphex.lo \
@@ -305,6 +310,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.8 foreign
@BUILD_LIBQUADMATH_TRUE@ACLOCAL_AMFLAGS = -I .. -I ../config
+@BUILD_LIBQUADMATH_TRUE@AM_CPPFLAGS = -I $(top_srcdir)/../include
@BUILD_LIBQUADMATH_TRUE@gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@BUILD_LIBQUADMATH_TRUE@@LIBQUAD_USE_SYMVER_FALSE@version_arg =
@BUILD_LIBQUADMATH_TRUE@@LIBQUAD_USE_SYMVER_GNU_TRUE@@LIBQUAD_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/quadmath.map
@@ -321,7 +327,8 @@ AUTOMAKE_OPTIONS = 1.8 foreign
@BUILD_LIBQUADMATH_TRUE@nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h
@BUILD_LIBQUADMATH_TRUE@libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
@BUILD_LIBQUADMATH_TRUE@libquadmath_la_SOURCES = \
-@BUILD_LIBQUADMATH_TRUE@ math/acoshq.c math/fmodq.c math/acosq.c math/frexpq.c \
+@BUILD_LIBQUADMATH_TRUE@ math/x2y2m1q.c math/isinf_nsq.c math/acoshq.c math/fmodq.c \
+@BUILD_LIBQUADMATH_TRUE@ math/acosq.c math/frexpq.c \
@BUILD_LIBQUADMATH_TRUE@ math/rem_pio2q.c math/asinhq.c math/hypotq.c math/remainderq.c \
@BUILD_LIBQUADMATH_TRUE@ math/asinq.c math/rintq.c math/atan2q.c math/isinfq.c \
@BUILD_LIBQUADMATH_TRUE@ math/roundq.c math/atanhq.c math/isnanq.c math/scalblnq.c math/atanq.c \
@@ -338,6 +345,8 @@ AUTOMAKE_OPTIONS = 1.8 foreign
@BUILD_LIBQUADMATH_TRUE@ math/catanhq.c math/catanq.c math/cimagq.c math/conjq.c math/cprojq.c \
@BUILD_LIBQUADMATH_TRUE@ math/crealq.c math/fdimq.c math/fmaxq.c math/fminq.c math/ilogbq.c \
@BUILD_LIBQUADMATH_TRUE@ math/llrintq.c math/log2q.c math/lrintq.c math/nearbyintq.c math/remquoq.c \
+@BUILD_LIBQUADMATH_TRUE@ math/ccoshq.c math/cexpq.c math/clog10q.c math/clogq.c math/csinq.c \
+@BUILD_LIBQUADMATH_TRUE@ math/csinhq.c math/csqrtq.c math/ctanq.c math/ctanhq.c \
@BUILD_LIBQUADMATH_TRUE@ printf/addmul_1.c printf/add_n.c printf/cmp.c printf/divrem.c \
@BUILD_LIBQUADMATH_TRUE@ printf/flt1282mpn.c printf/fpioconst.c printf/lshift.c printf/mul_1.c \
@BUILD_LIBQUADMATH_TRUE@ printf/mul_n.c printf/mul.c printf/printf_fphex.c printf/printf_fp.c \
@@ -504,6 +513,8 @@ math/$(am__dirstamp):
math/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) math/$(DEPDIR)
@: > math/$(DEPDIR)/$(am__dirstamp)
+math/x2y2m1q.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/isinf_nsq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
math/acoshq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
math/fmodq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
math/acosq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
@@ -588,6 +599,15 @@ math/lrintq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
math/nearbyintq.lo: math/$(am__dirstamp) \
math/$(DEPDIR)/$(am__dirstamp)
math/remquoq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/ccoshq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/cexpq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/clog10q.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/clogq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/csinq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/csinhq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/csqrtq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/ctanq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
+math/ctanhq.lo: math/$(am__dirstamp) math/$(DEPDIR)/$(am__dirstamp)
printf/$(am__dirstamp):
@$(MKDIR_P) printf
@: > printf/$(am__dirstamp)
@@ -669,10 +689,18 @@ mostlyclean-compile:
-rm -f math/catanq.lo
-rm -f math/cbrtq.$(OBJEXT)
-rm -f math/cbrtq.lo
+ -rm -f math/ccoshq.$(OBJEXT)
+ -rm -f math/ccoshq.lo
-rm -f math/ceilq.$(OBJEXT)
-rm -f math/ceilq.lo
+ -rm -f math/cexpq.$(OBJEXT)
+ -rm -f math/cexpq.lo
-rm -f math/cimagq.$(OBJEXT)
-rm -f math/cimagq.lo
+ -rm -f math/clog10q.$(OBJEXT)
+ -rm -f math/clog10q.lo
+ -rm -f math/clogq.$(OBJEXT)
+ -rm -f math/clogq.lo
-rm -f math/complex.$(OBJEXT)
-rm -f math/complex.lo
-rm -f math/conjq.$(OBJEXT)
@@ -689,6 +717,16 @@ mostlyclean-compile:
-rm -f math/cprojq.lo
-rm -f math/crealq.$(OBJEXT)
-rm -f math/crealq.lo
+ -rm -f math/csinhq.$(OBJEXT)
+ -rm -f math/csinhq.lo
+ -rm -f math/csinq.$(OBJEXT)
+ -rm -f math/csinq.lo
+ -rm -f math/csqrtq.$(OBJEXT)
+ -rm -f math/csqrtq.lo
+ -rm -f math/ctanhq.$(OBJEXT)
+ -rm -f math/ctanhq.lo
+ -rm -f math/ctanq.$(OBJEXT)
+ -rm -f math/ctanq.lo
-rm -f math/erfq.$(OBJEXT)
-rm -f math/erfq.lo
-rm -f math/expm1q.$(OBJEXT)
@@ -717,6 +755,8 @@ mostlyclean-compile:
-rm -f math/hypotq.lo
-rm -f math/ilogbq.$(OBJEXT)
-rm -f math/ilogbq.lo
+ -rm -f math/isinf_nsq.$(OBJEXT)
+ -rm -f math/isinf_nsq.lo
-rm -f math/isinfq.$(OBJEXT)
-rm -f math/isinfq.lo
-rm -f math/isnanq.$(OBJEXT)
@@ -795,6 +835,8 @@ mostlyclean-compile:
-rm -f math/tgammaq.lo
-rm -f math/truncq.$(OBJEXT)
-rm -f math/truncq.lo
+ -rm -f math/x2y2m1q.$(OBJEXT)
+ -rm -f math/x2y2m1q.lo
-rm -f printf/add_n.$(OBJEXT)
-rm -f printf/add_n.lo
-rm -f printf/addmul_1.$(OBJEXT)
@@ -851,8 +893,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/catanhq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/catanq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/cbrtq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/ccoshq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/ceilq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/cexpq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/cimagq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/clog10q.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/clogq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/complex.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/conjq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/copysignq.Plo@am__quote@
@@ -861,6 +907,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/cosq_kernel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/cprojq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/crealq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/csinhq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/csinq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/csqrtq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/ctanhq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/ctanq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/erfq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/expm1q.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/expq.Plo@am__quote@
@@ -875,6 +926,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/frexpq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/hypotq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/ilogbq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/isinf_nsq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/isinfq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/isnanq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/j0q.Plo@am__quote@
@@ -914,6 +966,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/tanq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/tgammaq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/truncq.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@math/$(DEPDIR)/x2y2m1q.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@printf/$(DEPDIR)/add_n.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@printf/$(DEPDIR)/addmul_1.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@printf/$(DEPDIR)/cmp.Plo@am__quote@
diff --git a/libquadmath/acinclude.m4 b/libquadmath/acinclude.m4
index 38e0808ad9..ab73fb52e0 100644
--- a/libquadmath/acinclude.m4
+++ b/libquadmath/acinclude.m4
@@ -10,3 +10,20 @@ AC_DEFUN([AM_PROG_LIBTOOL])
AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])
+
+dnl Check whether POSIX's signgam is defined in math.h.
+AC_DEFUN([LIBQUAD_CHECK_MATH_H_SIGNGAM], [
+ AC_CACHE_CHECK([whether the math.h includes POSIX's signgam],
+ libgfor_cv_have_math_h_signgam, [
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <math.h>
+void foo(void) { signgam = 1; }]], [])],
+ libgfor_cv_have_math_h_signgam=yes,
+ libgfor_cv_have_math_h_signgam=no)
+ CFLAGS="$save_CFLAGS"])
+ if test $libgfor_cv_have_math_h_signgam = yes; then
+ AC_DEFINE(HAVE_MATH_H_SIGNGAM, 1,
+ [Define to 1 if the math.h includes POSIX's signgam.])
+ fi])
diff --git a/libquadmath/config.h.in b/libquadmath/config.h.in
index ea3f10c278..9d18cc3ee3 100644
--- a/libquadmath/config.h.in
+++ b/libquadmath/config.h.in
@@ -45,6 +45,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if the math.h includes POSIX's signgam. */
+#undef HAVE_MATH_H_SIGNGAM
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff --git a/libquadmath/configure b/libquadmath/configure
index 82065c7e91..907e0cf05c 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -6248,7 +6248,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -6264,9 +6264,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -6285,7 +6295,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -7540,6 +7553,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
fi
+ lt_prog_compiler_pic='-fPIC'
;;
amigaos*)
@@ -10513,7 +10527,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10516 "configure"
+#line 10530 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10619,7 +10633,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10622 "configure"
+#line 10636 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11939,6 +11953,43 @@ fi
done
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the math.h includes POSIX's signgam" >&5
+$as_echo_n "checking whether the math.h includes POSIX's signgam... " >&6; }
+if test "${libgfor_cv_have_math_h_signgam+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <math.h>
+void foo(void) { signgam = 1; }
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libgfor_cv_have_math_h_signgam=yes
+else
+ libgfor_cv_have_math_h_signgam=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_math_h_signgam" >&5
+$as_echo "$libgfor_cv_have_math_h_signgam" >&6; }
+ if test $libgfor_cv_have_math_h_signgam = yes; then
+
+$as_echo "#define HAVE_MATH_H_SIGNGAM 1" >>confdefs.h
+
+ fi
+
# If available, sqrtl and cbrtl speed up the calculation -
# but they are not required
if test x$gcc_no_link != xyes; then
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
index d3bfb040cd..c547da8dc2 100644
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -113,6 +113,7 @@ AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
AC_CHECK_HEADERS(fenv.h langinfo.h locale.h wchar.h wctype.h limits.h ctype.h printf.h errno.h)
+LIBQUAD_CHECK_MATH_H_SIGNGAM
# If available, sqrtl and cbrtl speed up the calculation -
# but they are not required
diff --git a/libquadmath/libquadmath.info b/libquadmath/libquadmath.info
index fe7bdf4e53..e516734a71 100644
--- a/libquadmath/libquadmath.info
+++ b/libquadmath/libquadmath.info
@@ -1,7 +1,7 @@
-This is libquadmath.info, produced by makeinfo version 4.12 from
-/space/rguenther/gcc-4.7.3/gcc-4.7.3/libquadmath/libquadmath.texi.
+This is libquadmath.info, produced by makeinfo version 5.2 from
+libquadmath.texi.
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -11,9 +11,8 @@ Copyright (C) 2010 Free Software Foundation, Inc.
below. A copy of the license is included in the section entitled
"GNU Free Documentation License."
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy
- and modify this GNU manual.
-
+ (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual.
INFO-DIR-SECTION GNU Libraries
START-INFO-DIR-ENTRY
* libquadmath: (libquadmath). GCC Quad-Precision Math Library
@@ -24,7 +23,7 @@ END-INFO-DIR-ENTRY
Published by the Free Software Foundation 51 Franklin Street, Fifth
Floor Boston, MA 02110-1301 USA
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -34,8 +33,8 @@ Floor Boston, MA 02110-1301 USA
below. A copy of the license is included in the section entitled
"GNU Free Documentation License."
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy
- and modify this GNU manual.
+ (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual.

File: libquadmath.info, Node: Top, Next: Typedef and constants, Up: (dir)
@@ -63,62 +62,41 @@ File: libquadmath.info, Node: Typedef and constants, Next: Math Library Routin
1 Typedef and constants
***********************
-The following data type has been defined via `typedef'.
+The following data type has been defined via 'typedef'.
-`__complex128': `__float128'-based complex number
+'__complex128': '__float128'-based complex number
The following macros are defined, which give the numeric limits of
-the `__float128' data type.
-
-`FLT128_MAX': largest finite number
+the '__float128' data type.
-`FLT128_MIN': smallest positive number with full precision
-
-`FLT128_EPSILON': difference between 1 and the next larger
+'FLT128_MAX': largest finite number
+'FLT128_MIN': smallest positive number with full precision
+'FLT128_EPSILON': difference between 1 and the next larger
representable number
-
-`FLT128_DENORM_MIN': smallest positive denormalized number
-
-`FLT128_MANT_DIG': number of digits in the mantissa (bit precision)
-
-`FLT128_MIN_EXP': maximal negative exponent
-
-`FLT128_MAX_EXP': maximal positive exponent
-
-`FLT128_DIG': number of decimal digits in the mantissa
-
-`FLT128_MIN_10_EXP': maximal negative decimal exponent
-
-`FLT128_MAX_10_EXP': maximal positive decimal exponent
-
- The following mathematical constants of type `__float128' are
+'FLT128_DENORM_MIN': smallest positive denormalized number
+'FLT128_MANT_DIG': number of digits in the mantissa (bit precision)
+'FLT128_MIN_EXP': maximal negative exponent
+'FLT128_MAX_EXP': maximal positive exponent
+'FLT128_DIG': number of decimal digits in the mantissa
+'FLT128_MIN_10_EXP': maximal negative decimal exponent
+'FLT128_MAX_10_EXP': maximal positive decimal exponent
+
+ The following mathematical constants of type '__float128' are
defined.
-`M_Eq': the constant e (Euler's number)
-
-`M_LOG2Eq': binary logarithm of 2
-
-`M_LOG10Eq': common, decimal logarithm of 2
-
-`M_LN2q': natural logarithm of 2
-
-`M_LN10q': natural logarithm of 10
-
-`M_PIq': pi
-
-`M_PI_2q': pi divided by two
-
-`M_PI_4q': pi divided by four
-
-`M_1_PIq': one over pi
-
-`M_2_PIq': one over two pi
-
-`M_2_SQRTPIq': two over square root of pi
-
-`M_SQRT2q': square root of 2
-
-`M_SQRT1_2q': one over square root of 2
+'M_Eq': the constant e (Euler's number)
+'M_LOG2Eq': binary logarithm of 2
+'M_LOG10Eq': common, decimal logarithm of 2
+'M_LN2q': natural logarithm of 2
+'M_LN10q': natural logarithm of 10
+'M_PIq': pi
+'M_PI_2q': pi divided by two
+'M_PI_4q': pi divided by four
+'M_1_PIq': one over pi
+'M_2_PIq': one over two pi
+'M_2_SQRTPIq': two over square root of pi
+'M_SQRT2q': square root of 2
+'M_SQRT1_2q': one over square root of 2

File: libquadmath.info, Node: Math Library Routines, Next: I/O Library Routines, Prev: Typedef and constants, Up: Top
@@ -128,184 +106,96 @@ File: libquadmath.info, Node: Math Library Routines, Next: I/O Library Routine
The following mathematical functions are available:
-`acosq': arc cosine function
-
-`acoshq': inverse hyperbolic cosine function
-
-`asinq': arc sine function
-
-`asinhq': inverse hyperbolic sine function
-
-`atanq': arc tangent function
-
-`atanhq': inverse hyperbolic tangent function
-
-`atan2q': arc tangent function
-
-`cbrtq': cube root function
-
-`ceilq': ceiling value function
-
-`copysignq': copy sign of a number
-
-`coshq': hyperbolic cosine function
-
-`cosq': cosine function
-
-`erfq': error function
-
-`erfcq': complementary error function
-
-`expq': exponential function
-
-`expm1q': exponential minus 1 function
-
-`fabsq': absolute value function
-
-`fdimq': positive difference function
-
-`finiteq': check finiteness of value
-
-`floorq': floor value function
-
-`fmaq': fused multiply and add
-
-`fmaxq': determine maximum of two values
-
-`fminq': determine minimum of two values
-
-`fmodq': remainder value function
-
-`frexpq': extract mantissa and exponent
-
-`hypotq': Eucledian distance function
-
-`ilogbq': get exponent of the value
-
-`isinfq': check for infinity
-
-`isnanq': check for not a number
-
-`j0q': Bessel function of the first kind, first order
-
-`j1q': Bessel function of the first kind, second order
-
-`jnq': Bessel function of the first kind, N-th order
-
-`ldexpq': load exponent of the value
-
-`lgammaq': logarithmic gamma function
-
-`llrintq': round to nearest integer value
-
-`llroundq': round to nearest integer value away from zero
-
-`logq': natural logarithm function
-
-`log10q': base 10 logarithm function
-
-`log1pq': compute natural logarithm of the value plus one
-
-`log2q': base 2 logarithm function
-
-`lrintq': round to nearest integer value
-
-`lroundq': round to nearest integer value away from zero
-
-`modfq': decompose the floating-point number
-
-`nanq': return quiet NaN
-
-`nearbyintq': round to nearest integer
-
-`nextafterq': next representable floating-point number
-
-`powq': power function
-
-`remainderq': remainder function
-
-`remquoq': remainder and part of quotient
-
-`rintq': round-to-nearest integral value
-
-`roundq': round-to-nearest integral value, return `__float128'
-
-`scalblnq': compute exponent using `FLT_RADIX'
-
-`scalbnq': compute exponent using `FLT_RADIX'
-
-`signbitq': return sign bit
-
-`sincosq': calculate sine and cosine simulataneously
-
-`sinhq': hyperbolic sine function
-
-`sinq': sine function
-
-`sqrtq': square root function
-
-`tanq': tangent function
-
-`tanhq': hyperbolic tangent function
-
-`tgammaq': true gamma function
-
-`truncq': round to integer, towards zero
-
-`y0q': Bessel function of the second kind, first order
-
-`y1q': Bessel function of the second kind, second order
-
-`ynq': Bessel function of the second kind, N-th order
-
-`cabsq' complex absolute value function
-
-`cargq': calculate the argument
-
-`cimagq' imaginary part of complex number
-
-`crealq': real part of complex number
-
-`cacoshq': complex arc hyperbolic cosine function
-
-`cacosq': complex arc cosine function
-
-`casinhq': complex arc hyperbolic sine function
-
-`casinq': complex arc sine function
-
-`catanhq': complex arc hyperbolic tangent function
-
-`catanq': complex arc tangent function
-
-`ccosq' complex cosine function:
-
-`ccoshq': complex hyperbolic cosine function
-
-`cexpq': complex exponential function
-
-`cexpiq': computes the exponential function of "i" times a
+'acosq': arc cosine function
+'acoshq': inverse hyperbolic cosine function
+'asinq': arc sine function
+'asinhq': inverse hyperbolic sine function
+'atanq': arc tangent function
+'atanhq': inverse hyperbolic tangent function
+'atan2q': arc tangent function
+'cbrtq': cube root function
+'ceilq': ceiling value function
+'copysignq': copy sign of a number
+'coshq': hyperbolic cosine function
+'cosq': cosine function
+'erfq': error function
+'erfcq': complementary error function
+'expq': exponential function
+'expm1q': exponential minus 1 function
+'fabsq': absolute value function
+'fdimq': positive difference function
+'finiteq': check finiteness of value
+'floorq': floor value function
+'fmaq': fused multiply and add
+'fmaxq': determine maximum of two values
+'fminq': determine minimum of two values
+'fmodq': remainder value function
+'frexpq': extract mantissa and exponent
+'hypotq': Eucledian distance function
+'ilogbq': get exponent of the value
+'isinfq': check for infinity
+'isnanq': check for not a number
+'j0q': Bessel function of the first kind, first order
+'j1q': Bessel function of the first kind, second order
+'jnq': Bessel function of the first kind, N-th order
+'ldexpq': load exponent of the value
+'lgammaq': logarithmic gamma function
+'llrintq': round to nearest integer value
+'llroundq': round to nearest integer value away from zero
+'logq': natural logarithm function
+'log10q': base 10 logarithm function
+'log1pq': compute natural logarithm of the value plus one
+'log2q': base 2 logarithm function
+'lrintq': round to nearest integer value
+'lroundq': round to nearest integer value away from zero
+'modfq': decompose the floating-point number
+'nanq': return quiet NaN
+'nearbyintq': round to nearest integer
+'nextafterq': next representable floating-point number
+'powq': power function
+'remainderq': remainder function
+'remquoq': remainder and part of quotient
+'rintq': round-to-nearest integral value
+'roundq': round-to-nearest integral value, return '__float128'
+'scalblnq': compute exponent using 'FLT_RADIX'
+'scalbnq': compute exponent using 'FLT_RADIX'
+'signbitq': return sign bit
+'sincosq': calculate sine and cosine simulataneously
+'sinhq': hyperbolic sine function
+'sinq': sine function
+'sqrtq': square root function
+'tanq': tangent function
+'tanhq': hyperbolic tangent function
+'tgammaq': true gamma function
+'truncq': round to integer, towards zero
+'y0q': Bessel function of the second kind, first order
+'y1q': Bessel function of the second kind, second order
+'ynq': Bessel function of the second kind, N-th order
+'cabsq' complex absolute value function
+'cargq': calculate the argument
+'cimagq' imaginary part of complex number
+'crealq': real part of complex number
+'cacoshq': complex arc hyperbolic cosine function
+'cacosq': complex arc cosine function
+'casinhq': complex arc hyperbolic sine function
+'casinq': complex arc sine function
+'catanhq': complex arc hyperbolic tangent function
+'catanq': complex arc tangent function
+'ccosq' complex cosine function:
+'ccoshq': complex hyperbolic cosine function
+'cexpq': complex exponential function
+'cexpiq': computes the exponential function of "i" times a
real value
-
-`clogq': complex natural logarithm
-
-`clog10q': complex base 10 logarithm
-
-`conjq': complex conjugate function
-
-`cpowq': complex power function
-
-`cprojq': project into Riemann Sphere
-
-`csinq': complex sine function
-
-`csinhq': complex hyperbolic sine function
-
-`csqrtq': complex square root
-
-`ctanq': complex tangent function
-
-`ctanhq': complex hyperbolic tangent function
+'clogq': complex natural logarithm
+'clog10q': complex base 10 logarithm
+'conjq': complex conjugate function
+'cpowq': complex power function
+'cprojq': project into Riemann Sphere
+'csinq': complex sine function
+'csinhq': complex hyperbolic sine function
+'csqrtq': complex square root
+'ctanq': complex tangent function
+'ctanhq': complex hyperbolic tangent function

File: libquadmath.info, Node: I/O Library Routines, Next: GNU Free Documentation License, Prev: Math Library Routines, Up: Top
@@ -315,25 +205,25 @@ File: libquadmath.info, Node: I/O Library Routines, Next: GNU Free Documentati
* Menu:
-* `strtoflt128': strtoflt128, Convert from string
-* `quadmath_snprintf': quadmath_snprintf, Convert to string
+* 'strtoflt128': strtoflt128, Convert from string
+* 'quadmath_snprintf': quadmath_snprintf, Convert to string

File: libquadmath.info, Node: strtoflt128, Next: quadmath_snprintf, Up: I/O Library Routines
-3.1 `strtoflt128' -- Convert from string
+3.1 'strtoflt128' -- Convert from string
========================================
-The function `strtoflt128' converts a string into a `__float128' number.
+The function 'strtoflt128' converts a string into a '__float128' number.
Syntax
- `__float128 strtoflt128 (const char *s, char **sp)'
+ '__float128 strtoflt128 (const char *s, char **sp)'
_Arguments_:
- S input string
- SP the address of the next character in the string
+ S input string
+ SP the address of the next character in the string
- The argument SP contains, if not `NULL', the address of the next
+ The argument SP contains, if not 'NULL', the address of the next
character following the parts of the string, which have been read.
Example
@@ -351,29 +241,28 @@ Example

File: libquadmath.info, Node: quadmath_snprintf, Prev: strtoflt128, Up: I/O Library Routines
-3.2 `quadmath_snprintf' -- Convert to string
+3.2 'quadmath_snprintf' -- Convert to string
============================================
-The function `quadmath_snprintf' converts a `__float128' floating-point
-number into a string. It is a specialized alternative to `snprintf',
+The function 'quadmath_snprintf' converts a '__float128' floating-point
+number into a string. It is a specialized alternative to 'snprintf',
where the format string is restricted to a single conversion specifier
-with `Q' modifier and conversion specifier `e', `E', `f', `F', `g',
-`G', `a' or `A', with no extra characters before or after the
-conversion specifier. The `%m$' or `*m$' style must not be used in the
-format.
+with 'Q' modifier and conversion specifier 'e', 'E', 'f', 'F', 'g', 'G',
+'a' or 'A', with no extra characters before or after the conversion
+specifier. The '%m$' or '*m$' style must not be used in the format.
Syntax
- `int quadmath_snprintf (char *s, size_t size, const char *format,
+ 'int quadmath_snprintf (char *s, size_t size, const char *format,
...)'
_Arguments_:
- S output string
- SIZE byte size of the string, including tailing NUL
- FORMAT conversion specifier string
+ S output string
+ SIZE byte size of the string, including tailing NUL
+ FORMAT conversion specifier string
Note
On some targets when supported by the C library hooks are installed
- for `printf' family of functions, so that `printf ("%Qe", 1.2Q);'
+ for 'printf' family of functions, so that 'printf ("%Qe", 1.2Q);'
etc. works too.
Example
@@ -413,7 +302,6 @@ Example
return 0;
}
-

File: libquadmath.info, Node: GNU Free Documentation License, Next: Reporting Bugs, Prev: I/O Library Routines, Up: Top
@@ -423,7 +311,7 @@ GNU Free Documentation License
Version 1.3, 3 November 2008
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
- `http://fsf.org/'
+ <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -448,21 +336,21 @@ GNU Free Documentation License
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
- of subject matter or whether it is published as a printed book.
- We recommend this License principally for works whose purpose is
+ of subject matter or whether it is published as a printed book. We
+ recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium,
- that contains a notice placed by the copyright holder saying it
- can be distributed under the terms of this License. Such a notice
+ that contains a notice placed by the copyright holder saying it can
+ be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration,
to use that work under the conditions stated herein. The
"Document", below, refers to any such manual or work. Any member
- of the public is a licensee, and is addressed as "you". You
- accept the license if you copy, modify or distribute the work in a
- way requiring permission under copyright law.
+ of the public is a licensee, and is addressed as "you". You accept
+ the license if you copy, modify or distribute the work in a way
+ requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
@@ -480,12 +368,12 @@ GNU Free Documentation License
regarding them.
The "Invariant Sections" are certain Secondary Sections whose
- titles are designated, as being those of Invariant Sections, in
- the notice that says that the Document is released under this
- License. If a section does not fit the above definition of
- Secondary then it is not allowed to be designated as Invariant.
- The Document may contain zero Invariant Sections. If the Document
- does not identify any Invariant Sections then there are none.
+ titles are designated, as being those of Invariant Sections, in the
+ notice that says that the Document is released under this License.
+ If a section does not fit the above definition of Secondary then it
+ is not allowed to be designated as Invariant. The Document may
+ contain zero Invariant Sections. If the Document does not identify
+ any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
@@ -496,27 +384,27 @@ GNU Free Documentation License
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
- straightforwardly with generic text editors or (for images
- composed of pixels) generic paint programs or (for drawings) some
- widely available drawing editor, and that is suitable for input to
- text formatters or for automatic translation to a variety of
- formats suitable for input to text formatters. A copy made in an
- otherwise Transparent file format whose markup, or absence of
- markup, has been arranged to thwart or discourage subsequent
- modification by readers is not Transparent. An image format is
- not Transparent if used for any substantial amount of text. A
- copy that is not "Transparent" is called "Opaque".
+ straightforwardly with generic text editors or (for images composed
+ of pixels) generic paint programs or (for drawings) some widely
+ available drawing editor, and that is suitable for input to text
+ formatters or for automatic translation to a variety of formats
+ suitable for input to text formatters. A copy made in an otherwise
+ Transparent file format whose markup, or absence of markup, has
+ been arranged to thwart or discourage subsequent modification by
+ readers is not Transparent. An image format is not Transparent if
+ used for any substantial amount of text. A copy that is not
+ "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
- SGML or XML using a publicly available DTD, and
- standard-conforming simple HTML, PostScript or PDF designed for
- human modification. Examples of transparent image formats include
- PNG, XCF and JPG. Opaque formats include proprietary formats that
- can be read and edited only by proprietary word processors, SGML or
- XML for which the DTD and/or processing tools are not generally
- available, and the machine-generated HTML, PostScript or PDF
- produced by some word processors for output purposes only.
+ SGML or XML using a publicly available DTD, and standard-conforming
+ simple HTML, PostScript or PDF designed for human modification.
+ Examples of transparent image formats include PNG, XCF and JPG.
+ Opaque formats include proprietary formats that can be read and
+ edited only by proprietary word processors, SGML or XML for which
+ the DTD and/or processing tools are not generally available, and
+ the machine-generated HTML, PostScript or PDF produced by some word
+ processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
@@ -554,8 +442,8 @@ GNU Free Documentation License
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
- distribute a large enough number of copies you must also follow
- the conditions in section 3.
+ distribute a large enough number of copies you must also follow the
+ conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
@@ -569,12 +457,11 @@ GNU Free Documentation License
these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
- front cover must present the full title with all words of the
- title equally prominent and visible. You may add other material
- on the covers in addition. Copying with changes limited to the
- covers, as long as they preserve the title of the Document and
- satisfy these conditions, can be treated as verbatim copying in
- other respects.
+ front cover must present the full title with all words of the title
+ equally prominent and visible. You may add other material on the
+ covers in addition. Copying with changes limited to the covers, as
+ long as they preserve the title of the Document and satisfy these
+ conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
@@ -582,40 +469,39 @@ GNU Free Documentation License
adjacent pages.
If you publish or distribute Opaque copies of the Document
- numbering more than 100, you must either include a
- machine-readable Transparent copy along with each Opaque copy, or
- state in or with each Opaque copy a computer-network location from
- which the general network-using public has access to download
- using public-standard network protocols a complete Transparent
- copy of the Document, free of added material. If you use the
- latter option, you must take reasonably prudent steps, when you
- begin distribution of Opaque copies in quantity, to ensure that
- this Transparent copy will remain thus accessible at the stated
- location until at least one year after the last time you
- distribute an Opaque copy (directly or through your agents or
- retailers) of that edition to the public.
+ numbering more than 100, you must either include a machine-readable
+ Transparent copy along with each Opaque copy, or state in or with
+ each Opaque copy a computer-network location from which the general
+ network-using public has access to download using public-standard
+ network protocols a complete Transparent copy of the Document, free
+ of added material. If you use the latter option, you must take
+ reasonably prudent steps, when you begin distribution of Opaque
+ copies in quantity, to ensure that this Transparent copy will
+ remain thus accessible at the stated location until at least one
+ year after the last time you distribute an Opaque copy (directly or
+ through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
- the Document well before redistributing any large number of
- copies, to give them a chance to provide you with an updated
- version of the Document.
+ the Document well before redistributing any large number of copies,
+ to give them a chance to provide you with an updated version of the
+ Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
- release the Modified Version under precisely this License, with
- the Modified Version filling the role of the Document, thus
- licensing distribution and modification of the Modified Version to
- whoever possesses a copy of it. In addition, you must do these
- things in the Modified Version:
+ release the Modified Version under precisely this License, with the
+ Modified Version filling the role of the Document, thus licensing
+ distribution and modification of the Modified Version to whoever
+ possesses a copy of it. In addition, you must do these things in
+ the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
- distinct from that of the Document, and from those of
- previous versions (which should, if there were any, be listed
- in the History section of the Document). You may use the
- same title as a previous version if the original publisher of
- that version gives permission.
+ distinct from that of the Document, and from those of previous
+ versions (which should, if there were any, be listed in the
+ History section of the Document). You may use the same title
+ as a previous version if the original publisher of that
+ version gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in
@@ -645,31 +531,30 @@ GNU Free Documentation License
I. Preserve the section Entitled "History", Preserve its Title,
and add to it an item stating at least the title, year, new
- authors, and publisher of the Modified Version as given on
- the Title Page. If there is no section Entitled "History" in
- the Document, create one stating the title, year, authors,
- and publisher of the Document as given on its Title Page,
- then add an item describing the Modified Version as stated in
- the previous sentence.
+ authors, and publisher of the Modified Version as given on the
+ Title Page. If there is no section Entitled "History" in the
+ Document, create one stating the title, year, authors, and
+ publisher of the Document as given on its Title Page, then add
+ an item describing the Modified Version as stated in the
+ previous sentence.
J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
- previous versions it was based on. These may be placed in
- the "History" section. You may omit a network location for a
- work that was published at least four years before the
- Document itself, or if the original publisher of the version
- it refers to gives permission.
+ previous versions it was based on. These may be placed in the
+ "History" section. You may omit a network location for a work
+ that was published at least four years before the Document
+ itself, or if the original publisher of the version it refers
+ to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the
- section all the substance and tone of each of the contributor
+ Preserve the Title of the section, and preserve in the section
+ all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
- L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section
- titles.
+ L. Preserve all the Invariant Sections of the Document, unaltered
+ in their text and in their titles. Section numbers or the
+ equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
@@ -682,11 +567,11 @@ GNU Free Documentation License
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
- material copied from the Document, you may at your option
- designate some or all of these sections as invariant. To do this,
- add their titles to the list of Invariant Sections in the Modified
- Version's license notice. These titles must be distinct from any
- other section titles.
+ material copied from the Document, you may at your option designate
+ some or all of these sections as invariant. To do this, add their
+ titles to the list of Invariant Sections in the Modified Version's
+ license notice. These titles must be distinct from any other
+ section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
@@ -695,15 +580,15 @@ GNU Free Documentation License
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text,
- and a passage of up to 25 words as a Back-Cover Text, to the end
- of the list of Cover Texts in the Modified Version. Only one
- passage of Front-Cover Text and one of Back-Cover Text may be
- added by (or through arrangements made by) any one entity. If the
- Document already includes a cover text for the same cover,
- previously added by you or by arrangement made by the same entity
- you are acting on behalf of, you may not add another; but you may
- replace the old one, on explicit permission from the previous
- publisher that added the old one.
+ and a passage of up to 25 words as a Back-Cover Text, to the end of
+ the list of Cover Texts in the Modified Version. Only one passage
+ of Front-Cover Text and one of Back-Cover Text may be added by (or
+ through arrangements made by) any one entity. If the Document
+ already includes a cover text for the same cover, previously added
+ by you or by arrangement made by the same entity you are acting on
+ behalf of, you may not add another; but you may replace the old
+ one, on explicit permission from the previous publisher that added
+ the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
@@ -713,8 +598,8 @@ GNU Free Documentation License
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
- modified versions, provided that you include in the combination
- all of the Invariant Sections of all of the original documents,
+ modified versions, provided that you include in the combination all
+ of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
@@ -741,20 +626,20 @@ GNU Free Documentation License
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
- rules of this License for verbatim copying of each of the
- documents in all other respects.
+ rules of this License for verbatim copying of each of the documents
+ in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
- a copy of this License into the extracted document, and follow
- this License in all other respects regarding verbatim copying of
- that document.
+ a copy of this License into the extracted document, and follow this
+ License in all other respects regarding verbatim copying of that
+ document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
- separate and independent documents or works, in or on a volume of
- a storage or distribution medium, is called an "aggregate" if the
+ separate and independent documents or works, in or on a volume of a
+ storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the
legal rights of the compilation's users beyond what the individual
works permit. When the Document is included in an aggregate, this
@@ -799,8 +684,8 @@ GNU Free Documentation License
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
- provisionally, unless and until the copyright holder explicitly
- and finally terminates your license, and (b) permanently, if the
+ provisionally, unless and until the copyright holder explicitly and
+ finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
@@ -812,33 +697,33 @@ GNU Free Documentation License
after your receipt of the notice.
Termination of your rights under this section does not terminate
- the licenses of parties who have received copies or rights from
- you under this License. If your rights have been terminated and
- not permanently reinstated, receipt of a copy of some or all of
- the same material does not give you any rights to use it.
+ the licenses of parties who have received copies or rights from you
+ under this License. If your rights have been terminated and not
+ permanently reinstated, receipt of a copy of some or all of the
+ same material does not give you any rights to use it.
- 10. FUTURE REVISIONS OF THIS LICENSE
+ 10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
- `http://www.gnu.org/copyleft/'.
+ <http://www.gnu.org/copyleft/>.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
version of this License "or any later version" applies to it, you
have the option of following the terms and conditions either of
that specified version or of any later version that has been
- published (not as a draft) by the Free Software Foundation. If
- the Document does not specify a version number of this License,
- you may choose any version ever published (not as a draft) by the
- Free Software Foundation. If the Document specifies that a proxy
- can decide which future versions of this License can be used, that
+ published (not as a draft) by the Free Software Foundation. If the
+ Document does not specify a version number of this License, you may
+ choose any version ever published (not as a draft) by the Free
+ Software Foundation. If the Document specifies that a proxy can
+ decide which future versions of this License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Document.
- 11. RELICENSING
+ 11. RELICENSING
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
World Wide Web server that publishes copyrightable works and also
@@ -868,7 +753,6 @@ GNU Free Documentation License
site under CC-BY-SA on the same site at any time before August 1,
2009, provided the MMC is eligible for relicensing.
-
ADDENDUM: How to use this License for your documents
====================================================
@@ -885,7 +769,7 @@ notices just after the title page:
Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover
-Texts, replace the "with...Texts." line with this:
+Texts, replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
@@ -896,9 +780,9 @@ combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License, to
-permit their use in free software.
+recommend releasing these examples in parallel under your choice of free
+software license, such as the GNU General Public License, to permit
+their use in free software.

File: libquadmath.info, Node: Reporting Bugs, Prev: GNU Free Documentation License, Up: Top
@@ -907,18 +791,18 @@ File: libquadmath.info, Node: Reporting Bugs, Prev: GNU Free Documentation Lic
****************
Bugs in the GCC Quad-Precision Math Library implementation should be
-reported via `http://gcc.gnu.org/bugs.html'.
+reported via <http://gcc.gnu.org/bugs.html>.

Tag Table:
-Node: Top1674
-Node: Typedef and constants2408
-Node: Math Library Routines3848
-Node: I/O Library Routines7653
-Node: strtoflt1287978
-Node: quadmath_snprintf8736
-Node: GNU Free Documentation License10944
-Node: Reporting Bugs36110
+Node: Top1633
+Node: Typedef and constants2367
+Node: Math Library Routines3786
+Node: I/O Library Routines7503
+Node: strtoflt1287828
+Node: quadmath_snprintf8588
+Node: GNU Free Documentation License10798
+Node: Reporting Bugs35945

End Tag Table
diff --git a/libquadmath/libquadmath.texi b/libquadmath/libquadmath.texi
index c499d18748..c9ebf6a12b 100644
--- a/libquadmath/libquadmath.texi
+++ b/libquadmath/libquadmath.texi
@@ -6,7 +6,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 2010 Free Software Foundation, Inc.
+Copyright @copyright{} 2010-2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
diff --git a/libquadmath/math/acoshq.c b/libquadmath/math/acoshq.c
index b0a1e4e549..9845a8e364 100644
--- a/libquadmath/math/acoshq.c
+++ b/libquadmath/math/acoshq.c
@@ -1,4 +1,4 @@
-/* e_acoshl.c -- long double version of e_acosh.c.
+/* acoshq.c -- __float128 version of e_acosh.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,7 +13,7 @@
* ====================================================
*/
-/* __ieee754_acoshl(x)
+/* acoshq(x)
* Method :
* Based on
* acoshl(x) = logl [ x + sqrtl(x*x-1) ]
diff --git a/libquadmath/math/acosq.c b/libquadmath/math/acosq.c
index a8a361d23b..7ef7947465 100644
--- a/libquadmath/math/acosq.c
+++ b/libquadmath/math/acosq.c
@@ -31,7 +31,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __ieee754_acosl(x)
+/* acosq(x)
* Method :
* acos(x) = pi/2 - asin(x)
* acos(-x) = pi/2 + asin(x)
@@ -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: sqrtq.
*/
#include "quadmath-imp.h"
diff --git a/libquadmath/math/asinhq.c b/libquadmath/math/asinhq.c
index be044dcd87..9be0aa1f05 100644
--- a/libquadmath/math/asinhq.c
+++ b/libquadmath/math/asinhq.c
@@ -1,4 +1,4 @@
-/* s_asinhl.c -- long double version of s_asinh.c.
+/* asinhq.c -- __float128 version of s_asinh.c.
* Conversion to long double by Ulrich Drepper,
* Cygnus Support, drepper@cygnus.com.
*/
diff --git a/libquadmath/math/asinq.c b/libquadmath/math/asinq.c
index d4321a58e0..7bd4d768c9 100644
--- a/libquadmath/math/asinq.c
+++ b/libquadmath/math/asinq.c
@@ -31,7 +31,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __ieee754_asin(x)
+/* asinq(x)
* Method :
* Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ...
* we approximate asin(x) on [0,0.5] by
diff --git a/libquadmath/math/atan2q.c b/libquadmath/math/atan2q.c
index fbe64d62b9..daa303efba 100644
--- a/libquadmath/math/atan2q.c
+++ b/libquadmath/math/atan2q.c
@@ -1,4 +1,4 @@
-/* e_atan2l.c -- long double version of e_atan2.c.
+/* atan2q.c -- __float128 version of e_atan2.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/atanhq.c b/libquadmath/math/atanhq.c
index 73db957d3b..b34036715d 100644
--- a/libquadmath/math/atanhq.c
+++ b/libquadmath/math/atanhq.c
@@ -14,7 +14,7 @@
* ====================================================
*/
-/* __ieee754_atanhl(x)
+/* atanhq(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
* 2.For x>=0.5
diff --git a/libquadmath/math/atanq.c b/libquadmath/math/atanq.c
index cb38a340a2..8eccdc3317 100644
--- a/libquadmath/math/atanq.c
+++ b/libquadmath/math/atanq.c
@@ -167,6 +167,7 @@ static const __float128
q4 = 2.173623741810414221251136181221172551416E1Q;
/* q5 = 1.000000000000000000000000000000000000000E0 */
+static const long double huge = 1.0e4930Q;
__float128
atanq (__float128 x)
@@ -197,6 +198,22 @@ atanq (__float128 x)
return atantbl[83];
}
+ if (k <= 0x3fc50000) /* |x| < 2**-58 */
+ {
+ /* Raise inexact. */
+ if (huge + x > 0.0)
+ return x;
+ }
+
+ if (k >= 0x40720000) /* |x| > 2**115 */
+ {
+ /* Saturate result to {-,+}pi/2 */
+ if (sign)
+ return -atantbl[83];
+ else
+ return atantbl[83];
+ }
+
if (sign)
x = -x;
diff --git a/libquadmath/math/cacoshq.c b/libquadmath/math/cacoshq.c
index 8acc570de7..a7025dc917 100644
--- a/libquadmath/math/cacoshq.c
+++ b/libquadmath/math/cacoshq.c
@@ -63,6 +63,16 @@ cacoshq (__complex128 x)
__real__ res = 0.0;
__imag__ res = copysignq (M_PI_2q, __imag__ x);
}
+ /* The factor 16 is just a guess. */
+ else if (16.0Q * fabsq (__imag__ x) < fabsq (__real__ x))
+ {
+ /* Kahan's formula which avoid cancellation through subtraction in
+ some cases. */
+ res = 2.0Q * clogq (csqrtq ((x + 1.0Q) / 2.0Q)
+ + csqrtq ((x - 1.0Q) / 2.0Q));
+ if (signbitq (__real__ res))
+ __real__ res = 0.0Q;
+ }
else
{
__complex128 y;
@@ -72,17 +82,13 @@ cacoshq (__complex128 x)
y = csqrtq (y);
- if (__real__ x < 0.0)
+ if (signbitq (x))
y = -y;
__real__ y += __real__ x;
__imag__ y += __imag__ x;
res = clogq (y);
-
- /* We have to use the positive branch. */
- if (__real__ res < 0.0)
- res = -res;
}
return res;
diff --git a/libquadmath/math/casinhq.c b/libquadmath/math/casinhq.c
index ffa45fa81d..11487b967f 100644
--- a/libquadmath/math/casinhq.c
+++ b/libquadmath/math/casinhq.c
@@ -72,6 +72,11 @@ casinhq (__complex128 x)
__imag__ y += __imag__ x;
res = clogq (y);
+
+ /* Ensure zeros have correct sign and results are correct if
+ very close to branch cuts. */
+ __real__ res = copysignq (__real__ res, __real__ x);
+ __imag__ res = copysignq (__imag__ res, __imag__ x);
}
return res;
diff --git a/libquadmath/math/cbrtq.c b/libquadmath/math/cbrtq.c
index f61f32513e..2567d4d5bd 100644
--- a/libquadmath/math/cbrtq.c
+++ b/libquadmath/math/cbrtq.c
@@ -1,64 +1,132 @@
+/* cbrtq.c
+ *
+ * Cube root, __float128 precision
+ *
+ *
+ *
+ * SYNOPSIS:
+ *
+ * __float128 x, y, cbrtq();
+ *
+ * y = cbrtq( x );
+ *
+ *
+ *
+ * DESCRIPTION:
+ *
+ * Returns the cube root of the argument, which may be negative.
+ *
+ * Range reduction involves determining the power of 2 of
+ * the argument. A polynomial of degree 2 applied to the
+ * mantissa, and multiplication by the cube root of 1, 2, or 4
+ * approximates the root to within about 0.1%. Then Newton's
+ * iteration is used three times to converge to an accurate
+ * result.
+ *
+ *
+ *
+ * ACCURACY:
+ *
+ * Relative error:
+ * arithmetic domain # trials peak rms
+ * IEEE -8,8 100000 1.3e-34 3.9e-35
+ * IEEE exp(+-707) 100000 1.3e-34 4.3e-35
+ *
+ */
+
+/*
+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/>. */
+
+
#include "quadmath-imp.h"
-#include <math.h>
-#include <float.h>
+
+static const long double CBRT2 = 1.259921049894873164767210607278228350570251Q;
+static const long double CBRT4 = 1.587401051968199474751705639272308260391493Q;
+static const long double CBRT2I = 0.7937005259840997373758528196361541301957467Q;
+static const long double CBRT4I = 0.6299605249474365823836053036391141752851257Q;
+
__float128
-cbrtq (const __float128 x)
+cbrtq ( __float128 x)
{
- __float128 y;
- int exp, i;
+ int e, rem, sign;
+ __float128 z;
+
+ if (!finiteq (x))
+ return x + x;
if (x == 0)
- return x;
-
- if (isnanq (x))
- return x;
-
- if (x <= DBL_MAX && x >= DBL_MIN)
- {
- /* Use double result as starting point. */
- y = cbrt ((double) x);
-
- /* Two Newton iterations. */
- y -= 0.333333333333333333333333333333333333333333333333333Q
- * (y - x / (y * y));
- y -= 0.333333333333333333333333333333333333333333333333333Q
- * (y - x / (y * y));
- return y;
- }
-
-#ifdef HAVE_CBRTL
- if (x <= LDBL_MAX && x >= LDBL_MIN)
- {
- /* Use long double result as starting point. */
- y = cbrtl ((long double) x);
-
- /* One Newton iteration. */
- y -= 0.333333333333333333333333333333333333333333333333333Q
- * (y - x / (y * y));
- return y;
- }
-#endif
-
- /* If we're outside of the range of C types, we have to compute
- the initial guess the hard way. */
- y = frexpq (x, &exp);
-
- i = exp % 3;
- y = (i >= 0 ? i : -i);
- if (i == 1)
- y *= 2, exp--;
- else if (i == 2)
- y *= 4, exp -= 2;
-
- y = cbrt (y);
- y = scalbnq (y, exp / 3);
-
- /* Two Newton iterations. */
- y -= 0.333333333333333333333333333333333333333333333333333Q
- * (y - x / (y * y));
- y -= 0.333333333333333333333333333333333333333333333333333Q
- * (y - x / (y * y));
- return y;
-}
+ 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 = frexpq (x, &e);
+
+ /* Approximate cube root of number between .5 and 1,
+ peak relative error = 1.2e-6 */
+ x = ((((1.3584464340920900529734e-1Q * x
+ - 6.3986917220457538402318e-1Q) * x
+ + 1.2875551670318751538055e0Q) * x
+ - 1.4897083391357284957891e0Q) * x
+ + 1.3304961236013647092521e0Q) * x + 3.7568280825958912391243e-1Q;
+ /* 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 = ldexpq (x, e);
+
+ /* Newton iteration */
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333Q;
+
+ if (sign < 0)
+ x = -x;
+ return (x);
+}
diff --git a/libquadmath/math/ccoshq.c b/libquadmath/math/ccoshq.c
new file mode 100644
index 0000000000..8d55ad3a99
--- /dev/null
+++ b/libquadmath/math/ccoshq.c
@@ -0,0 +1,145 @@
+/* Complex cosine hyperbole function for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+ccoshq (__complex128 x)
+{
+ __complex128 retval;
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ if (__builtin_expect (rcls >= QUADFP_ZERO, 1))
+ {
+ /* Real part is finite. */
+ if (__builtin_expect (icls >= QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q);
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ if (fabsq (__real__ x) > t)
+ {
+ __float128 exp_t = expq (t);
+ __float128 rx = fabsq (__real__ x);
+ if (signbitq (__real__ x))
+ sinix = -sinix;
+ rx -= t;
+ sinix *= exp_t / 2.0Q;
+ cosix *= exp_t / 2.0Q;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = FLT128_MAX * cosix;
+ __imag__ retval = FLT128_MAX * sinix;
+ }
+ else
+ {
+ __float128 exp_val = expq (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = coshq (__real__ x) * cosix;
+ __imag__ retval = sinhq (__real__ x) * sinix;
+ }
+ }
+ else
+ {
+ __imag__ retval = __real__ x == 0.0Q ? 0.0Q : nanq ("");
+ __real__ retval = nanq ("") + nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (icls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else if (rcls == QUADFP_INFINITE)
+ {
+ /* Real part is infinite. */
+ if (__builtin_expect (icls > QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ __real__ retval = copysignq (HUGE_VALQ, cosix);
+ __imag__ retval = (copysignq (HUGE_VALQ, sinix)
+ * copysignq (1.0Q, __real__ x));
+ }
+ else if (icls == QUADFP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = HUGE_VALQ;
+ __imag__ retval = __imag__ x * copysignq (1.0Q, __real__ x);
+ }
+ else
+ {
+ /* The addition raises the invalid exception. */
+ __real__ retval = HUGE_VALQ;
+ __imag__ retval = nanq ("") + nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (icls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else
+ {
+ __real__ retval = nanq ("");
+ __imag__ retval = __imag__ x == 0.0 ? __imag__ x : nanq ("");
+ }
+
+ return retval;
+}
diff --git a/libquadmath/math/ceilq.c b/libquadmath/math/ceilq.c
index 577d8cd989..0d9bb8b87f 100644
--- a/libquadmath/math/ceilq.c
+++ b/libquadmath/math/ceilq.c
@@ -1,4 +1,4 @@
-/* s_ceill.c -- long double version of s_ceil.c.
+/* ceilq.c -- __float128 version of s_ceil.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/cexpq.c b/libquadmath/math/cexpq.c
new file mode 100644
index 0000000000..bd4be1ebe7
--- /dev/null
+++ b/libquadmath/math/cexpq.c
@@ -0,0 +1,152 @@
+/* Return value of complex exponential function for complex __float128 value.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+cexpq (__complex128 x)
+{
+ __complex128 retval;
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ if (__builtin_expect (rcls >= QUADFP_ZERO, 1))
+ {
+ /* Real part is finite. */
+ if (__builtin_expect (icls >= QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q);
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ if (__real__ x > t)
+ {
+ __float128 exp_t = expq (t);
+ __real__ x -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ if (__real__ x > t)
+ {
+ __real__ x -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ }
+ if (__real__ x > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = FLT128_MAX * cosix;
+ __imag__ retval = FLT128_MAX * sinix;
+ }
+ else
+ {
+ __float128 exp_val = expq (__real__ x);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ /* If the imaginary part is +-inf or NaN and the real part
+ is not +-inf the result is NaN + iNaN. */
+ __real__ retval = nanq ("");
+ __imag__ retval = nanq ("");
+
+#ifdef HAVE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else if (__builtin_expect (rcls == QUADFP_INFINITE, 1))
+ {
+ /* Real part is infinite. */
+ if (__builtin_expect (icls >= QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ __float128 value = signbitq (__real__ x) ? 0.0Q : HUGE_VALQ;
+
+ if (icls == QUADFP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = value;
+ __imag__ retval = __imag__ x;
+ }
+ else
+ {
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ __real__ retval = copysignq (value, cosix);
+ __imag__ retval = copysignq (value, sinix);
+ }
+ }
+ else if (signbitq (__real__ x) == 0)
+ {
+ __real__ retval = HUGE_VALQ;
+ __imag__ retval = nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (icls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ else
+ {
+ __real__ retval = 0.0Q;
+ __imag__ retval = copysignq (0.0Q, __imag__ x);
+ }
+ }
+ else
+ {
+ /* If the real part is NaN the result is NaN + iNaN. */
+ __real__ retval = nanq ("");
+ __imag__ retval = nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (rcls != QUADFP_NAN || icls != QUADFP_NAN)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+
+ return retval;
+}
diff --git a/libquadmath/math/clog10q.c b/libquadmath/math/clog10q.c
new file mode 100644
index 0000000000..c379bec72b
--- /dev/null
+++ b/libquadmath/math/clog10q.c
@@ -0,0 +1,116 @@
+/* Compute complex base 10 logarithm for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+
+/* log_10 (2). */
+#define M_LOG10_2q 0.3010299956639811952137388947244930267682Q
+
+
+__complex128
+clog10q (__complex128 x)
+{
+ __complex128 result;
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ if (__builtin_expect (rcls == QUADFP_ZERO && icls == QUADFP_ZERO, 0))
+ {
+ /* Real and imaginary part are 0.0. */
+ __imag__ result = signbitq (__real__ x) ? M_PIq : 0.0Q;
+ __imag__ result = copysignq (__imag__ result, __imag__ x);
+ /* Yes, the following line raises an exception. */
+ __real__ result = -1.0Q / fabsq (__real__ x);
+ }
+ else if (__builtin_expect (rcls != QUADFP_NAN && icls != QUADFP_NAN, 1))
+ {
+ /* Neither real nor imaginary part is NaN. */
+ __float128 absx = fabsq (__real__ x), absy = fabsq (__imag__ x);
+ int scale = 0;
+
+ if (absx < absy)
+ {
+ __float128 t = absx;
+ absx = absy;
+ absy = t;
+ }
+
+ if (absx > FLT128_MAX / 2.0Q)
+ {
+ scale = -1;
+ absx = scalbnq (absx, scale);
+ absy = (absy >= FLT128_MIN * 2.0Q ? scalbnq (absy, scale) : 0.0Q);
+ }
+ else if (absx < FLT128_MIN && absy < FLT128_MIN)
+ {
+ scale = FLT128_MANT_DIG;
+ absx = scalbnq (absx, scale);
+ absy = scalbnq (absy, scale);
+ }
+
+ if (absx == 1.0Q && scale == 0)
+ {
+ __float128 absy2 = absy * absy;
+ if (absy2 <= FLT128_MIN * 2.0Q * M_LN10q)
+ __real__ result
+ = (absy2 / 2.0Q - absy2 * absy2 / 4.0Q) * M_LOG10Eq;
+ else
+ __real__ result = log1pq (absy2) * (M_LOG10Eq / 2.0Q);
+ }
+ else if (absx > 1.0Q && absx < 2.0Q && absy < 1.0Q && scale == 0)
+ {
+ __float128 d2m1 = (absx - 1.0Q) * (absx + 1.0Q);
+ if (absy >= FLT128_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = log1pq (d2m1) * (M_LOG10Eq / 2.0Q);
+ }
+ else if (absx < 1.0Q
+ && absx >= 0.75Q
+ && absy < FLT128_EPSILON / 2.0Q
+ && scale == 0)
+ {
+ __float128 d2m1 = (absx - 1.0Q) * (absx + 1.0Q);
+ __real__ result = log1pq (d2m1) * (M_LOG10Eq / 2.0Q);
+ }
+ else if (absx < 1.0Q && (absx >= 0.75Q || absy >= 0.5Q) && scale == 0)
+ {
+ __float128 d2m1 = __quadmath_x2y2m1q (absx, absy);
+ __real__ result = log1pq (d2m1) * (M_LOG10Eq / 2.0Q);
+ }
+ else
+ {
+ __float128 d = hypotq (absx, absy);
+ __real__ result = log10q (d) - scale * M_LOG10_2q;
+ }
+
+ __imag__ result = M_LOG10Eq * atan2q (__imag__ x, __real__ x);
+ }
+ else
+ {
+ __imag__ result = nanq ("");
+ if (rcls == QUADFP_INFINITE || icls == QUADFP_INFINITE)
+ /* Real or imaginary part is infinite. */
+ __real__ result = HUGE_VALQ;
+ else
+ __real__ result = nanq ("");
+ }
+
+ return result;
+}
diff --git a/libquadmath/math/clogq.c b/libquadmath/math/clogq.c
new file mode 100644
index 0000000000..1a772cd434
--- /dev/null
+++ b/libquadmath/math/clogq.c
@@ -0,0 +1,111 @@
+/* Compute complex natural logarithm for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+
+__complex128
+clogq (__complex128 x)
+{
+ __complex128 result;
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ if (__builtin_expect (rcls == QUADFP_ZERO && icls == QUADFP_ZERO, 0))
+ {
+ /* Real and imaginary part are 0.0. */
+ __imag__ result = signbitq (__real__ x) ? M_PIq : 0.0Q;
+ __imag__ result = copysignq (__imag__ result, __imag__ x);
+ /* Yes, the following line raises an exception. */
+ __real__ result = -1.0Q / fabsq (__real__ x);
+ }
+ else if (__builtin_expect (rcls != QUADFP_NAN && icls != QUADFP_NAN, 1))
+ {
+ /* Neither real nor imaginary part is NaN. */
+ __float128 absx = fabsq (__real__ x), absy = fabsq (__imag__ x);
+ int scale = 0;
+
+ if (absx < absy)
+ {
+ __float128 t = absx;
+ absx = absy;
+ absy = t;
+ }
+
+ if (absx > FLT128_MAX / 2.0)
+ {
+ scale = -1;
+ absx = scalbnq (absx, scale);
+ absy = (absy >= FLT128_MIN * 2.0Q ? scalbnq (absy, scale) : 0.0Q);
+ }
+ else if (absx < FLT128_MIN && absy < FLT128_MIN)
+ {
+ scale = FLT128_MANT_DIG;
+ absx = scalbnq (absx, scale);
+ absy = scalbnq (absy, scale);
+ }
+
+ if (absx == 1.0Q && scale == 0)
+ {
+ __float128 absy2 = absy * absy;
+ if (absy2 <= FLT128_MIN * 2.0Q)
+ __real__ result = absy2 / 2.0Q - absy2 * absy2 / 4.0Q;
+ else
+ __real__ result = log1pq (absy2) / 2.0Q;
+ }
+ else if (absx > 1.0Q && absx < 2.0Q && absy < 1.0Q && scale == 0)
+ {
+ __float128 d2m1 = (absx - 1.0Q) * (absx + 1.0Q);
+ if (absy >= FLT128_EPSILON)
+ d2m1 += absy * absy;
+ __real__ result = log1pq (d2m1) / 2.0Q;
+ }
+ else if (absx < 1.0Q
+ && absx >= 0.75Q
+ && absy < FLT128_EPSILON / 2.0Q
+ && scale == 0)
+ {
+ __float128 d2m1 = (absx - 1.0Q) * (absx + 1.0Q);
+ __real__ result = log1pq (d2m1) / 2.0Q;
+ }
+ else if (absx < 1.0 && (absx >= 0.75Q || absy >= 0.5Q) && scale == 0)
+ {
+ __float128 d2m1 = __quadmath_x2y2m1q (absx, absy);
+ __real__ result = log1pq (d2m1) / 2.0Q;
+ }
+ else
+ {
+ __float128 d = hypotq (absx, absy);
+ __real__ result = logq (d) - scale * M_LN2q;
+ }
+
+ __imag__ result = atan2q (__imag__ x, __real__ x);
+ }
+ else
+ {
+ __imag__ result = nanq ("");
+ if (rcls == QUADFP_INFINITE || icls == QUADFP_INFINITE)
+ /* Real or imaginary part is infinite. */
+ __real__ result = HUGE_VALQ;
+ else
+ __real__ result = nanq ("");
+ }
+
+ return result;
+}
diff --git a/libquadmath/math/complex.c b/libquadmath/math/complex.c
index f67448a2c1..8cf9e9808c 100644
--- a/libquadmath/math/complex.c
+++ b/libquadmath/math/complex.c
@@ -1,50 +1,35 @@
+/* GCC Quad-Precision Math Library
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+ Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+This file is part of the libquadmath library.
+Libquadmath is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libquadmath 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libquadmath; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
#include "quadmath-imp.h"
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
#define REALPART(z) (__real__(z))
#define IMAGPART(z) (__imag__(z))
#define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);}
-// Horrible... GCC doesn't know how to multiply or divide these
-// __complex128 things. We have to do it on our own.
-// Protect it around macros so, some day, we can switch it on
-
-#if 0
-
-# define C128_MULT(x,y) ((x)*(y))
-# define C128_DIV(x,y) ((x)/(y))
-
-#else
-
-#define C128_MULT(x,y) mult_c128(x,y)
-#define C128_DIV(x,y) div_c128(x,y)
-
-static inline __complex128 mult_c128 (__complex128 x, __complex128 y)
-{
- __float128 r1 = REALPART(x), i1 = IMAGPART(x);
- __float128 r2 = REALPART(y), i2 = IMAGPART(y);
- __complex128 res;
- COMPLEX_ASSIGN(res, r1*r2 - i1*i2, i2*r1 + i1*r2);
- return res;
-}
-
-
-// Careful: the algorithm for the division sucks. A lot.
-static inline __complex128 div_c128 (__complex128 x, __complex128 y)
-{
- __float128 n = hypotq (REALPART (y), IMAGPART (y));
- __float128 r1 = REALPART(x), i1 = IMAGPART(x);
- __float128 r2 = REALPART(y), i2 = IMAGPART(y);
- __complex128 res;
- COMPLEX_ASSIGN(res, r1*r2 + i1*i2, i1*r2 - i2*r1);
- return res / n;
-}
-
-#endif
-
-
-
__float128
cabsq (__complex128 z)
{
@@ -53,23 +38,12 @@ cabsq (__complex128 z)
__complex128
-cexpq (__complex128 z)
-{
- __float128 a, b;
- __complex128 v;
-
- a = REALPART (z);
- b = IMAGPART (z);
- COMPLEX_ASSIGN (v, cosq (b), sinq (b));
- return expq (a) * v;
-}
-
-
-__complex128
cexpiq (__float128 x)
{
+ __float128 sinix, cosix;
__complex128 v;
- COMPLEX_ASSIGN (v, cosq (x), sinq (x));
+ sincosq (x, &sinix, &cosix);
+ COMPLEX_ASSIGN (v, cosix, sinix);
return v;
}
@@ -82,129 +56,17 @@ cargq (__complex128 z)
__complex128
-clogq (__complex128 z)
-{
- __complex128 v;
- COMPLEX_ASSIGN (v, logq (cabsq (z)), cargq (z));
- return v;
-}
-
-
-__complex128
-clog10q (__complex128 z)
-{
- __complex128 v;
- COMPLEX_ASSIGN (v, log10q (cabsq (z)), cargq (z));
- return v;
-}
-
-
-__complex128
cpowq (__complex128 base, __complex128 power)
{
- return cexpq (C128_MULT(power, clogq (base)));
+ return cexpq (power * clogq (base));
}
__complex128
-csinq (__complex128 a)
+ccosq (__complex128 x)
{
- __float128 r = REALPART (a), i = IMAGPART (a);
- __complex128 v;
- COMPLEX_ASSIGN (v, sinq (r) * coshq (i), cosq (r) * sinhq (i));
- return v;
-}
-
-
-__complex128
-csinhq (__complex128 a)
-{
- __float128 r = REALPART (a), i = IMAGPART (a);
- __complex128 v;
- COMPLEX_ASSIGN (v, sinhq (r) * cosq (i), coshq (r) * sinq (i));
- return v;
-}
-
-
-__complex128
-ccosq (__complex128 a)
-{
- __float128 r = REALPART (a), i = IMAGPART (a);
- __complex128 v;
- COMPLEX_ASSIGN (v, cosq (r) * coshq (i), - (sinq (r) * sinhq (i)));
- return v;
-}
-
-
-__complex128
-ccoshq (__complex128 a)
-{
- __float128 r = REALPART (a), i = IMAGPART (a);
- __complex128 v;
- COMPLEX_ASSIGN (v, coshq (r) * cosq (i), sinhq (r) * sinq (i));
- return v;
-}
-
-
-__complex128
-ctanq (__complex128 a)
-{
- __float128 rt = tanq (REALPART (a)), it = tanhq (IMAGPART (a));
- __complex128 n, d;
- COMPLEX_ASSIGN (n, rt, it);
- COMPLEX_ASSIGN (d, 1, - (rt * it));
- return C128_DIV(n,d);
-}
-
-
-__complex128
-ctanhq (__complex128 a)
-{
- __float128 rt = tanhq (REALPART (a)), it = tanq (IMAGPART (a));
- __complex128 n, d;
- COMPLEX_ASSIGN (n, rt, it);
- COMPLEX_ASSIGN (d, 1, rt * it);
- return C128_DIV(n,d);
-}
-
-
-/* Square root algorithm from glibc. */
-__complex128
-csqrtq (__complex128 z)
-{
- __float128 re = REALPART(z), im = IMAGPART(z);
- __complex128 v;
+ __complex128 y;
- if (im == 0)
- {
- if (re < 0)
- {
- COMPLEX_ASSIGN (v, 0, copysignq (sqrtq (-re), im));
- }
- else
- {
- COMPLEX_ASSIGN (v, fabsq (sqrtq (re)), copysignq (0, im));
- }
- }
- else if (re == 0)
- {
- __float128 r = sqrtq (0.5 * fabsq (im));
- COMPLEX_ASSIGN (v, r, copysignq (r, im));
- }
- else
- {
- __float128 d = hypotq (re, im);
- __float128 r, s;
-
- /* Use the identity 2 Re res Im res = Im x
- to avoid cancellation error in d +/- Re x. */
- if (re > 0)
- r = sqrtq (0.5 * d + 0.5 * re), s = (0.5 * im) / r;
- else
- s = sqrtq (0.5 * d - 0.5 * re), r = fabsq ((0.5 * im) / s);
-
- COMPLEX_ASSIGN (v, r, copysignq (s, im));
- }
- return v;
+ COMPLEX_ASSIGN (y, -IMAGPART (x), REALPART (x));
+ return ccoshq (y);
}
-
diff --git a/libquadmath/math/copysignq.c b/libquadmath/math/copysignq.c
index b59fcc5492..054de2d2eb 100644
--- a/libquadmath/math/copysignq.c
+++ b/libquadmath/math/copysignq.c
@@ -1,4 +1,4 @@
-/* s_copysignl.c -- long double version of s_copysign.c.
+/* copysignq.c -- __float128 version of s_copysign.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/coshq.c b/libquadmath/math/coshq.c
index a6e0eb5f19..77f4b98338 100644
--- a/libquadmath/math/coshq.c
+++ b/libquadmath/math/coshq.c
@@ -30,25 +30,25 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __ieee754_coshl(x)
+/* coshq(x)
* Method :
- * mathematically coshl(x) if defined to be (exp(x)+exp(-x))/2
- * 1. Replace x by |x| (coshl(x) = coshl(-x)).
+ * mathematically coshq(x) if defined to be (exp(x)+exp(-x))/2
+ * 1. Replace x by |x| (coshq(x) = coshq(-x)).
* 2.
* [ exp(x) - 1 ]^2
- * 0 <= x <= ln2/2 : coshl(x) := 1 + -------------------
+ * 0 <= x <= ln2/2 : coshq(x) := 1 + -------------------
* 2*exp(x)
*
* exp(x) + 1/exp(x)
- * ln2/2 <= x <= 22 : coshl(x) := -------------------
+ * ln2/2 <= x <= 22 : coshq(x) := -------------------
* 2
- * 22 <= x <= lnovft : coshl(x) := expl(x)/2
- * lnovft <= x <= ln2ovft: coshl(x) := expl(x/2)/2 * expl(x/2)
- * ln2ovft < x : coshl(x) := huge*huge (overflow)
+ * 22 <= x <= lnovft : coshq(x) := expq(x)/2
+ * lnovft <= x <= ln2ovft: coshq(x) := expq(x/2)/2 * expq(x/2)
+ * ln2ovft < x : coshq(x) := huge*huge (overflow)
*
* Special cases:
- * coshl(x) is |x| if x is +INF, -INF, or NaN.
- * only coshl(0)=1 is exact for finite x.
+ * coshq(x) is |x| if x is +INF, -INF, or NaN.
+ * only coshq(0)=1 is exact for finite x.
*/
#include "quadmath-imp.h"
@@ -73,7 +73,7 @@ coshq (__float128 x)
if (ex >= 0x7fff0000)
return x * x;
- /* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expl(|x|)) */
+ /* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expq(|x|)) */
if (ex < 0x3ffd62e4) /* 0.3465728759765625 */
{
t = expm1q (u.value);
diff --git a/libquadmath/math/cosq.c b/libquadmath/math/cosq.c
index dc321a27d1..28630b93a6 100644
--- a/libquadmath/math/cosq.c
+++ b/libquadmath/math/cosq.c
@@ -1,4 +1,4 @@
-/* s_cosl.c -- long double version of s_cos.c.
+/* cosq.c -- __float128 version of s_cos.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,13 +13,13 @@
* ====================================================
*/
-/* cosl(x)
+/* cosq(x)
* Return cosine function of x.
*
* kernel function:
- * __kernel_sinl ... sine function on [-pi/4,pi/4]
- * __kernel_cosl ... cosine function on [-pi/4,pi/4]
- * __ieee754_rem_pio2l ... argument reduction routine
+ * __quadmath_kernel_sinq ... sine function on [-pi/4,pi/4]
+ * __quadmath_kernel_cosq ... cosine function on [-pi/4,pi/4]
+ * __quadmath_rem_pio2q ... argument reduction routine
*
* Method.
* Let S,C and T denote the sin, cos and tan respectively on
diff --git a/libquadmath/math/cosq_kernel.c b/libquadmath/math/cosq_kernel.c
index 86f39551c3..42d29adfd8 100644
--- a/libquadmath/math/cosq_kernel.c
+++ b/libquadmath/math/cosq_kernel.c
@@ -99,13 +99,17 @@ __quadmath_kernel_cosq (__float128 x, __float128 y)
{
/* So that we don't have to use too large polynomial, we find
l and h such that x = l + h, where fabsl(l) <= 1.0/256 with 83
- possible values for h. We look up cosl(h) and sinl(h) in
- pre-computed tables, compute cosl(l) and sinl(l) using a
+ possible values for h. We look up cosq(h) and sinq(h) in
+ pre-computed tables, compute cosq(l) and sinq(l) using a
Chebyshev polynomial of degree 10(11) and compute
- cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */
+ cosq(h+l) = cosq(h)cosq(l) - sinq(h)sinq(l). */
index = 0x3ffe - (tix >> 16);
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
- x = fabsq (x);
+ if (signbitq (x))
+ {
+ x = -x;
+ y = -y;
+ }
switch (index)
{
case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
diff --git a/libquadmath/math/csinhq.c b/libquadmath/math/csinhq.c
new file mode 100644
index 0000000000..c16d576f4d
--- /dev/null
+++ b/libquadmath/math/csinhq.c
@@ -0,0 +1,166 @@
+/* Complex sine hyperbole function for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+csinhq (__complex128 x)
+{
+ __complex128 retval;
+ int negate = signbitq (__real__ x);
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ __real__ x = fabsq (__real__ x);
+
+ if (__builtin_expect (rcls >= QUADFP_ZERO, 1))
+ {
+ /* Real part is finite. */
+ if (__builtin_expect (icls >= QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q);
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ if (fabsq (__real__ x) > t)
+ {
+ __float128 exp_t = expq (t);
+ __float128 rx = fabsq (__real__ x);
+ if (signbitq (__real__ x))
+ cosix = -cosix;
+ rx -= t;
+ sinix *= exp_t / 2.0Q;
+ cosix *= exp_t / 2.0Q;
+ if (rx > t)
+ {
+ rx -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (rx > t)
+ {
+ /* Overflow (original real part of x > 3t). */
+ __real__ retval = FLT128_MAX * cosix;
+ __imag__ retval = FLT128_MAX * sinix;
+ }
+ else
+ {
+ __float128 exp_val = expq (rx);
+ __real__ retval = exp_val * cosix;
+ __imag__ retval = exp_val * sinix;
+ }
+ }
+ else
+ {
+ __real__ retval = sinhq (__real__ x) * cosix;
+ __imag__ retval = coshq (__real__ x) * sinix;
+ }
+
+ if (negate)
+ __real__ retval = -__real__ retval;
+ }
+ else
+ {
+ if (rcls == QUADFP_ZERO)
+ {
+ /* Real part is 0.0. */
+ __real__ retval = copysignq (0.0Q, negate ? -1.0Q : 1.0Q);
+ __imag__ retval = nanq ("") + nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (icls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ else
+ {
+ __real__ retval = nanq ("");
+ __imag__ retval = nanq ("");
+
+#ifdef HAVE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ }
+ else if (rcls == QUADFP_INFINITE)
+ {
+ /* Real part is infinite. */
+ if (__builtin_expect (icls > QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0;
+ }
+
+ __real__ retval = copysignq (HUGE_VALQ, cosix);
+ __imag__ retval = copysignq (HUGE_VALQ, sinix);
+
+ if (negate)
+ __real__ retval = -__real__ retval;
+ }
+ else if (icls == QUADFP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = negate ? -HUGE_VALQ : HUGE_VALQ;
+ __imag__ retval = __imag__ x;
+ }
+ else
+ {
+ /* The addition raises the invalid exception. */
+ __real__ retval = HUGE_VALQ;
+ __imag__ retval = nanq ("") + nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (icls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else
+ {
+ __real__ retval = nanq ("");
+ __imag__ retval = __imag__ x == 0.0Q ? __imag__ x : nanq ("");
+ }
+
+ return retval;
+}
diff --git a/libquadmath/math/csinq.c b/libquadmath/math/csinq.c
new file mode 100644
index 0000000000..c837e50b87
--- /dev/null
+++ b/libquadmath/math/csinq.c
@@ -0,0 +1,171 @@
+/* Complex sine function for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+csinq (__complex128 x)
+{
+ __complex128 retval;
+ int negate = signbitq (__real__ x);
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ __real__ x = fabsq (__real__ x);
+
+ if (__builtin_expect (icls >= QUADFP_ZERO, 1))
+ {
+ /* Imaginary part is finite. */
+ if (__builtin_expect (rcls >= QUADFP_ZERO, 1))
+ {
+ /* Real part is finite. */
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q);
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (rcls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__real__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __real__ x;
+ cosix = 1.0Q;
+ }
+
+ if (fabsq (__imag__ x) > t)
+ {
+ __float128 exp_t = expq (t);
+ __float128 ix = fabsq (__imag__ x);
+ if (signbitq (__imag__ x))
+ cosix = -cosix;
+ ix -= t;
+ sinix *= exp_t / 2.0Q;
+ cosix *= exp_t / 2.0Q;
+ if (ix > t)
+ {
+ ix -= t;
+ sinix *= exp_t;
+ cosix *= exp_t;
+ }
+ if (ix > t)
+ {
+ /* Overflow (original imaginary part of x > 3t). */
+ __real__ retval = FLT128_MAX * sinix;
+ __imag__ retval = FLT128_MAX * cosix;
+ }
+ else
+ {
+ __float128 exp_val = expq (ix);
+ __real__ retval = exp_val * sinix;
+ __imag__ retval = exp_val * cosix;
+ }
+ }
+ else
+ {
+ __real__ retval = coshq (__imag__ x) * sinix;
+ __imag__ retval = sinhq (__imag__ x) * cosix;
+ }
+
+ if (negate)
+ __real__ retval = -__real__ retval;
+ }
+ else
+ {
+ if (icls == QUADFP_ZERO)
+ {
+ /* Imaginary part is 0.0. */
+ __real__ retval = nanq ("");
+ __imag__ retval = __imag__ x;
+
+#ifdef HAVE_FENV_H
+ if (rcls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ else
+ {
+ __real__ retval = nanq ("");
+ __imag__ retval = nanq ("");
+
+#ifdef HAVE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ }
+ else if (icls == QUADFP_INFINITE)
+ {
+ /* Imaginary part is infinite. */
+ if (rcls == QUADFP_ZERO)
+ {
+ /* Real part is 0.0. */
+ __real__ retval = copysignq (0.0Q, negate ? -1.0Q : 1.0Q);
+ __imag__ retval = __imag__ x;
+ }
+ else if (rcls > QUADFP_ZERO)
+ {
+ /* Real part is finite. */
+ __float128 sinix, cosix;
+
+ if (__builtin_expect (rcls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__real__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __real__ x;
+ cosix = 1.0;
+ }
+
+ __real__ retval = copysignq (HUGE_VALQ, sinix);
+ __imag__ retval = copysignq (HUGE_VALQ, cosix);
+
+ if (negate)
+ __real__ retval = -__real__ retval;
+ if (signbitq (__imag__ x))
+ __imag__ retval = -__imag__ retval;
+ }
+ else
+ {
+ /* The addition raises the invalid exception. */
+ __real__ retval = nanq ("");
+ __imag__ retval = HUGE_VALQ;
+
+#ifdef HAVE_FENV_H
+ if (rcls == QUADFP_INFINITE)
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else
+ {
+ if (rcls == QUADFP_ZERO)
+ __real__ retval = copysignq (0.0Q, negate ? -1.0Q : 1.0Q);
+ else
+ __real__ retval = nanq ("");
+ __imag__ retval = nanq ("");
+ }
+
+ return retval;
+}
diff --git a/libquadmath/math/csqrtq.c b/libquadmath/math/csqrtq.c
new file mode 100644
index 0000000000..5279e4378a
--- /dev/null
+++ b/libquadmath/math/csqrtq.c
@@ -0,0 +1,143 @@
+/* Complex square root of __float128 value.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+csqrtq (__complex128 x)
+{
+ __complex128 res;
+ int rcls = fpclassifyq (__real__ x);
+ int icls = fpclassifyq (__imag__ x);
+
+ if (__builtin_expect (rcls <= QUADFP_INFINITE || icls <= QUADFP_INFINITE, 0))
+ {
+ if (icls == QUADFP_INFINITE)
+ {
+ __real__ res = HUGE_VALQ;
+ __imag__ res = __imag__ x;
+ }
+ else if (rcls == QUADFP_INFINITE)
+ {
+ if (__real__ x < 0.0Q)
+ {
+ __real__ res = icls == QUADFP_NAN ? nanq ("") : 0;
+ __imag__ res = copysignq (HUGE_VALQ, __imag__ x);
+ }
+ else
+ {
+ __real__ res = __real__ x;
+ __imag__ res = (icls == QUADFP_NAN
+ ? nanq ("") : copysignq (0.0Q, __imag__ x));
+ }
+ }
+ else
+ {
+ __real__ res = nanq ("");
+ __imag__ res = nanq ("");
+ }
+ }
+ else
+ {
+ if (__builtin_expect (icls == QUADFP_ZERO, 0))
+ {
+ if (__real__ x < 0.0Q)
+ {
+ __real__ res = 0.0Q;
+ __imag__ res = copysignq (sqrtq (-__real__ x),
+ __imag__ x);
+ }
+ else
+ {
+ __real__ res = fabsq (sqrtq (__real__ x));
+ __imag__ res = copysignq (0.0Q, __imag__ x);
+ }
+ }
+ else if (__builtin_expect (rcls == QUADFP_ZERO, 0))
+ {
+ __float128 r;
+ if (fabsq (__imag__ x) >= 2.0Q * FLT128_MIN)
+ r = sqrtq (0.5Q * fabsq (__imag__ x));
+ else
+ r = 0.5Q * sqrtq (2.0Q * fabsq (__imag__ x));
+
+ __real__ res = r;
+ __imag__ res = copysignq (r, __imag__ x);
+ }
+ else
+ {
+ __float128 d, r, s;
+ int scale = 0;
+
+ if (fabsq (__real__ x) > FLT128_MAX / 4.0Q)
+ {
+ scale = 1;
+ __real__ x = scalbnq (__real__ x, -2 * scale);
+ __imag__ x = scalbnq (__imag__ x, -2 * scale);
+ }
+ else if (fabsq (__imag__ x) > FLT128_MAX / 4.0Q)
+ {
+ scale = 1;
+ if (fabsq (__real__ x) >= 4.0Q * FLT128_MIN)
+ __real__ x = scalbnq (__real__ x, -2 * scale);
+ else
+ __real__ x = 0.0Q;
+ __imag__ x = scalbnq (__imag__ x, -2 * scale);
+ }
+ else if (fabsq (__real__ x) < FLT128_MIN
+ && fabsq (__imag__ x) < FLT128_MIN)
+ {
+ scale = -(FLT128_MANT_DIG / 2);
+ __real__ x = scalbnq (__real__ x, -2 * scale);
+ __imag__ x = scalbnq (__imag__ x, -2 * scale);
+ }
+
+ d = hypotq (__real__ x, __imag__ x);
+ /* Use the identity 2 Re res Im res = Im x
+ to avoid cancellation error in d +/- Re x. */
+ if (__real__ x > 0)
+ {
+ r = sqrtq (0.5Q * (d + __real__ x));
+ s = 0.5Q * (__imag__ x / r);
+ }
+ else
+ {
+ s = sqrtq (0.5Q * (d - __real__ x));
+ r = fabsq (0.5Q * (__imag__ x / s));
+ }
+
+ if (scale)
+ {
+ r = scalbnq (r, scale);
+ s = scalbnq (s, scale);
+ }
+
+ __real__ res = r;
+ __imag__ res = copysignq (s, __imag__ x);
+ }
+ }
+
+ return res;
+}
diff --git a/libquadmath/math/ctanhq.c b/libquadmath/math/ctanhq.c
new file mode 100644
index 0000000000..8934cfad59
--- /dev/null
+++ b/libquadmath/math/ctanhq.c
@@ -0,0 +1,120 @@
+/* Complex hyperbole tangent for __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+ctanhq (__complex128 x)
+{
+ __complex128 res;
+
+ if (__builtin_expect (!finiteq (__real__ x) || !finiteq (__imag__ x), 0))
+ {
+ if (__quadmath_isinf_nsq (__real__ x))
+ {
+ __real__ res = copysignq (1.0Q, __real__ x);
+ __imag__ res = copysignq (0.0Q, __imag__ x);
+ }
+ else if (__imag__ x == 0.0Q)
+ {
+ res = x;
+ }
+ else
+ {
+ __real__ res = nanq ("");
+ __imag__ res = nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (__quadmath_isinf_nsq (__imag__ x))
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else
+ {
+ __float128 sinix, cosix;
+ __float128 den;
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q / 2);
+ int icls = fpclassifyq (__imag__ x);
+
+ /* tanh(x+iy) = (sinh(2x) + i*sin(2y))/(cosh(2x) + cos(2y))
+ = (sinh(x)*cosh(x) + i*sin(y)*cos(y))/(sinh(x)^2 + cos(y)^2). */
+
+ if (__builtin_expect (icls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__imag__ x, &sinix, &cosix);
+ }
+ else
+ {
+ sinix = __imag__ x;
+ cosix = 1.0Q;
+ }
+
+ if (fabsq (__real__ x) > t)
+ {
+ /* Avoid intermediate overflow when the imaginary part of
+ the result may be subnormal. Ignoring negligible terms,
+ the real part is +/- 1, the imaginary part is
+ sin(y)*cos(y)/sinh(x)^2 = 4*sin(y)*cos(y)/exp(2x). */
+ __float128 exp_2t = expq (2 * t);
+
+ __real__ res = copysignq (1.0, __real__ x);
+ __imag__ res = 4 * sinix * cosix;
+ __real__ x = fabsq (__real__ x);
+ __real__ x -= t;
+ __imag__ res /= exp_2t;
+ if (__real__ x > t)
+ {
+ /* Underflow (original real part of x has absolute value
+ > 2t). */
+ __imag__ res /= exp_2t;
+ }
+ else
+ __imag__ res /= expq (2 * __real__ x);
+ }
+ else
+ {
+ __float128 sinhrx, coshrx;
+ if (fabsq (__real__ x) > FLT128_MIN)
+ {
+ sinhrx = sinhq (__real__ x);
+ coshrx = coshq (__real__ x);
+ }
+ else
+ {
+ sinhrx = __real__ x;
+ coshrx = 1.0Q;
+ }
+
+ if (fabsq (sinhrx) > fabsq (cosix) * FLT128_EPSILON)
+ den = sinhrx * sinhrx + cosix * cosix;
+ else
+ den = cosix * cosix;
+ __real__ res = sinhrx * coshrx / den;
+ __imag__ res = sinix * cosix / den;
+ }
+ }
+
+ return res;
+}
diff --git a/libquadmath/math/ctanq.c b/libquadmath/math/ctanq.c
new file mode 100644
index 0000000000..d390511ca2
--- /dev/null
+++ b/libquadmath/math/ctanq.c
@@ -0,0 +1,120 @@
+/* Complex tangent function for complex __float128.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 "quadmath-imp.h"
+
+#ifdef HAVE_FENV_H
+# include <fenv.h>
+#endif
+
+
+__complex128
+ctanq (__complex128 x)
+{
+ __complex128 res;
+
+ if (__builtin_expect (!finiteq (__real__ x) || !finiteq (__imag__ x), 0))
+ {
+ if (__quadmath_isinf_nsq (__imag__ x))
+ {
+ __real__ res = copysignq (0.0Q, __real__ x);
+ __imag__ res = copysignq (1.0Q, __imag__ x);
+ }
+ else if (__real__ x == 0.0Q)
+ {
+ res = x;
+ }
+ else
+ {
+ __real__ res = nanq ("");
+ __imag__ res = nanq ("");
+
+#ifdef HAVE_FENV_H
+ if (__quadmath_isinf_nsq (__real__ x))
+ feraiseexcept (FE_INVALID);
+#endif
+ }
+ }
+ else
+ {
+ __float128 sinrx, cosrx;
+ __float128 den;
+ const int t = (int) ((FLT128_MAX_EXP - 1) * M_LN2q / 2.0Q);
+ int rcls = fpclassifyq (__real__ x);
+
+ /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
+ = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
+
+ if (__builtin_expect (rcls != QUADFP_SUBNORMAL, 1))
+ {
+ sincosq (__real__ x, &sinrx, &cosrx);
+ }
+ else
+ {
+ sinrx = __real__ x;
+ cosrx = 1.0Q;
+ }
+
+ if (fabsq (__imag__ x) > t)
+ {
+ /* Avoid intermediate overflow when the real part of the
+ result may be subnormal. Ignoring negligible terms, the
+ imaginary part is +/- 1, the real part is
+ sin(x)*cos(x)/sinh(y)^2 = 4*sin(x)*cos(x)/exp(2y). */
+ __float128 exp_2t = expq (2 * t);
+
+ __imag__ res = copysignq (1.0Q, __imag__ x);
+ __real__ res = 4 * sinrx * cosrx;
+ __imag__ x = fabsq (__imag__ x);
+ __imag__ x -= t;
+ __real__ res /= exp_2t;
+ if (__imag__ x > t)
+ {
+ /* Underflow (original imaginary part of x has absolute
+ value > 2t). */
+ __real__ res /= exp_2t;
+ }
+ else
+ __real__ res /= expq (2 * __imag__ x);
+ }
+ else
+ {
+ __float128 sinhix, coshix;
+ if (fabsq (__imag__ x) > FLT128_MIN)
+ {
+ sinhix = sinhq (__imag__ x);
+ coshix = coshq (__imag__ x);
+ }
+ else
+ {
+ sinhix = __imag__ x;
+ coshix = 1.0Q;
+ }
+
+ if (fabsq (sinhix) > fabsq (cosrx) * FLT128_EPSILON)
+ den = cosrx * cosrx + sinhix * sinhix;
+ else
+ den = cosrx * cosrx;
+ __real__ res = sinrx * cosrx / den;
+ __imag__ res = sinhix * coshix / den;
+ }
+ }
+
+ return res;
+}
diff --git a/libquadmath/math/erfq.c b/libquadmath/math/erfq.c
index 50db88ae82..8d383e9ca7 100644
--- a/libquadmath/math/erfq.c
+++ b/libquadmath/math/erfq.c
@@ -30,8 +30,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* double erf(double x)
- * double erfc(double x)
+/* __float128 erfq(__float128 x)
+ * __float128 erfcq(__float128 x)
* x
* 2 |\
* erf(x) = --------- | exp(-t*t)dt
diff --git a/libquadmath/math/expm1q.c b/libquadmath/math/expm1q.c
index 510c98fe49..8cfdd8eec9 100644
--- a/libquadmath/math/expm1q.c
+++ b/libquadmath/math/expm1q.c
@@ -53,6 +53,7 @@
+#include <errno.h>
#include "quadmath-imp.h"
/* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x)
@@ -100,6 +101,11 @@ expm1q (__float128 x)
ix = u.words32.w0;
sign = ix & 0x80000000;
ix &= 0x7fffffff;
+ if (!sign && ix >= 0x40060000)
+ {
+ /* If num is positive and exp >= 6 use plain exp. */
+ return expq (x);
+ }
if (ix >= 0x7fff0000)
{
/* Infinity. */
@@ -120,7 +126,10 @@ expm1q (__float128 x)
/* Overflow. */
if (x > maxlog)
- return (HUGE_VALQ * HUGE_VALQ);
+ {
+ errno = ERANGE;
+ return (HUGE_VALQ * HUGE_VALQ);
+ }
/* Minimum value. */
if (x < minarg)
diff --git a/libquadmath/math/expq.c b/libquadmath/math/expq.c
index 2740b4e2cc..70c638d7a0 100644
--- a/libquadmath/math/expq.c
+++ b/libquadmath/math/expq.c
@@ -30,19 +30,19 @@
#endif
-/* __expl_table basically consists of four tables, T_EXPL_ARG{1,2} and
+/* __expq_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
+ expl(__expq_table[T_EXPL_ARGN+2*i]+__expq_table[T_EXPL_ARGN+2*i+1]+r) ==
+ __expq_table[T_EXPL_RESN+i], __expq_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
+ __expq_table[T_EXPL_ARGN+2*i] == i/S+s
where absl(s) <= 2^-54 and absl(r) <= 2^-212. */
-static const __float128 __expl_table [] = {
+static const __float128 __expq_table [] = {
-3.47656250000000000584188889839535373E-01Q, /* bffd640000000000002b1b04213cf000 */
6.90417668990715641167244540876988960E-32Q, /* 3f97667c3fdb588a6ae1af8748357a17 */
-3.43749999999999981853132895957607418E-01Q, /* bffd5ffffffffffffac4ff5f4050b000 */
@@ -1122,8 +1122,8 @@ expq (__float128 x)
/* Compute tval1 = t. */
tval1 = (int) (t * TWO8);
- x -= __expl_table[T_EXPL_ARG1+2*tval1];
- xl -= __expl_table[T_EXPL_ARG1+2*tval1+1];
+ x -= __expq_table[T_EXPL_ARG1+2*tval1];
+ xl -= __expq_table[T_EXPL_ARG1+2*tval1+1];
/* Calculate t/32768. */
t = x + THREEp96;
@@ -1132,14 +1132,14 @@ expq (__float128 x)
/* Compute tval2 = t. */
tval2 = (int) (t * TWO15);
- x -= __expl_table[T_EXPL_ARG2+2*tval2];
- xl -= __expl_table[T_EXPL_ARG2+2*tval2+1];
+ x -= __expq_table[T_EXPL_ARG2+2*tval2];
+ xl -= __expq_table[T_EXPL_ARG2+2*tval2+1];
x = x + xl;
/* Compute ex2 = 2^n_0 e^(argtable[tval1]) e^(argtable[tval2]). */
- ex2_u.value = __expl_table[T_EXPL_RES1 + tval1]
- * __expl_table[T_EXPL_RES2 + tval2];
+ ex2_u.value = __expq_table[T_EXPL_RES1 + tval1]
+ * __expq_table[T_EXPL_RES2 + tval2];
n_i = (int)n;
/* 'unsafe' is 1 iff n_1 != 0. */
unsafe = abs(n_i) >= -FLT128_MIN_EXP - 1;
diff --git a/libquadmath/math/fabsq.c b/libquadmath/math/fabsq.c
index 7ec2850feb..a103f840f3 100644
--- a/libquadmath/math/fabsq.c
+++ b/libquadmath/math/fabsq.c
@@ -1,4 +1,4 @@
-/* s_fabsl.c -- __float128 version of s_fabs.c.
+/* fabsq.c -- __float128 version of s_fabs.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/finiteq.c b/libquadmath/math/finiteq.c
index f22e9d7f20..c5326d2194 100644
--- a/libquadmath/math/finiteq.c
+++ b/libquadmath/math/finiteq.c
@@ -1,4 +1,4 @@
-/* s_finitel.c -- long double version of s_finite.c.
+/* finiteq.c -- __float128 version of s_finite.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -15,6 +15,11 @@
#include "quadmath-imp.h"
+/*
+ * finiteq(x) returns 1 is x is finite, else 0;
+ * no branching!
+ */
+
int
finiteq (const __float128 x)
{
diff --git a/libquadmath/math/floorq.c b/libquadmath/math/floorq.c
index 781cf40e3c..0d74f94e27 100644
--- a/libquadmath/math/floorq.c
+++ b/libquadmath/math/floorq.c
@@ -1,4 +1,4 @@
-/* s_floorl.c -- long double version of s_floor.c.
+/* floorq.c -- __float128 version of s_floor.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/fmaq.c b/libquadmath/math/fmaq.c
index 126b0a2d26..d3c5fb3901 100644
--- a/libquadmath/math/fmaq.c
+++ b/libquadmath/math/fmaq.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -14,9 +14,8 @@
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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include "quadmath-imp.h"
#include <math.h>
@@ -57,17 +56,52 @@ fmaq (__float128 x, __float128 y, __float128 z)
&& u.ieee.exponent != 0x7fff
&& v.ieee.exponent != 0x7fff)
return (z + x) + y;
- /* If x or y or z is Inf/NaN, or if fma will certainly overflow,
- or if x * y is less than half of FLT128_DENORM_MIN,
- compute as x * y + 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;
+ /* If x or y or z is Inf/NaN, or if x * y is zero, compute as
+ x * y + z. */
if (u.ieee.exponent == 0x7fff
|| v.ieee.exponent == 0x7fff
|| w.ieee.exponent == 0x7fff
- || u.ieee.exponent + v.ieee.exponent
- > 0x7fff + IEEE854_FLOAT128_BIAS
- || u.ieee.exponent + v.ieee.exponent
- < IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG - 2)
+ || x == 0
+ || y == 0)
return x * y + z;
+ /* If fma will certainly overflow, compute as x * y. */
+ if (u.ieee.exponent + v.ieee.exponent
+ > 0x7fff + IEEE854_FLOAT128_BIAS)
+ return x * y;
+ /* If x * y is less than 1/4 of FLT128_DENORM_MIN, neither the
+ result nor whether there is underflow depends on its exact
+ value, only on its sign. */
+ if (u.ieee.exponent + v.ieee.exponent
+ < IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG - 2)
+ {
+ int neg = u.ieee.negative ^ v.ieee.negative;
+ __float128 tiny = neg ? -0x1p-16494Q : 0x1p-16494Q;
+ if (w.ieee.exponent >= 3)
+ return tiny + z;
+ /* Scaling up, adding TINY and scaling down produces the
+ correct result, because in round-to-nearest mode adding
+ TINY has no effect and in other modes double rounding is
+ harmless. But it may not produce required underflow
+ exceptions. */
+ v.value = z * 0x1p114Q + tiny;
+ if (TININESS_AFTER_ROUNDING
+ ? v.ieee.exponent < 115
+ : (w.ieee.exponent == 0
+ || (w.ieee.exponent == 1
+ && w.ieee.negative != neg
+ && w.ieee.mant_low == 0
+ && w.ieee.mant_high == 0)))
+ {
+ volatile __float128 force_underflow = x * y;
+ (void) force_underflow;
+ }
+ return v.value * 0x1p-114Q;
+ }
if (u.ieee.exponent + v.ieee.exponent
>= 0x7fff + IEEE854_FLOAT128_BIAS - FLT128_MANT_DIG)
{
@@ -87,8 +121,17 @@ fmaq (__float128 x, __float128 y, __float128 z)
{
/* Similarly.
If z exponent is very large and x and y exponents are
- very small, it doesn't matter if we don't adjust it. */
- if (u.ieee.exponent > v.ieee.exponent)
+ very small, adjust them up to avoid spurious underflows,
+ rather than down. */
+ if (u.ieee.exponent + v.ieee.exponent
+ <= IEEE854_FLOAT128_BIAS + FLT128_MANT_DIG)
+ {
+ if (u.ieee.exponent > v.ieee.exponent)
+ u.ieee.exponent += 2 * FLT128_MANT_DIG + 2;
+ else
+ v.ieee.exponent += 2 * FLT128_MANT_DIG + 2;
+ }
+ else if (u.ieee.exponent > v.ieee.exponent)
{
if (u.ieee.exponent > FLT128_MANT_DIG)
u.ieee.exponent -= FLT128_MANT_DIG;
@@ -136,6 +179,17 @@ fmaq (__float128 x, __float128 y, __float128 z)
y = v.value;
z = w.value;
}
+
+ /* Ensure correct sign of exact 0 + 0. */
+ if (__builtin_expect ((x == 0 || y == 0) && z == 0, 0))
+ return x * y + z;
+
+#ifdef USE_FENV_H
+ fenv_t env;
+ feholdexcept (&env);
+ fesetround (FE_TONEAREST);
+#endif
+
/* Multiplication m1 + m2 = x * y using Dekker's algorithm. */
#define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
__float128 x1 = x * C;
@@ -154,10 +208,25 @@ fmaq (__float128 x, __float128 y, __float128 z)
t1 = m1 - t1;
t2 = z - t2;
__float128 a2 = t1 + t2;
+#ifdef USE_FENV_H
+ feclearexcept (FE_INEXACT);
+#endif
+
+ /* If the result is an exact zero, ensure it has the correct
+ sign. */
+ if (a1 == 0 && m2 == 0)
+ {
+#ifdef USE_FENV_H
+ feupdateenv (&env);
+#endif
+ /* Ensure that round-to-nearest value of z + m1 is not
+ reused. */
+ asm volatile ("" : "=m" (z) : "m" (z));
+ return z + m1;
+ }
+
#ifdef USE_FENV_H
- fenv_t env;
- feholdexcept (&env);
fesetround (FE_TOWARDZERO);
#endif
/* Perform m2 + a2 addition with round to odd. */
@@ -191,7 +260,7 @@ fmaq (__float128 x, __float128 y, __float128 z)
#endif
v.value = a1 + u.value;
/* Ensure the addition is not scheduled after fetestexcept call. */
- asm volatile ("" : : "m" (v));
+ asm volatile ("" : : "m" (v.value));
#ifdef USE_FENV_H
int j = fetestexcept (FE_INEXACT) != 0;
feupdateenv (&env);
@@ -218,22 +287,27 @@ fmaq (__float128 x, __float128 y, __float128 z)
for proper rounding. */
if (v.ieee.exponent == 226)
{
- /* v.ieee.mant_low & 2 is LSB bit of the result before rounding,
- v.ieee.mant_low & 1 is the round bit and j is our sticky
- bit. In round-to-nearest 001 rounds down like 00,
- 011 rounds up, even though 01 rounds down (thus we need
- to adjust), 101 rounds down like 10 and 111 rounds up
- like 11. */
- if ((v.ieee.mant_low & 3) == 1)
+ /* If the exponent would be in the normal range when
+ rounding to normal precision with unbounded exponent
+ range, the exact result is known and spurious underflows
+ must be avoided on systems detecting tininess after
+ rounding. */
+ if (TININESS_AFTER_ROUNDING)
{
- v.value *= 0x1p-226Q;
- if (v.ieee.negative)
- return v.value - 0x1p-16494Q /* __FLT128_DENORM_MIN__ */;
- else
- return v.value + 0x1p-16494Q /* __FLT128_DENORM_MIN__ */;
+ w.value = a1 + u.value;
+ if (w.ieee.exponent == 227)
+ return w.value * 0x1p-226Q;
}
- else
- return v.value * 0x1p-226Q;
+ /* v.ieee.mant_low & 2 is LSB bit of the result before rounding,
+ v.ieee.mant_low & 1 is the round bit and j is our sticky
+ bit. */
+ w.value = 0.0Q;
+ w.ieee.mant_low = ((v.ieee.mant_low & 3) << 1) | j;
+ w.ieee.negative = v.ieee.negative;
+ v.ieee.mant_low &= ~3U;
+ v.value *= 0x1p-226Q;
+ w.value *= 0x1p-2Q;
+ return v.value + w.value;
}
v.ieee.mant_low |= j;
return v.value * 0x1p-226Q;
diff --git a/libquadmath/math/fmodq.c b/libquadmath/math/fmodq.c
index 036e3dd531..55eb18ffb0 100644
--- a/libquadmath/math/fmodq.c
+++ b/libquadmath/math/fmodq.c
@@ -1,4 +1,4 @@
-/* e_fmodl.c -- long double version of e_fmod.c.
+/* fmodq.c -- __float128 version of e_fmod.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
/*
diff --git a/libquadmath/math/frexpq.c b/libquadmath/math/frexpq.c
index fa3d7836d0..b0b305af57 100644
--- a/libquadmath/math/frexpq.c
+++ b/libquadmath/math/frexpq.c
@@ -1,4 +1,4 @@
-/* s_frexpl.c -- long double version of s_frexp.c.
+/* frexpq.c -- __float128 version of s_frexp.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/ilogbq.c b/libquadmath/math/ilogbq.c
index 47986f5b31..7f95e9c224 100644
--- a/libquadmath/math/ilogbq.c
+++ b/libquadmath/math/ilogbq.c
@@ -1,4 +1,4 @@
-/* s_ilogbl.c -- long double version of s_ilogb.c.
+/* ilogbq.c -- __float128 version of s_ilogb.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -17,7 +17,7 @@
static char rcsid[] = "$NetBSD: $";
#endif
-/* ilogbl(long double x)
+/* ilogbl(__float128 x)
* return the binary exponent of non-zero x
* ilogbl(0) = FP_ILOGB0
* ilogbl(NaN) = FP_ILOGBNAN (no signal is raised)
@@ -26,6 +26,7 @@ static char rcsid[] = "$NetBSD: $";
#include <limits.h>
#include <math.h>
+#include <errno.h>
#include "quadmath-imp.h"
#ifndef FP_ILOGB0
@@ -45,7 +46,13 @@ ilogbq (__float128 x)
hx &= 0x7fffffffffffffffLL;
if(hx <= 0x0001000000000000LL) {
if((hx|lx)==0)
+ {
+ errno = EDOM;
+#ifdef USE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */
+ }
else /* subnormal x */
if(hx==0) {
for (ix = -16431; lx>0; lx<<=1) ix -=1;
@@ -58,7 +65,18 @@ ilogbq (__float128 x)
else if (FP_ILOGBNAN != INT_MAX) {
/* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */
if (((hx^0x7fff000000000000LL)|lx) == 0)
+ {
+ errno = EDOM;
+#ifdef USE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
return INT_MAX;
+ }
}
+
+ errno = EDOM;
+#ifdef USE_FENV_H
+ feraiseexcept (FE_INVALID);
+#endif
return FP_ILOGBNAN;
}
diff --git a/libquadmath/math/isinf_nsq.c b/libquadmath/math/isinf_nsq.c
new file mode 100644
index 0000000000..2f0834361c
--- /dev/null
+++ b/libquadmath/math/isinf_nsq.c
@@ -0,0 +1,19 @@
+/*
+ * Written by Ulrich Drepper <drepper@gmail.com>
+ */
+
+/*
+ * __quadmath_isinf_nsq (x) returns != 0 if x is ±inf, else 0;
+ * no branching!
+ */
+
+#include "quadmath-imp.h"
+
+int
+__quadmath_isinf_nsq (__float128 x)
+{
+ int64_t hx,lx;
+ GET_FLT128_WORDS64(hx,lx,x);
+ return !(lx | ((hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL));
+}
+
diff --git a/libquadmath/math/isnanq.c b/libquadmath/math/isnanq.c
index ab9df1658c..4462d0139e 100644
--- a/libquadmath/math/isnanq.c
+++ b/libquadmath/math/isnanq.c
@@ -1,4 +1,4 @@
-/* s_isnanl.c -- long double version of s_isnan.c.
+/* isnanq.c -- __float128 version of s_isnan.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/j0q.c b/libquadmath/math/j0q.c
index fecbe62774..8c6f811125 100644
--- a/libquadmath/math/j0q.c
+++ b/libquadmath/math/j0q.c
@@ -6,7 +6,7 @@
*
* SYNOPSIS:
*
- * long double x, y, j0l();
+ * __float128 x, y, j0l();
*
* y = j0l( x );
*
@@ -52,7 +52,7 @@
*
* SYNOPSIS:
*
- * double x, y, y0l();
+ * __float128 x, y, y0l();
*
* y = y0l( x );
*
@@ -807,6 +807,7 @@ static __float128 Y0_2D[NY0_2D + 1] = {
/* 1.000000000000000000000000000000000000000E0 */
};
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02Q;
/* Bessel function of the second kind, order zero. */
@@ -829,6 +830,8 @@ y0q (__float128 x)
return -HUGE_VALQ + x;
}
xx = fabsq (x);
+ if (xx <= 0x1p-57)
+ return U0 + TWOOPI * logq (x);
if (xx <= 2.0Q)
{
/* 0 <= x <= 2 */
diff --git a/libquadmath/math/j1q.c b/libquadmath/math/j1q.c
index f6bf2a256c..eb599c949a 100644
--- a/libquadmath/math/j1q.c
+++ b/libquadmath/math/j1q.c
@@ -6,9 +6,9 @@
*
* SYNOPSIS:
*
- * long double x, y, j1l();
+ * __float128 x, y, j1q();
*
- * y = j1l( x );
+ * y = j1q( x );
*
*
*
@@ -52,9 +52,9 @@
*
* SYNOPSIS:
*
- * double x, y, y1l();
+ * __float128, y, y1q();
*
- * y = y1l( x );
+ * y = y1q( x );
*
*
*
@@ -836,8 +836,10 @@ y1q (__float128 x)
return -HUGE_VALQ + x;
}
xx = fabsq (x);
+ if (xx <= 0x1p-114)
+ return -TWOOPI / x;
if (xx <= 2.0Q)
- {
+ {
/* 0 <= x <= 2 */
z = xx * xx;
p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
diff --git a/libquadmath/math/jnq.c b/libquadmath/math/jnq.c
index d82947a3cc..56a183604c 100644
--- a/libquadmath/math/jnq.c
+++ b/libquadmath/math/jnq.c
@@ -11,9 +11,9 @@
/* Modifications for 128-bit long double are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
@@ -56,6 +56,7 @@
*
*/
+#include <errno.h>
#include "quadmath-imp.h"
static const __float128
@@ -273,7 +274,16 @@ jnq (int n, __float128 x)
}
}
}
- b = (t * j0q (x) / b);
+ /* j0() and j1() suffer enormous loss of precision at and
+ * near zero; however, we know that their zero points never
+ * coincide, so just choose the one further away from zero.
+ */
+ z = j0q (x);
+ w = j1q (x);
+ if (fabsq (z) >= fabsq (w))
+ b = (t * z / b);
+ else
+ b = (t * w / a);
}
}
if (sgn == 1)
@@ -374,6 +384,9 @@ ynq (int n, __float128 x)
a = temp;
}
}
+ /* If B is +-Inf, set up errno accordingly. */
+ if (! finiteq (b))
+ errno = ERANGE;
if (sign > 0)
return b;
else
diff --git a/libquadmath/math/ldexpq.c b/libquadmath/math/ldexpq.c
index 394d4590cc..c18968b03b 100644
--- a/libquadmath/math/ldexpq.c
+++ b/libquadmath/math/ldexpq.c
@@ -1,4 +1,4 @@
-/* s_ldexpl.c -- long double version of s_ldexp.c.
+/* ldexpq.c -- __float128 version of s_ldexp.c.
* Conversion to long double by Ulrich Drepper,
* Cygnus Support, drepper@cygnus.com.
*/
diff --git a/libquadmath/math/lgammaq.c b/libquadmath/math/lgammaq.c
index 6e7697ac6a..eef62dbc91 100644
--- a/libquadmath/math/lgammaq.c
+++ b/libquadmath/math/lgammaq.c
@@ -18,7 +18,7 @@
* Returns the base e (2.718...) logarithm of the absolute
* value of the gamma function of the argument.
* The sign (+1 or -1) of the gamma function is returned in a
- * global (extern) variable named sgngam.
+ * global (extern) variable named signgam.
*
* The positive domain is partitioned into numerous segments for approximation.
* For x > 10,
@@ -70,6 +70,10 @@
#include "quadmath-imp.h"
+#ifdef HAVE_MATH_H_SIGNGAM
+#include <math.h> /* For POSIX's extern int signgam. */
+#endif
+
static const __float128 PIQ = 3.1415926535897932384626433832795028841972E0Q;
static const __float128 MAXLGM = 1.0485738685148938358098967157129705071571E4928Q;
static const __float128 one = 1.0Q;
@@ -757,9 +761,12 @@ __float128
lgammaq (__float128 x)
{
__float128 p, q, w, z, nx;
- int i, nn, sign;
+ int i, nn;
+#ifndef HAVE_MATH_H_SIGNGAM
+ int signgam;
+#endif
- sign = 1;
+ signgam = 1;
if (! finiteq (x))
return x * x;
@@ -767,7 +774,7 @@ lgammaq (__float128 x)
if (x == 0.0Q)
{
if (signbitq (x))
- sign = -1;
+ signgam = -1;
}
if (x < 0.0Q)
@@ -778,9 +785,9 @@ lgammaq (__float128 x)
return (one / (p - p));
i = p;
if ((i & 1) == 0)
- sign = -1;
+ signgam = -1;
else
- sign = 1;
+ signgam = 1;
z = q - p;
if (z > 0.5Q)
{
@@ -789,7 +796,7 @@ lgammaq (__float128 x)
}
z = q * sinq (PIQ * z);
if (z == 0.0Q)
- return (sign * huge * huge);
+ return (signgam * huge * huge);
w = lgammaq (q);
z = logq (PIQ / z) - w;
return (z);
@@ -855,7 +862,7 @@ lgammaq (__float128 x)
{
z = x - 0.75Q;
p = z * neval (z, RN1r75, NRN1r75)
- / deval (z, RD1r75, NRD1r75);
+ / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
@@ -1021,7 +1028,7 @@ lgammaq (__float128 x)
}
if (x > MAXLGM)
- return (sign * huge * huge);
+ return (signgam * huge * huge);
q = ls2pi - x;
q = (x - 0.5Q) * logq (x) + q;
diff --git a/libquadmath/math/llroundq.c b/libquadmath/math/llroundq.c
index c108e7ad18..d22180d6bb 100644
--- a/libquadmath/math/llroundq.c
+++ b/libquadmath/math/llroundq.c
@@ -1,4 +1,4 @@
-/* Round long double value to long long int.
+/* Round __float128 value to long long int.
Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
diff --git a/libquadmath/math/log10q.c b/libquadmath/math/log10q.c
index 50caf18b7f..9eeb9ae3fc 100644
--- a/libquadmath/math/log10q.c
+++ b/libquadmath/math/log10q.c
@@ -1,14 +1,14 @@
-/* log10l.c
+/* log10q.c
*
- * Common logarithm, 128-bit long double precision
+ * Common logarithm, 128-bit __float128 precision
*
*
*
* SYNOPSIS:
*
- * long double x, y, log10l();
+ * __float128 x, y, log10l();
*
- * y = log10l( x );
+ * y = log10q( x );
*
*
*
diff --git a/libquadmath/math/log1pq.c b/libquadmath/math/log1pq.c
index a466dc8921..d8bff405df 100644
--- a/libquadmath/math/log1pq.c
+++ b/libquadmath/math/log1pq.c
@@ -1,15 +1,15 @@
/* log1pl.c
*
* Relative error logarithm
- * Natural logarithm of 1+x, 128-bit long double precision
+ * Natural logarithm of 1+x for __float128 precision
*
*
*
* SYNOPSIS:
*
- * long double x, y, log1pl();
+ * __float128 x, y, log1pl();
*
- * y = log1pl( x );
+ * y = log1pq( x );
*
*
*
@@ -136,6 +136,12 @@ log1pq (__float128 xm1)
&& (u.words32.w1 | u.words32.w2 | u.words32.w3) == 0)
return xm1;
+ if ((hx & 0x7fffffff) < 0x3f8e0000)
+ {
+ if ((int) xm1 == 0)
+ return xm1;
+ }
+
x = xm1 + 1.0Q;
/* log1p(-1) = -inf */
diff --git a/libquadmath/math/log2q.c b/libquadmath/math/log2q.c
index 963b38c848..f8275369b3 100644
--- a/libquadmath/math/log2q.c
+++ b/libquadmath/math/log2q.c
@@ -1,13 +1,13 @@
-/* log2l.c
- * Base 2 logarithm, 128-bit long double precision
+/* log2q.c
+ * Base 2 logarithm for __float128 precision
*
*
*
* SYNOPSIS:
*
- * long double x, y, log2l();
+ * __float128 x, y, log2q();
*
- * y = log2l( x );
+ * y = log2q( x );
*
*
*
diff --git a/libquadmath/math/logq.c b/libquadmath/math/logq.c
index cd1a48631f..7aae9b101a 100644
--- a/libquadmath/math/logq.c
+++ b/libquadmath/math/logq.c
@@ -1,14 +1,14 @@
-/* logll.c
+/* logq.c
*
- * Natural logarithm for 128-bit long double precision.
+ * Natural logarithm for __float128 precision.
*
*
*
* SYNOPSIS:
*
- * long double x, y, logl();
+ * __float128 x, y, logq();
*
- * y = logl( x );
+ * y = logq( x );
*
*
*
diff --git a/libquadmath/math/lroundq.c b/libquadmath/math/lroundq.c
index 4b12d24526..59c883a146 100644
--- a/libquadmath/math/lroundq.c
+++ b/libquadmath/math/lroundq.c
@@ -1,4 +1,4 @@
-/* Round long double value to long int.
+/* Round __float128 value to long int.
Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
diff --git a/libquadmath/math/modfq.c b/libquadmath/math/modfq.c
index dc564fe355..8c5db54bb7 100644
--- a/libquadmath/math/modfq.c
+++ b/libquadmath/math/modfq.c
@@ -1,4 +1,4 @@
-/* s_modfl.c -- long double version of s_modf.c.
+/* modfq.c -- __float128 version of s_modf.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/nearbyintq.c b/libquadmath/math/nearbyintq.c
index 8e92c5afd4..207124808e 100644
--- a/libquadmath/math/nearbyintq.c
+++ b/libquadmath/math/nearbyintq.c
@@ -44,18 +44,13 @@ nearbyintq(__float128 x)
fenv_t env;
#endif
int64_t i0,j0,sx;
- uint64_t i,i1;
+ uint64_t i1;
__float128 w,t;
GET_FLT128_WORDS64(i0,i1,x);
sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
- if(j0<48) {
+ if(j0<112) {
if(j0<0) {
- if(((i0&0x7fffffffffffffffLL)|i1)==0) return x;
- i1 |= (i0&0x0000ffffffffffffLL);
- i0 &= 0xffffe00000000000ULL;
- i0 |= ((i1|-i1)>>16)&0x0000800000000000LL;
- SET_FLT128_MSW64(x,i0);
#ifdef USE_FENV_H
feholdexcept (&env);
#endif
@@ -67,25 +62,11 @@ nearbyintq(__float128 x)
GET_FLT128_MSW64(i0,t);
SET_FLT128_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63));
return t;
- } else {
- i = (0x0000ffffffffffffLL)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- i>>=1;
- if(((i0&i)|i1)!=0) {
- if(j0==47) i1 = 0x4000000000000000ULL; else
- i0 = (i0&(~i))|((0x0000200000000000LL)>>j0);
- }
}
- } else if (j0>111) {
+ } else {
if(j0==0x4000) return x+x; /* inf or NaN */
else return x; /* x is integral */
- } else {
- i = -1ULL>>(j0-48);
- if((i1&i)==0) return x; /* x is integral */
- i>>=1;
- if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48));
}
- SET_FLT128_WORDS64(x,i0,i1);
#ifdef USE_FENV_H
feholdexcept (&env);
#endif
diff --git a/libquadmath/math/nextafterq.c b/libquadmath/math/nextafterq.c
index 01bfa65790..04d63deb8e 100644
--- a/libquadmath/math/nextafterq.c
+++ b/libquadmath/math/nextafterq.c
@@ -1,4 +1,4 @@
-/* s_nextafterl.c -- long double version of s_nextafter.c.
+/* nextafterq.c -- __float128 version of s_nextafter.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
diff --git a/libquadmath/math/powq.c b/libquadmath/math/powq.c
index d386324382..dd44b7c175 100644
--- a/libquadmath/math/powq.c
+++ b/libquadmath/math/powq.c
@@ -30,7 +30,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __ieee754_powl(x,y) return x**y
+/* powq(x,y) return x**y
*
* n
* Method: Let x = 2 * (1+f)
@@ -148,7 +148,7 @@ powq (__float128 x, __float128 y)
{
__float128 z, ax, z_h, z_l, p_h, p_l;
__float128 y1, t1, t2, r, s, t, u, v, w;
- __float128 s2, s_h, s_l, t_h, t_l;
+ __float128 s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
uint32_t ix, iy;
int32_t hx, hy;
@@ -281,6 +281,10 @@ powq (__float128 x, __float128 y)
return (hy > 0) ? huge * huge : tiny * tiny;
}
+ ay = y > 0 ? y : -y;
+ if (ay < 0x1p-128)
+ y = y < 0 ? -0x1p-128 : 0x1p-128;
+
n = 0;
/* take care subnormal number */
if (ix < 0x00010000)
diff --git a/libquadmath/math/rem_pio2q.c b/libquadmath/math/rem_pio2q.c
index 47ee8ef205..60653c8d1d 100644
--- a/libquadmath/math/rem_pio2q.c
+++ b/libquadmath/math/rem_pio2q.c
@@ -15,10 +15,10 @@
*/
/*
- * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
+ * __quadmath_kernel_rem_pio2 (x,y,e0,nx,prec,ipio2)
* double x[],y[]; int e0,nx,prec; int ipio2[];
*
- * __kernel_rem_pio2 return the last three digits of N with
+ * __quadmath_kernel_rem_pio2 return the last three digits of N with
* y = x - N*pi/2
* so that |y| < pi/2.
*
diff --git a/libquadmath/math/remainderq.c b/libquadmath/math/remainderq.c
index 421f728ffe..c3f5641293 100644
--- a/libquadmath/math/remainderq.c
+++ b/libquadmath/math/remainderq.c
@@ -1,4 +1,4 @@
-/* e_fmodl.c -- long double version of e_fmod.c.
+/* fmodq.c -- __float128 version of e_fmod.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
/*
diff --git a/libquadmath/math/rintq.c b/libquadmath/math/rintq.c
index fe7a59188b..15d4c781ba 100644
--- a/libquadmath/math/rintq.c
+++ b/libquadmath/math/rintq.c
@@ -1,4 +1,4 @@
-/* s_rintl.c -- long double version of s_rint.c.
+/* rintq.c -- __float128 version of s_rint.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,54 +13,45 @@
* ====================================================
*/
+/*
+ * rintq(x)
+ * Return x rounded to integral value according to the prevailing
+ * rounding mode.
+ * Method:
+ * Using floating addition.
+ * Exception:
+ * Inexact flag raised if x not equal to rintq(x).
+ */
+
#include "quadmath-imp.h"
static const __float128
TWO112[2]={
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ 5.19229685853482762853049632922009600E+33Q, /* 0x406F000000000000, 0 */
+ -5.19229685853482762853049632922009600E+33Q /* 0xC06F000000000000, 0 */
};
__float128
rintq (__float128 x)
{
int64_t i0,j0,sx;
- uint64_t i,i1;
+ uint64_t i1;
__float128 w,t;
GET_FLT128_WORDS64(i0,i1,x);
sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
- if(j0<48) {
+ if(j0<112) {
if(j0<0) {
- if(((i0&0x7fffffffffffffffLL)|i1)==0) return x;
- i1 |= (i0&0x0000ffffffffffffLL);
- i0 &= 0xffffe00000000000ULL;
- i0 |= ((i1|-i1)>>16)&0x0000800000000000LL;
- SET_FLT128_MSW64(x,i0);
w = TWO112[sx]+x;
t = w-TWO112[sx];
GET_FLT128_MSW64(i0,t);
SET_FLT128_MSW64(t,(i0&0x7fffffffffffffffLL)|(sx<<63));
return t;
- } else {
- i = (0x0000ffffffffffffLL)>>j0;
- if(((i0&i)|i1)==0) return x; /* x is integral */
- i>>=1;
- if(((i0&i)|i1)!=0) {
- if(j0==47) i1 = 0x4000000000000000ULL; else
- i0 = (i0&(~i))|((0x0000200000000000LL)>>j0);
- }
}
- } else if (j0>111) {
+ } else {
if(j0==0x4000) return x+x; /* inf or NaN */
else return x; /* x is integral */
- } else {
- i = -1ULL>>(j0-48);
- if((i1&i)==0) return x; /* x is integral */
- i>>=1;
- if((i1&i)!=0) i1 = (i1&(~i))|((0x4000000000000000LL)>>(j0-48));
}
- SET_FLT128_WORDS64(x,i0,i1);
w = TWO112[sx]+x;
return w-TWO112[sx];
}
diff --git a/libquadmath/math/roundq.c b/libquadmath/math/roundq.c
index d7f577bd94..7c9d640e93 100644
--- a/libquadmath/math/roundq.c
+++ b/libquadmath/math/roundq.c
@@ -1,4 +1,4 @@
-/* Round long double to integer away from zero.
+/* Round __float128 to integer away from zero.
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
diff --git a/libquadmath/math/scalblnq.c b/libquadmath/math/scalblnq.c
index 75997f688c..a414045b51 100644
--- a/libquadmath/math/scalblnq.c
+++ b/libquadmath/math/scalblnq.c
@@ -1,4 +1,4 @@
-/* s_scalblnl.c -- long double version of s_scalbn.c.
+/* scalblnq.c -- __float128 version of s_scalbn.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,6 +13,13 @@
* ====================================================
*/
+/*
+ * scalblnq (_float128 x, long int n)
+ * scalblnq(x,n) returns x* 2**n computed by exponent
+ * manipulation rather than by actually performing an
+ * exponentiation or a multiplication.
+ */
+
#include "quadmath-imp.h"
static const __float128
@@ -34,10 +41,12 @@ scalblnq (__float128 x, long int n)
k = ((hx>>48)&0x7fff) - 114;
}
if (k==0x7fff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7ffe)
- return huge*copysignq(huge,x); /* overflow */
if (n< -50000) return tiny*copysignq(tiny,x); /*underflow*/
+ if (n> 50000 || k+n > 0x7ffe)
+ return huge*copysignq(huge,x); /* overflow */
+ /* Now k and n are bounded we know that k = k+n does not
+ overflow. */
+ k = k+n;
if (k > 0) /* normal result */
{SET_FLT128_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;}
if (k <= -114)
diff --git a/libquadmath/math/scalbnq.c b/libquadmath/math/scalbnq.c
index b7049a70e4..9975a47154 100644
--- a/libquadmath/math/scalbnq.c
+++ b/libquadmath/math/scalbnq.c
@@ -1,4 +1,4 @@
-/* s_scalbnl.c -- long double version of s_scalbn.c.
+/* scalbnq.c -- __float128 version of s_scalbn.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,6 +13,14 @@
* ====================================================
*/
+
+/*
+ * scalbnq (__float128 x, int n)
+ * scalbnq(x,n) returns x* 2**n computed by exponent
+ * manipulation rather than by actually performing an
+ * exponentiation or a multiplication.
+ */
+
#include "quadmath-imp.h"
static const __float128
@@ -34,10 +42,12 @@ scalbnq (__float128 x, int n)
k = ((hx>>48)&0x7fff) - 114;
}
if (k==0x7fff) return x+x; /* NaN or Inf */
- k = k+n;
- if (n> 50000 || k > 0x7ffe)
- return huge*copysignq(huge,x); /* overflow */
if (n< -50000) return tiny*copysignq(tiny,x); /*underflow*/
+ if (n> 50000 || k+n > 0x7ffe)
+ return huge*copysignq(huge,x); /* overflow */
+ /* Now k and n are bounded we know that k = k+n does not
+ overflow. */
+ k = k+n;
if (k > 0) /* normal result */
{SET_FLT128_MSW64(x,(hx&0x8000ffffffffffffULL)|(k<<48)); return x;}
if (k <= -114)
diff --git a/libquadmath/math/sincosq_kernel.c b/libquadmath/math/sincosq_kernel.c
index 578d1828f7..f6341a4d94 100644
--- a/libquadmath/math/sincosq_kernel.c
+++ b/libquadmath/math/sincosq_kernel.c
@@ -126,14 +126,18 @@ __quadmath_kernel_sincosq(__float128 x, __float128 y, __float128 *sinx,
{
/* So that we don't have to use too large polynomial, we find
l and h such that x = l + h, where fabsl(l) <= 1.0/256 with 83
- possible values for h. We look up cosl(h) and sinl(h) in
- pre-computed tables, compute cosl(l) and sinl(l) using a
+ possible values for h. We look up cosq(h) and sinq(h) in
+ pre-computed tables, compute cosq(l) and sinq(l) using a
Chebyshev polynomial of degree 10(11) and compute
- sinl(h+l) = sinl(h)cosl(l) + cosl(h)sinl(l) and
- cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */
+ sinq(h+l) = sinq(h)cosq(l) + cosq(h)sinq(l) and
+ cosq(h+l) = cosq(h)cosq(l) - sinq(h)sinq(l). */
index = 0x3ffe - (tix >> 16);
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
- x = fabsq (x);
+ if (signbitq (x))
+ {
+ x = -x;
+ y = -y;
+ }
switch (index)
{
case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
diff --git a/libquadmath/math/sinhq.c b/libquadmath/math/sinhq.c
index 5492180a2a..eff8149b51 100644
--- a/libquadmath/math/sinhq.c
+++ b/libquadmath/math/sinhq.c
@@ -1,4 +1,4 @@
-/* e_sinhl.c -- __float128 version of e_sinh.c.
+/* sinhq.c -- __float128 version of e_sinh.c.
* Conversion to __float128 by Ulrich Drepper,
* Cygnus Support, drepper@cygnus.com.
*/
@@ -35,22 +35,22 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* __ieee754_sinhl(x)
+/* sinhq(x)
* Method :
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
- * 1. Replace x by |x| (sinhl(-x) = -sinhl(x)).
+ * 1. Replace x by |x| (sinhq(-x) = -sinhq(x)).
* 2.
* E + E/(E+1)
- * 0 <= x <= 25 : sinhl(x) := --------------, E=expm1l(x)
+ * 0 <= x <= 25 : sinhq(x) := --------------, E=expm1q(x)
* 2
*
- * 25 <= x <= lnovft : sinhl(x) := expl(x)/2
- * lnovft <= x <= ln2ovft: sinhl(x) := expl(x/2)/2 * expl(x/2)
- * ln2ovft < x : sinhl(x) := x*shuge (overflow)
+ * 25 <= x <= lnovft : sinhq(x) := expq(x)/2
+ * lnovft <= x <= ln2ovft: sinhq(x) := expq(x/2)/2 * expq(x/2)
+ * ln2ovft < x : sinhq(x) := x*shuge (overflow)
*
* Special cases:
- * sinhl(x) is |x| if x is +INF, -INF, or NaN.
- * only sinhl(0)=0 is exact for finite x.
+ * sinhq(x) is |x| if x is +INF, -INF, or NaN.
+ * only sinhq(0)=0 is exact for finite x.
*/
#include "quadmath-imp.h"
@@ -106,6 +106,6 @@ sinhq (__float128 x)
return t * w;
}
- /* |x| > overflowthreshold, sinhl(x) overflow */
+ /* |x| > overflowthreshold, sinhq(x) overflow */
return x * shuge;
}
diff --git a/libquadmath/math/sinq.c b/libquadmath/math/sinq.c
index 76254a3730..989f679d6d 100644
--- a/libquadmath/math/sinq.c
+++ b/libquadmath/math/sinq.c
@@ -1,4 +1,4 @@
-/* s_sinl.c -- long double version of s_sin.c.
+/* sinq.c -- __float128 version of s_sin.c.
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -13,13 +13,13 @@
* ====================================================
*/
-/* sinl(x)
+/* sinq(x)
* Return sine function of x.
*
* kernel function:
- * __kernel_sinl ... sine function on [-pi/4,pi/4]
- * __kernel_cosl ... cose function on [-pi/4,pi/4]
- * __ieee754_rem_pio2l ... argument reduction routine
+ * __quadmath_kernel_sinq ... sine function on [-pi/4,pi/4]
+ * __quadmath_kernel_cosq ... cose function on [-pi/4,pi/4]
+ * __quadmath_rem_pio2q ... argument reduction routine
*
* Method.
* Let S,C and T denote the sin, cos and tan respectively on
diff --git a/libquadmath/math/sinq_kernel.c b/libquadmath/math/sinq_kernel.c
index 395fcaba9c..86034551d4 100644
--- a/libquadmath/math/sinq_kernel.c
+++ b/libquadmath/math/sinq_kernel.c
@@ -99,10 +99,10 @@ __quadmath_kernel_sinq (__float128 x, __float128 y, int iy)
{
/* So that we don't have to use too large polynomial, we find
l and h such that x = l + h, where fabsl(l) <= 1.0/256 with 83
- possible values for h. We look up cosl(h) and sinl(h) in
- pre-computed tables, compute cosl(l) and sinl(l) using a
+ possible values for h. We look up cosq(h) and sinq(h) in
+ pre-computed tables, compute cosq(l) and sinq(l) using a
Chebyshev polynomial of degree 10(11) and compute
- sinl(h+l) = sinl(h)cosl(l) + cosl(h)sinl(l). */
+ sinq(h+l) = sinq(h)cosq(l) + cosq(h)sinq(l). */
index = 0x3ffe - (tix >> 16);
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
x = fabsq (x);
@@ -116,7 +116,7 @@ __quadmath_kernel_sinq (__float128 x, __float128 y, int iy)
SET_FLT128_WORDS64(h, ((uint64_t)hix) << 32, 0);
if (iy)
- l = y - (h - x);
+ l = (ix < 0 ? -y : y) - (h - x);
else
l = x - h;
z = l * l;
diff --git a/libquadmath/math/sqrtq.c b/libquadmath/math/sqrtq.c
index 6ed4605ed5..f63c0d1f6d 100644
--- a/libquadmath/math/sqrtq.c
+++ b/libquadmath/math/sqrtq.c
@@ -8,14 +8,17 @@ sqrtq (const __float128 x)
__float128 y;
int exp;
- if (x == 0)
+ if (isnanq (x) || (isinfq (x) && x > 0))
return x;
- if (isnanq (x))
+ if (x == 0)
return x;
if (x < 0)
- return nanq ("");
+ {
+ /* Return NaN with invalid signal. */
+ return (x - x) / (x - x);
+ }
if (x <= DBL_MAX && x >= DBL_MIN)
{
diff --git a/libquadmath/math/tanq.c b/libquadmath/math/tanq.c
index e1ec6aae86..690d94b782 100644
--- a/libquadmath/math/tanq.c
+++ b/libquadmath/math/tanq.c
@@ -160,7 +160,7 @@ __quadmath_kernel_tanq (__float128 x, __float128 y, int iy)
-/* s_tanl.c -- long double version of s_tan.c.
+/* tanq.c -- __float128 version of s_tan.c.
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
@@ -180,8 +180,8 @@ __quadmath_kernel_tanq (__float128 x, __float128 y, int iy)
* Return tangent function of x.
*
* kernel function:
- * __kernel_tanq ... tangent function on [-pi/4,pi/4]
- * __ieee754_rem_pio2q ... argument reduction routine
+ * __quadmath_kernel_tanq ... tangent function on [-pi/4,pi/4]
+ * __quadmath_rem_pio2q ... argument reduction routine
*
* Method.
* Let S,C and T denote the sin, cos and tan respectively on
diff --git a/libquadmath/math/tgammaq.c b/libquadmath/math/tgammaq.c
index 3305b6484c..a07d5831de 100644
--- a/libquadmath/math/tgammaq.c
+++ b/libquadmath/math/tgammaq.c
@@ -30,6 +30,8 @@ tgammaq (__float128 x)
conditions we must check some values separately. */
int64_t hx;
uint64_t lx;
+ __float128 res;
+ int sign;
GET_FLT128_WORDS64 (hx, lx, x);
@@ -46,5 +48,6 @@ tgammaq (__float128 x)
return x - x;
/* XXX FIXME. */
- return expq (lgammaq (x));
+ res = expq (lgammaq (x));
+ return signbitq (x) ? -res : res;
}
diff --git a/libquadmath/math/x2y2m1q.c b/libquadmath/math/x2y2m1q.c
new file mode 100644
index 0000000000..90bbc2f605
--- /dev/null
+++ b/libquadmath/math/x2y2m1q.c
@@ -0,0 +1,93 @@
+/* Compute x^2 + y^2 - 1, without large cancellation error.
+ Copyright (C) 2012 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 "quadmath-imp.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 inline void
+add_split (__float128 *hi, __float128 *lo, __float128 x, __float128 y)
+{
+ /* Apply Dekker's algorithm. */
+ *hi = x + 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 (__float128 *hi, __float128 *lo, __float128 x, __float128 y)
+{
+ /* Fast built-in fused multiply-add. */
+ *hi = x * y;
+ *lo = fmaq (x, y, -*hi);
+}
+
+/* Compare absolute values of floating-point values pointed to by P
+ and Q for qsort. */
+
+static int
+compare (const void *p, const void *q)
+{
+ __float128 pld = fabsq (*(const __float128 *) p);
+ __float128 qld = fabsq (*(const __float128 *) q);
+ if (pld < qld)
+ return -1;
+ else if (pld == qld)
+ return 0;
+ else
+ return 1;
+}
+
+/* Return X^2 + Y^2 - 1, computed without large cancellation error.
+ It is given that 1 > X >= Y >= epsilon / 2, and that either X >=
+ 0.75 or Y >= 0.5. */
+
+__float128
+__quadmath_x2y2m1q (__float128 x, __float128 y)
+{
+ __float128 vals[4];
+ size_t i;
+
+ /* FIXME: SET_RESTORE_ROUNDL (FE_TONEAREST); */
+ mul_split (&vals[1], &vals[0], x, x);
+ mul_split (&vals[3], &vals[2], y, y);
+ if (x >= 0.75Q)
+ vals[1] -= 1.0Q;
+ else
+ {
+ vals[1] -= 0.5Q;
+ vals[3] -= 0.5Q;
+ }
+ qsort (vals, 4, sizeof (__float128), 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 (i = 0; i <= 2; i++)
+ {
+ add_split (&vals[i + 1], &vals[i], vals[i + 1], vals[i]);
+ qsort (vals + i + 1, 3 - i, sizeof (__float128), compare);
+ }
+ /* Now any error from this addition will be small. */
+ return vals[3] + vals[2] + vals[1] + vals[0];
+}
diff --git a/libquadmath/printf/fpioconst.c b/libquadmath/printf/fpioconst.c
index 8c67e6f904..cacb1446dd 100644
--- a/libquadmath/printf/fpioconst.c
+++ b/libquadmath/printf/fpioconst.c
@@ -14,9 +14,8 @@
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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "gmp-impl.h" /* This defines BITS_PER_MP_LIMB. */
@@ -77,9 +76,8 @@ const mp_limb_t __tens[] =
0x26b2716e, 0xadc666b0, 0x1d153624, 0x3c42d35a, 0x63ff540e, 0xcc5573c0,
0x65f9ef17, 0x55bc28f2, 0x80dcc7f7, 0xf46eeddc, 0x5fdcefce, 0x000553f7,
-#ifndef __NO_LONG_DOUBLE_MATH
-# define TENS_P9_IDX (TENS_P8_IDX + TENS_P8_SIZE)
-# define TENS_P9_SIZE 56
+#define TENS_P9_IDX (TENS_P8_IDX + TENS_P8_SIZE)
+#define TENS_P9_SIZE 56
[TENS_P9_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -91,8 +89,8 @@ const mp_limb_t __tens[] =
0xb099bc81, 0x45a71d46, 0xa2699748, 0x8cb07303, 0x8a0b1f13, 0x8cab8a97,
0xc1d238d9, 0x633415d4, 0x0000001c,
-# define TENS_P10_IDX (TENS_P9_IDX + TENS_P9_SIZE)
-# define TENS_P10_SIZE 109
+#define TENS_P10_IDX (TENS_P9_IDX + TENS_P9_SIZE)
+#define TENS_P10_SIZE 109
[TENS_P10_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -113,6 +111,7 @@ const mp_limb_t __tens[] =
0xd2db49ef, 0x926c3f5b, 0xae6209d4, 0x2d433949, 0x34f4a3c6, 0xd4305d94,
0xd9d61a05, 0x00000325,
+#ifndef __NO_LONG_DOUBLE_MATH
# define TENS_P11_IDX (TENS_P10_IDX + TENS_P10_SIZE)
# define TENS_P11_SIZE 215
[TENS_P11_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -225,9 +224,442 @@ const mp_limb_t __tens[] =
0x35fcb457, 0x1bb6c6e4, 0xf74eb928, 0x3d5d0b54, 0x87cc1d21, 0x4964046f,
0x18ae4240, 0xd868b275, 0x8bd2b496, 0x1c5563f4, 0xc234d8f5, 0xf868e970,
0xf9151fff, 0xae7be4a2, 0x271133ee, 0xbb0fd922, 0x25254932, 0xa60a9fc0,
- 0x104bcd64, 0x30290145, 0x00000062
-#endif /* !__NO_LONG_DOUBLE_MATH */
+ 0x104bcd64, 0x30290145, 0x00000062,
+
+# define TENS_P13_IDX (TENS_P12_IDX + TENS_P12_SIZE)
+# define TENS_P13_SIZE 853
+ [TENS_P13_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x64cf8001, 0x9f345226, 0x644963e5, 0x7b8d5053, 0x49f0aa29,
+ 0xb945c82f, 0x430ff478, 0x933b6bb8, 0x5ff82d0a, 0x64c501d4, 0x73bbf174,
+ 0x9ec1e1b3, 0x3bfbe803, 0xe9010689, 0xf7390d8e, 0x3fef8d80, 0xf31d1325,
+ 0x2c73446b, 0xf5ca7a92, 0x1c19e379, 0x270af2be, 0xf52d9d9c, 0xeb2bed48,
+ 0x3abf72e1, 0x4ac4ffc2, 0x7ecf3508, 0x22019a82, 0x38597a5a, 0xbe6a7b3c,
+ 0x9a51ff6e, 0xa2d28437, 0x0c0abe9d, 0x7c9ec6ea, 0xc79887ff, 0x5851c899,
+ 0x436420d0, 0xefead581, 0x72b5547f, 0x99b1d2b5, 0x077ad8f8, 0x5cddbf5b,
+ 0x3b4305ed, 0xe3861ac7, 0x2d88f3fd, 0x3d6b43be, 0x393220aa, 0xe5382405,
+ 0x1cd62095, 0x61a10c96, 0x87a0d1e1, 0xca95a55d, 0x68c933e6, 0x9ee082e2,
+ 0x778089bb, 0x41429ee9, 0xfbb6d8d4, 0xc529500d, 0x26cf5471, 0x68b9be29,
+ 0xd6c9b140, 0x07be635a, 0x84151852, 0xb5572182, 0x83730335, 0xeb2300b4,
+ 0xdd312d31, 0x05d6dd9b, 0x488da59c, 0x37784d25, 0xda2c2e40, 0x6a8d92fa,
+ 0x6a57d720, 0x950b41ac, 0xf07a8632, 0xcd55f062, 0x2ecad06a, 0xe6a3dfe7,
+ 0x34c98bb0, 0x9c767d8f, 0xb60521b1, 0x752aafd1, 0xe87d16be, 0x9de1d728,
+ 0xe58a8b0c, 0xc6013830, 0x2fa2c119, 0x3c4f9156, 0x519b40c8, 0x5058fc8f,
+ 0xab78701b, 0xadc59c47, 0xc502a554, 0x0fb3286f, 0x6647f04c, 0x9db4076e,
+ 0x5ea495c8, 0x9c74fab1, 0xb4f00f8b, 0x897c7a3c, 0xd092b4c6, 0x283e0340,
+ 0x32f31fa8, 0xeeb708cc, 0x67b63de2, 0x4f7b3c8b, 0xef2bc02b, 0xda14bfe3,
+ 0xc49344c0, 0xaabc85be, 0xb6c4e69e, 0x2ece8aa6, 0x63a11016, 0x19cfba4d,
+ 0x726ae4d9, 0x0fc90b42, 0xee6ae707, 0x4290b04a, 0x4d9aabc5, 0xfb2b070e,
+ 0xf34906cd, 0x1ff54b0a, 0x52ca9709, 0x0b42bfe1, 0x16431570, 0x980f3076,
+ 0x6b5565bb, 0xeb8c4c4a, 0x9ce63c76, 0xb9e4c771, 0x3da24c53, 0x6f0266fa,
+ 0xb50e3c66, 0x76e34f79, 0x01bb4b96, 0x9948cf3e, 0x0fbea124, 0x86bead12,
+ 0xa1fa4edc, 0xd11e901c, 0xc3b97bf9, 0x71730e03, 0x370ca58e, 0x48b19715,
+ 0x886467e2, 0xdb237497, 0x3c727e24, 0x2116ccd2, 0x8e67d76e, 0xf973aecf,
+ 0x34bdedd3, 0x31d680ec, 0xb042ab05, 0x770e96a0, 0xfc5c3c17, 0xab6f1874,
+ 0xb8204ece, 0x5843f3a5, 0x416c0ced, 0x11dd112f, 0x95780183, 0xb1c74bd8,
+ 0x7e0e8613, 0x96c6453b, 0xa79ffc10, 0xb2157651, 0xfcd6da0a, 0x836a34a7,
+ 0x3dd0ccac, 0x316e5a36, 0x496049ed, 0x0322bcb2, 0xdea1a97d, 0xcdf2aa5a,
+ 0x39578d53, 0x1d1aa931, 0x030565c9, 0xd198cbed, 0x324e0a27, 0x5db83e8a,
+ 0x28432534, 0x90bf23e8, 0x5cb134c0, 0xdd0adab6, 0x009e5051, 0xf8ad61da,
+ 0x7e36a6d7, 0x84c75e57, 0xbdffe6aa, 0xb5d5532e, 0x138d680e, 0xbd84ddac,
+ 0x4a5f74a1, 0xccff00d1, 0x55538cfa, 0xb0948b8c, 0x48528011, 0xe345f82e,
+ 0x9e047ad7, 0x6ee770ff, 0xea77bef0, 0x0fc13669, 0x2f162567, 0x869426ac,
+ 0x0614686c, 0x3a3ff464, 0x4263ed82, 0xb3589b47, 0x57205a7a, 0x213f24ad,
+ 0xae6fc46b, 0x3de03e4e, 0xd92b133f, 0x315a589b, 0x1b49c24a, 0x73381bcb,
+ 0x1641c138, 0x7bc99425, 0xbc680ada, 0xa5cfbc9a, 0x962e9884, 0x0a960d70,
+ 0xfc8d12f6, 0xed18ef4c, 0x60acc868, 0x9aea5d14, 0x13113036, 0xc747c87e,
+ 0x2d99a5b0, 0x3a369bb3, 0x006b3658, 0x118a5135, 0xe43fa6e6, 0xb4947190,
+ 0xa13dc05e, 0xd7733db8, 0x0dbd7170, 0xc3fb67d1, 0x117ed7e7, 0xe2d72a49,
+ 0xc05fe99e, 0x9638db40, 0xd971a25b, 0x4239d468, 0x1a159559, 0x850a223c,
+ 0xc1117392, 0x22d2dbd8, 0x567b5fc0, 0x92c5b4eb, 0xc051007a, 0x11cc0099,
+ 0xfb355720, 0x6907810d, 0x39848161, 0x5e8534f4, 0x61d19ef2, 0x2ee8c466,
+ 0x8a0ab03c, 0xc234af76, 0x879aa514, 0x9774a235, 0x59e5da57, 0x9bc466b3,
+ 0xf339bd5a, 0x44ab026d, 0xbbb5fd67, 0x2b977202, 0x3685c9f2, 0x03e5dc00,
+ 0x7054359e, 0x5239cfb0, 0x9ba11f08, 0xf8237562, 0x9c258687, 0xa3b510dd,
+ 0x52c7bf8f, 0xb31ed0cf, 0x3245e079, 0xff9ff8d3, 0xbaee38c7, 0xf17d5562,
+ 0xf702b3b9, 0xcc4c8563, 0xcbca275d, 0xe005d9d1, 0xe817dbac, 0x05c6920a,
+ 0x62cee350, 0x0f1deac0, 0x19e049b9, 0x59599f74, 0xb2a27a16, 0xf0911d5a,
+ 0x7dcef00d, 0x3603dd66, 0x37552251, 0x97813735, 0x5fa022da, 0x0d849416,
+ 0xefbe57c2, 0x30a0e592, 0x57619296, 0xc953cc47, 0x11735043, 0xa83526ad,
+ 0xc0444be0, 0xb5f8463c, 0x16ff5136, 0x2a0a6631, 0xf037572c, 0xd30464da,
+ 0xb1bf8daa, 0x7f5718f7, 0x0f3e9e7e, 0xe5a4cfe7, 0xc26f2624, 0x8c9b5ae4,
+ 0xdfe8f485, 0xf6fa82e3, 0xc64a1509, 0xacb24aea, 0x3024b220, 0xddb02ac0,
+ 0xddcdfedd, 0xd834c574, 0x384c86c3, 0xd904e099, 0xdd48a571, 0x4550a05f,
+ 0x77b35c74, 0x81e85f71, 0xaaebdc6d, 0x0f9bb0b1, 0xd4cdc054, 0x7af4df85,
+ 0x845786af, 0xe5e53887, 0xdf2a91ca, 0xf6a58211, 0x5689a3c4, 0x8cf6aa15,
+ 0xa705983a, 0x9fbf2f52, 0x2ce7fef0, 0x48e84a62, 0x4a3b5365, 0xf8281a47,
+ 0xd48a0872, 0x8423dcf6, 0xf0929c3e, 0x044a5049, 0xe9ec071b, 0x17decc36,
+ 0x20e30c1b, 0x45fc2813, 0x3342196a, 0x46afb7f9, 0x6601e337, 0x30754439,
+ 0xf18094d1, 0xd38b4112, 0x61410dd1, 0xd8796b36, 0xd97d4dd8, 0x47e9bc0b,
+ 0x80805191, 0x1584e2da, 0xcde438c1, 0x955d24f1, 0x409659a1, 0x1b0950b1,
+ 0x5a09635f, 0x65b1febe, 0x615472b9, 0x525dc00a, 0x6308e067, 0x4089e2d4,
+ 0xd4e705a4, 0x43fc9209, 0x32c18b26, 0x4447a5fa, 0xaf271153, 0x3617cadc,
+ 0x4dc4f0d2, 0x692eb386, 0x6aa116ef, 0x655991bc, 0x0641dc0b, 0x54469597,
+ 0xc6559664, 0x749c0fe8, 0x4bdc0d1a, 0xa7d3381e, 0xc5292a61, 0x4eb65fdc,
+ 0x42474cc2, 0xf2c6b173, 0x19dfc9ee, 0x0a19a199, 0xbece2ee3, 0xc68b778d,
+ 0xaa03aa7c, 0xc8db86f0, 0xae54d2be, 0xb92a01e0, 0xdee3f48f, 0x6023c0a9,
+ 0xf6ae2852, 0xa233763b, 0xa441cb9e, 0x3246dddd, 0x3a8bb4b7, 0x44faa3c3,
+ 0x308ef2c8, 0xfd1c8516, 0xd2862534, 0x3b25ebe7, 0x62336f6f, 0x0c336a45,
+ 0x0b8e2ce6, 0xe867f171, 0x11eea1f2, 0x523972ec, 0x68df4903, 0x50c05824,
+ 0x51ef4cb7, 0xcb4df2a8, 0x3ffae115, 0xb51aca2f, 0x3ed1635f, 0xd6ff1cc6,
+ 0x0a5ac09f, 0xde8ed9d6, 0x0a3dc76f, 0x5dc2d8dd, 0x37991dde, 0xf95bacb2,
+ 0x80ad6e13, 0x163005ee, 0xd4f8c7a6, 0x3225d180, 0xa4760f08, 0x5fff004d,
+ 0x9b2b1a87, 0xe7ea8576, 0x5cd00b66, 0xec478452, 0x285dd80d, 0x20112439,
+ 0x4301b3a1, 0xff879fc8, 0xfacbb68c, 0xaf6af6b8, 0xb17fdf84, 0xc208d9f1,
+ 0xf4489576, 0x8794a6e9, 0xadcc862c, 0x0e83e54c, 0x931685a4, 0xab01c580,
+ 0x1e40293b, 0xcad784fa, 0x1f1ddf7f, 0x6b856084, 0xcee722b2, 0x1c39938b,
+ 0x74254eb4, 0xc7ccebf4, 0xb9c26d9a, 0x6b08dfb9, 0x2e3ece24, 0x981455ec,
+ 0xdff60410, 0xbc804e2b, 0xe06fa38b, 0xb534540c, 0x72e53c52, 0x02dfb2ef,
+ 0xb2a5c05a, 0x5002a2a5, 0x97313338, 0x597c53ff, 0xd61df455, 0x34e5261a,
+ 0x39ac2ec5, 0xc6bc0cab, 0x388b7539, 0x3f732fc0, 0x00eac704, 0x92fb21d9,
+ 0xc089971e, 0xb4ffa503, 0x7af93f8f, 0x72e353b6, 0xa8311b23, 0x8266c9af,
+ 0x1de496ca, 0xdbdb16b0, 0xd6fa0b51, 0x9991a5ef, 0xbd563089, 0x168cbe0f,
+ 0x0954a1e3, 0x537b9245, 0x53d09723, 0x2867272d, 0x86558cb9, 0x0b83f026,
+ 0xfac85d10, 0xf8562951, 0x1e5ddb95, 0xad3668c8, 0x48d27b92, 0xc930b7e6,
+ 0x19b58a99, 0xa3de74e3, 0xa9cda917, 0xcb6e35ee, 0x7a4dd16e, 0x4c80e9d5,
+ 0x4d84073f, 0x74a95ba8, 0x9cffcfc0, 0xd28485eb, 0x15796372, 0x5717e9cd,
+ 0x77eda8df, 0xab473c4e, 0xadb965e1, 0xffad6959, 0x5bc05659, 0x6ed63880,
+ 0xfb240227, 0x2014850b, 0xd15fdddf, 0xfdd74592, 0xb538f37d, 0x3a8e2e82,
+ 0x1473396f, 0xf6a5edf8, 0x3ce41a21, 0x0cc4351a, 0x754e8264, 0xaab95e73,
+ 0xc7821b96, 0xf42ff463, 0xc242faaa, 0xdd00ac65, 0x087e260e, 0x17d193f5,
+ 0x0dbe0328, 0x844a63c9, 0xf9d10f96, 0x85aa91dd, 0xbaf127ec, 0x0ab6dabb,
+ 0xce85e6a5, 0x1af5d24f, 0xe7b56a16, 0xcd6c5a19, 0x57d1d79f, 0x5dfc2b28,
+ 0xec4dd2f0, 0x18fe64a1, 0x8d72216a, 0x5f222077, 0x72f14a08, 0xd8b09b11,
+ 0x3bf038ab, 0xc6cf1f44, 0xc4265d7c, 0xdab1b0e7, 0x46398d2c, 0x7dcfdc68,
+ 0xb6e705d3, 0x4aafd1e6, 0x362c1183, 0xd8701107, 0xf6ac98b7, 0xad114d7e,
+ 0xd6649424, 0xc40ab551, 0xddd1c6e4, 0xa132030f, 0xc9d284c8, 0xdb1f662a,
+ 0x824069ee, 0x4157904b, 0xc846b3ad, 0xd38481ca, 0x0a248c17, 0xc846831f,
+ 0xe8745feb, 0x000025a8,
+
+# define TENS_P14_IDX (TENS_P13_IDX + TENS_P13_SIZE)
+# define TENS_P14_SIZE 1703
+ [TENS_P14_IDX] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x099f0001,
+ 0x41b5687d, 0xcbfd1b6e, 0x8c75ee63, 0x4b191cea, 0xd75296ad, 0x2394d80a,
+ 0x1eb5da9b, 0x18a004ed, 0x5c79fed9, 0x37e3b01c, 0xed67a1b8, 0x78d9a714,
+ 0x2a1a34d5, 0x8fbe7f0d, 0x6b1d3516, 0xe57c43ea, 0xa7825681, 0xc81d32e8,
+ 0xd3e716e1, 0x58860b00, 0xa6d93d65, 0x83159c97, 0x0113232f, 0xd6122269,
+ 0x7321c3a0, 0xbe6a92f3, 0xca4ca9d3, 0xd1e276a5, 0xc0e55163, 0xb05915d6,
+ 0x7b7a78c1, 0x0fae0ca4, 0x62a3df4b, 0x08abec6f, 0x13030d11, 0xd446338a,
+ 0x60dcc8f2, 0x5f05d1d5, 0x25e1f9f6, 0x04a40bee, 0x7f8c7113, 0x88f47ec0,
+ 0x589ff59a, 0x308c3661, 0xea5068a1, 0x95fb108f, 0x06e87dff, 0x1559e741,
+ 0xd4d4abdc, 0x01e092e4, 0xee16907c, 0x5a7b78e6, 0xe73aabcb, 0x146bb7e0,
+ 0xad372889, 0x4f6b43c5, 0xfd49fc1d, 0x0f29f589, 0xd3739253, 0xc4745a56,
+ 0xe2acfcc2, 0xd75ccbc7, 0xedd016cd, 0xac5a63e0, 0xef82ccd3, 0xb352496e,
+ 0x2bdabfc4, 0x5b3d0401, 0x01b0197f, 0xade96d3c, 0x29d9253d, 0x19bebdba,
+ 0x73c56b1b, 0x255e7b25, 0x1f2b7f1e, 0xa56a457e, 0x6299c836, 0x5c63cc78,
+ 0xa2ca74c6, 0x5c85fe93, 0xee571bea, 0x508e2561, 0x2db5f1d0, 0xb1fde6a9,
+ 0xa9b87b99, 0x4fb90a37, 0xf7260f07, 0xff58c5fd, 0x56ee7e97, 0xbab9fa46,
+ 0x42e6f9ce, 0x78816f73, 0x1b76d267, 0xfdb2c728, 0x4566519c, 0xae17dd8d,
+ 0xb9f6a95f, 0x1cd533a1, 0x67160dea, 0x14534bac, 0xfcd8f8f9, 0xf3f2901d,
+ 0x708b1f0a, 0x8829063b, 0x9457a1df, 0x8f872aa1, 0x36bb9335, 0xb5672c0e,
+ 0xd889d109, 0x7ec63a6a, 0x93306672, 0x39b6d457, 0x8239ab68, 0xef2e2506,
+ 0xbe0d7a1f, 0x4251b635, 0x05f65522, 0x0ef0bd55, 0x03286891, 0x2c42b664,
+ 0x9815fbac, 0x471fd611, 0x814e379c, 0x7dd8349d, 0xa4a25bda, 0x9886b84c,
+ 0x01b9e39d, 0x5a7ce1a2, 0xae31cbc9, 0x86d07f32, 0x83ef8faf, 0xb66b5b76,
+ 0x58470fdf, 0x96d59b73, 0x51618889, 0xdc400cf7, 0xfc8e0fc6, 0xaf693670,
+ 0x09a08e56, 0x91737de6, 0x74f682e1, 0x0e03923f, 0x7f8ac56d, 0x7400cfd4,
+ 0x8e05e49a, 0x4cebea3c, 0x384e1164, 0xb2e43d8c, 0xb50ae05e, 0x0f0b3ed9,
+ 0xa4006123, 0x64137137, 0x4e9a1934, 0x05404100, 0xd9621be6, 0x9329a255,
+ 0x5c347ebb, 0x75cbeb1b, 0xe684346b, 0x840fee55, 0xba6a9753, 0xf43836f6,
+ 0x60505b7b, 0x334a9278, 0xfd6d475d, 0x5db94761, 0x267375aa, 0xc110e160,
+ 0x024f6d63, 0x2ec96610, 0xa99b4c19, 0xb915c9f4, 0x338cfd90, 0xf02ea846,
+ 0xb9e51a09, 0xae928fb1, 0xfae31d88, 0x1a3db721, 0x8475dd26, 0x5769489d,
+ 0x7ad4c407, 0x0a49e9f0, 0x34e275c8, 0x3d075d83, 0x1d63114a, 0x72a96415,
+ 0x6b98e947, 0x1d500b5f, 0xd50fdc36, 0x141e5085, 0x87751275, 0xe7843834,
+ 0x2278809e, 0xb15c52ee, 0x947aead2, 0xfedb7b02, 0x5197b744, 0x64e09ba8,
+ 0x8849d0a6, 0x23beaa85, 0x11ecb913, 0x0f7ed667, 0x5d984848, 0x9f6331ea,
+ 0x588290e9, 0xa24d64d1, 0x7e09e9e5, 0x32592033, 0x03a501df, 0x27c270a6,
+ 0xbb3df738, 0x3c7c5a70, 0x4190833c, 0x7d4bf9f4, 0x80e5d89b, 0xa7fc6194,
+ 0xfaefb663, 0x62e52b49, 0xd3b6adcd, 0x809646fc, 0x1f2cf73a, 0xb765ed4f,
+ 0x531e4bfb, 0x92cd05f2, 0xaf12d1a6, 0x22ee30f3, 0x38da1074, 0xed6447bb,
+ 0x1a725608, 0xaff222d3, 0x7a3c6f54, 0xbca79a56, 0x7b0e8d12, 0x1c4660c5,
+ 0x6e34d6fb, 0x6f481a9f, 0xfe9dc99c, 0xf888db82, 0xd8489ea0, 0x84b4c0fa,
+ 0xc0dea281, 0x977a8583, 0xae30e887, 0x8c1cbcec, 0x1d4848cb, 0x0ee0d137,
+ 0xd011b0fc, 0x94b5fd49, 0x478d7dd4, 0x3d67f2e7, 0xacab62ad, 0x0ab4e62a,
+ 0x1dfc7df5, 0xd22e4553, 0x870b0e75, 0x49b7b001, 0x1b73bf6d, 0x12807ffd,
+ 0xdc9f0737, 0x6f3e5852, 0xc0e2f250, 0x93e62e4a, 0x4d96a55a, 0xc1d0e185,
+ 0x83a126db, 0x190b917b, 0xefbfd043, 0xc7df1669, 0x8f25b6dd, 0x2062eac9,
+ 0x476c17a6, 0xcb60f278, 0x25460383, 0x0e85e996, 0xda8c05be, 0x6f678a34,
+ 0x69206234, 0xf59be929, 0x1947b69a, 0x0ebfa11b, 0x90fd8322, 0x15c1e9bf,
+ 0xd699b1ec, 0xb2f0343f, 0x7001d002, 0xcf76eaaa, 0xc0778ab5, 0x5173eda8,
+ 0xb7b008e2, 0x4e00e4c6, 0x505d3f4d, 0x99dd341a, 0x1c9d4e12, 0x4ffb6978,
+ 0x474c5e95, 0x6e9ca6dd, 0xda19f938, 0xe2dda6e0, 0x98dc318e, 0xda455e54,
+ 0x3f67b836, 0x21e4181c, 0xa97e9a64, 0x1e17f655, 0x527a08bb, 0x1712dc21,
+ 0x682972ad, 0x0042d256, 0xccbeadf1, 0xca497b96, 0x861e99e0, 0x0d8aa585,
+ 0xeeb0f650, 0xdcc3c3da, 0x506af77e, 0x5deb9768, 0x7c9d60be, 0xe9d978b7,
+ 0x37b37e95, 0x77ad0b94, 0x42747f75, 0x07be42c4, 0x6d5fd2fe, 0x4c8c5da9,
+ 0x0d8fc27d, 0x0f2fd50f, 0x0ccf6023, 0x5b56053f, 0x3b1101bd, 0x56d34906,
+ 0xc0feca27, 0x7602a150, 0xc4888da4, 0x419abe54, 0x56d10633, 0xc76120ed,
+ 0x8db14123, 0xb656e675, 0x741e8f76, 0xd297b94e, 0x96be6f21, 0x3662439d,
+ 0x9b409e27, 0x6626574d, 0x35fff92a, 0xbf558205, 0x69e02439, 0xbe6838b7,
+ 0x6400fd4c, 0xa00f64ca, 0x1f4b158a, 0x9e2052ae, 0x04cca558, 0xfb5ee69e,
+ 0x58da644c, 0x96f26e1f, 0x8ab19401, 0xbee1e16b, 0xed8bf908, 0x2f2809a4,
+ 0xd50babab, 0x6e57f7e6, 0x6b0a8929, 0xf7356431, 0xb54a4cfc, 0x9a1d0ac4,
+ 0x6f9fd6cb, 0x836bfbf8, 0x3b42f469, 0x8bd32129, 0x40111b6b, 0x7c278fb1,
+ 0xb345d955, 0xff1fd188, 0xd32cd13c, 0xf7ec3aa0, 0x3789f792, 0xab707fa4,
+ 0x4d79a4bf, 0xb3a28ceb, 0xd9c24d8e, 0x7134dadc, 0x06e2eb3e, 0xd7c04f76,
+ 0xb379d811, 0x2b3b0ebc, 0x8c94fc33, 0xa28b53ab, 0xc06c5d01, 0xd900432a,
+ 0x7fea91ca, 0x6d30b008, 0x64845f08, 0x796f5349, 0xfde4687d, 0xf888fe67,
+ 0xe0046c56, 0xae482177, 0xce98cb11, 0x84590c46, 0x1feb4400, 0x6e1ba29b,
+ 0xff2f1611, 0xf73f3e9c, 0x3159ca8c, 0x34845918, 0x56f0ed46, 0xb7d10c32,
+ 0xd9a16a01, 0x405b9e91, 0x3cee3e24, 0x8739e4a6, 0x2ab396b4, 0x3f1b7871,
+ 0x09835dfd, 0x8c7a489f, 0x1592b74a, 0x05df7c81, 0x0e8d3f37, 0xa61ff273,
+ 0x68b29622, 0x259cd337, 0x43ff84a6, 0x81cf8fe9, 0x566ed883, 0x48427fc6,
+ 0x35c79428, 0xcfd2fb59, 0xa97e8c8b, 0x750aaed8, 0x32ddca23, 0xaa8108ef,
+ 0x96fbfff9, 0xa1d039aa, 0xe3cdf588, 0x47e77e00, 0xcd6b3fdb, 0xe72a9a80,
+ 0x9a522152, 0xeda06283, 0xef175610, 0xa670cfa1, 0x339fe6c4, 0x2dfbf3ee,
+ 0xc2d7f53b, 0x92a44e27, 0xcc47e4b0, 0xdfa212bc, 0xd64f83c9, 0x997e5475,
+ 0xb51319bf, 0x9fffe599, 0x1fc2c7b6, 0xef5605e7, 0x832169dd, 0xfeb6be4e,
+ 0xbf921dc8, 0x60bdfb1d, 0x72759f8d, 0x3546efa0, 0x020eebed, 0xcaab3d64,
+ 0xdb20a2fe, 0xba1218f6, 0xb2b62bdd, 0x3101eff0, 0x8fde5cfa, 0x2e319213,
+ 0xa52114d2, 0x87eead3f, 0xdf08b1dd, 0xa5387642, 0x746f34d0, 0xd76c4844,
+ 0x4cc40317, 0xe4f689c9, 0xb7d76071, 0x5fe0b4a2, 0x6e1c7915, 0xc7d43f53,
+ 0x3efb7d71, 0x068dd906, 0x35a75f5f, 0x652d7770, 0x750f4607, 0x64a1656c,
+ 0x36c2cf8e, 0x214d758b, 0x9348ef93, 0xe4058978, 0x9674b7f3, 0x10570b0b,
+ 0xbdfaba8f, 0xcef09dd7, 0xa92b261f, 0x071c21b6, 0xcbebb81f, 0xf427ed6c,
+ 0x44228cd6, 0x65e56fcf, 0x5036c460, 0xad919def, 0xccfd848b, 0x61d158a6,
+ 0x7527dca3, 0x4cf30459, 0x50855075, 0xa70dfd09, 0x3540f5aa, 0x35577adb,
+ 0xb5ba3d4e, 0x35736c4f, 0xcdfb689f, 0xefe8fa82, 0x97ab0dca, 0x51bd2ff3,
+ 0x77a7fe9c, 0x3107846c, 0x3d618b81, 0xbca797a4, 0xfc5e9651, 0xe2e08fbc,
+ 0xf7e8791f, 0x772f1cc0, 0x7c426f9d, 0x08d56f88, 0x0080c3ab, 0x0deea663,
+ 0xe6d46ec6, 0x7dca4eb7, 0x6b681d9d, 0xda06730b, 0x4af0e0f2, 0x038bf468,
+ 0x52097463, 0xca19d302, 0xbc09bb9a, 0xaa55aeb1, 0x3ded4433, 0xf27938ba,
+ 0x3e4b7865, 0x28296be7, 0x7ef96314, 0x7a1d55cc, 0xdf0b6b47, 0xcde11852,
+ 0xcedda5bd, 0xf00a0eb3, 0x72ca1a8b, 0x5241b572, 0xb002fdcc, 0xff8898b3,
+ 0xc4878862, 0xb3e85372, 0xbf4bca29, 0x7e1fef45, 0xf2d83189, 0x0f5427af,
+ 0x3cdf9e05, 0x75bae885, 0xf65c06ac, 0x9c71a700, 0xa3145eac, 0xde63bab2,
+ 0x76255bbf, 0x6e817be6, 0x4c6ad3d0, 0x25ab9935, 0xe95ef2f8, 0x11cd095a,
+ 0xd54f78de, 0xa001ae7e, 0xb3829dcb, 0x5abd18bd, 0x18eb9c9e, 0xada3c504,
+ 0xe3e3556c, 0xd35479aa, 0x5191ac5f, 0x221821ac, 0xc8d1d9d3, 0x313a8c51,
+ 0x088c3fc8, 0xc146a264, 0xb154abed, 0x92755bc5, 0x349ec093, 0xf94aba57,
+ 0x41d5886c, 0x0a5ad8b2, 0x36aba94b, 0x883a6758, 0xa9ad229f, 0x5d64069a,
+ 0x0546172f, 0x0366da16, 0xc3808ea4, 0x0b172403, 0x70f0a235, 0xfa816e66,
+ 0x4fceb827, 0xa65fcfea, 0x167b56d5, 0xfe2b9fb2, 0xfec36bcd, 0xa84c4cc9,
+ 0xcd96320f, 0x3e128584, 0x09eda8b8, 0x91eca525, 0x7ec7e17b, 0xbc45bedc,
+ 0xc14032f4, 0x9be689a7, 0x2eb20bc0, 0xffdf1efc, 0x14ef835f, 0xc6966c59,
+ 0xcd778dd8, 0x5feb0f3b, 0x23d47715, 0xd64b87c8, 0x5722a550, 0x62883198,
+ 0x315a1a8b, 0x648e17e6, 0x4b7e9d7a, 0x2ba43d28, 0x67caca84, 0x741f0398,
+ 0x6e660159, 0x3e16e1a9, 0x3dde3c45, 0xa53e56ae, 0xc7eb0aef, 0x3f39f33e,
+ 0x78751d73, 0x45816df8, 0x626770f7, 0xcb17d28d, 0x909e87f4, 0x93a86aba,
+ 0xc1dcf328, 0x1a1e4ce2, 0xd895d042, 0xb9f6dd69, 0xbb00eaf5, 0xacc37687,
+ 0xca609578, 0x5b490d39, 0xf8b86d4c, 0xf2737ef0, 0x39419f6d, 0x69267bc0,
+ 0x72524a03, 0x6eb060c4, 0xdbc01e93, 0x291035b1, 0x83984d54, 0xf673ad85,
+ 0xe08cbc20, 0x1fb24915, 0x584803a6, 0xe15bbcd7, 0x4088ddb5, 0xd4c22542,
+ 0x2c18041a, 0xa51372d1, 0xb2ba69b4, 0x2299283f, 0xcd11c296, 0x25dcd6f3,
+ 0xac54df23, 0x24a3a55e, 0x77e16e1d, 0xb3cd415b, 0xb99d85c0, 0x497befc7,
+ 0xe91154e3, 0x7365cd8b, 0xb55100aa, 0x0ee699eb, 0xfc0927a6, 0xefb374de,
+ 0x8acaa910, 0x83b40e3d, 0xda3f0006, 0x8590a089, 0xc6ce1b75, 0x54f6ff20,
+ 0xfda2f7f3, 0xd2ab58f6, 0xd0763b6d, 0x6caf2515, 0x2519622d, 0xc3714057,
+ 0x9863638f, 0xea00bb4f, 0x09ea4a4d, 0xe69de96d, 0x6b01fe5f, 0x960161a5,
+ 0x529e32ec, 0xf8260ae9, 0x01a37eea, 0x69710577, 0x5aa0716f, 0xcb3fb1da,
+ 0x4260feda, 0xa33fb790, 0x76012f75, 0x24c0e5be, 0x130f09ae, 0x2e8323dc,
+ 0x5c8ecb76, 0x17cb8f12, 0x401b5f5c, 0x5f0a63e0, 0x47e1560a, 0xdc57a786,
+ 0xee1377d4, 0x228e7ee5, 0x0aa294b9, 0xaea6c534, 0x55b0fe2f, 0x922d318a,
+ 0xf108b772, 0xf15bddf6, 0xdfb69702, 0xcd438a4e, 0x90e1db66, 0x584ce4a1,
+ 0x568ef6cb, 0x69e55f9d, 0x6da376ba, 0x5ca6c109, 0x45c7e294, 0xc977b3e9,
+ 0xcf5b6c0c, 0x1d694499, 0x11b487ae, 0xcf8339ac, 0xbcb3cc6e, 0x50b828e0,
+ 0x046b1071, 0x5703ed0d, 0x2c615946, 0x720d1610, 0xa908dbd0, 0x742bbe33,
+ 0x22c076e2, 0x48966a66, 0x1d0cefa4, 0x1dde819f, 0x601352bf, 0xb9370c39,
+ 0xa585cc4a, 0xeb857f94, 0x5a2f7206, 0x3fae6b58, 0x49cd0f1f, 0x78e5fb3d,
+ 0x1b89d476, 0x74e9e65b, 0xed82945b, 0xb74e6483, 0x2941c4d9, 0x7e087acc,
+ 0x565c18dc, 0x1a09f2e5, 0xbf4ccd3d, 0xd304e977, 0xa522631d, 0x6123378e,
+ 0x4517109b, 0xb7e4285a, 0x4bf1a506, 0x625803c2, 0x683172f8, 0xc84e7354,
+ 0x3f8a2b11, 0x7dd12b89, 0xed420491, 0x8c698b0b, 0x9853fb97, 0x9631777b,
+ 0xb697e1c9, 0x5f028f05, 0x51038110, 0x9055f055, 0x30e255e3, 0xe2d0c1b6,
+ 0xb990321e, 0xa8fdf4d1, 0xff4dc144, 0x521a3056, 0x148999e0, 0xa8111c66,
+ 0xa9c96852, 0x8157f508, 0x4b394a94, 0xa0dc4df1, 0x94ec2e93, 0x6e6afa56,
+ 0x8fc28377, 0xf72ffa04, 0xc435186f, 0xf91488b7, 0x8d037f6f, 0xa899ec1e,
+ 0x48757727, 0x4101b612, 0xb8cf377d, 0xa5a54e68, 0xb4570569, 0x2ac5a0a0,
+ 0x063d9cfd, 0x7c504c74, 0xf1a5884c, 0x0a9b1955, 0x8d0b91bf, 0xe5f6862f,
+ 0x79ff5361, 0x0ed3d38f, 0xc6fd31fb, 0x9fe131c7, 0x85b9c648, 0x8febf2b4,
+ 0x8e77e86b, 0x992ba80e, 0x56429986, 0x6848879a, 0x608cdda5, 0x3e0d106e,
+ 0x754b300e, 0x25200576, 0xafd5195b, 0x5d37aad9, 0xe81f0939, 0xe00a390e,
+ 0xdeeea20a, 0xf5fef0be, 0xb5d51155, 0x6e27d173, 0x9e72ebcf, 0xb776e978,
+ 0xb966f7ba, 0x09520238, 0x726c8408, 0x3347ebc5, 0x65dce5a2, 0x3ec78337,
+ 0x8c92d740, 0x3cdde3fe, 0x32caec93, 0xd20379ae, 0x411be811, 0x41756580,
+ 0x72fa1bbd, 0xa92125b3, 0x84c42f04, 0xdd4ee5fe, 0x3a25922c, 0x96446853,
+ 0x49ad3be0, 0x2880366d, 0x1c841afe, 0xf1e09019, 0xfb905fe1, 0xa451ad59,
+ 0x3ba9d0c9, 0x56db2e9c, 0xa42419f2, 0xe921e7a0, 0x3c9a3ca5, 0xad8ea375,
+ 0xcec7d091, 0x99bdb940, 0x477ef58f, 0x8a4933c7, 0xb2598b8d, 0xf5659df7,
+ 0xcfac1e1c, 0x339f8748, 0xe2a04aab, 0xe122b03f, 0x45bc6f37, 0xc9feeb30,
+ 0x9c75aaa0, 0xc13c174e, 0x0ea0585d, 0xdc58bbb4, 0x3a96bd5a, 0x20251482,
+ 0x3c7a714d, 0x696897eb, 0x6cb83b6b, 0xa37de406, 0x3b496b5f, 0x37e75d6a,
+ 0x380dd382, 0x0e1a513c, 0xda26fac9, 0xf2458364, 0x12b5c6ea, 0x79ce9e47,
+ 0x1ff1fcbf, 0xbe7c6e86, 0x59a6a7ba, 0x8d70f515, 0x94761453, 0x6b04e425,
+ 0x8768ffb2, 0x1ca5f425, 0x3f9e8407, 0x3b641184, 0x5f8f6756, 0x62b1a5a5,
+ 0x56bc2120, 0xd1e5da68, 0x17f2fa18, 0x8cce5e2d, 0xa1bc9c06, 0x8e290fb1,
+ 0x892df1af, 0xad10b8c8, 0xb43e5517, 0xd0597409, 0x4407c38f, 0x4a020d81,
+ 0xfea9c9b6, 0xd8e0e7d6, 0xd5b2aaf9, 0xde5e9b40, 0xda44ed4a, 0x45d6bf41,
+ 0x87aa3ca0, 0xc62d12fc, 0x4708acc8, 0x10212e26, 0x0d1227ff, 0xfeeb5742,
+ 0x5da02550, 0xd66668e7, 0x1d56e5e1, 0x32c215ec, 0xae1e0bef, 0x7f048b7e,
+ 0x58c0e922, 0x2aea8619, 0x58251aac, 0xbbe10425, 0xa1fea536, 0x2e1d9667,
+ 0xd233eb7d, 0xcf435c0b, 0xb0693c67, 0x61d918ea, 0x903ec9f0, 0xd6c4e8ac,
+ 0x0efb1788, 0xb0098f5b, 0x1709d878, 0x3c12b35e, 0x3f6ce1b7, 0xa1b3ff54,
+ 0x8a8f7dbb, 0x37608d6a, 0x73e8563e, 0xa3330540, 0x64e00749, 0xebbfcab9,
+ 0x8d5caaf9, 0x3bc87c7e, 0xedb2bd94, 0x22f8f62d, 0xe656dec3, 0xc5683222,
+ 0x670c1626, 0x94089e7f, 0x4237542f, 0x47d29440, 0x2fc4e530, 0x8419441e,
+ 0x8b288dac, 0x7f9245f9, 0xa7afb4e9, 0x8a15650d, 0x082adef7, 0x3104ef19,
+ 0x043c62de, 0x0aff3dc5, 0x7ecd0635, 0xe7e80a8b, 0xe0600fad, 0x4d8e81cc,
+ 0x81ebf4e0, 0xf587e30f, 0x7b372af7, 0x2d8f8ca0, 0xdee11c6f, 0xd3624b1c,
+ 0xf8adc426, 0xca9debed, 0x5c22de4f, 0x3634f778, 0xfae3186b, 0xacf8b595,
+ 0xd7bfa75f, 0x003cd316, 0xbbfe3cf6, 0xb023cb50, 0xc51055a1, 0x0063cffd,
+ 0x93869a77, 0x51e022d4, 0xfbceeb10, 0x5187457e, 0x109defc9, 0x673892d8,
+ 0xe13cfde2, 0xd4aa3272, 0xc09c8134, 0xbf89ad5b, 0x0327181b, 0x09511ec7,
+ 0xaa21b632, 0xd7e72186, 0xe41885b5, 0x46713f9c, 0x493d2789, 0x1386c526,
+ 0xd5d22a5c, 0xcefddfc4, 0xcf59281c, 0x92973ea6, 0x4ebe43f6, 0xeac5c6ad,
+ 0x6cf4897d, 0xd95082a0, 0x82ce562a, 0x28e5e9bd, 0x28d8f0db, 0xddf06e81,
+ 0x707b0166, 0x7dae3f00, 0xfbf5756a, 0x035a4680, 0x4f114102, 0xe7ba4b33,
+ 0x5190fedf, 0x106a7594, 0xe5f1bc49, 0xaae3ad67, 0xd7a1a766, 0x040ee971,
+ 0x9120a214, 0xf415b374, 0x1edc87ea, 0x17aab43c, 0xc6ad637d, 0x885858c1,
+ 0xd90303c7, 0xbfd4b70b, 0x3ff4eb0e, 0x344a9a88, 0xd81eea30, 0x95925446,
+ 0x5adef0ec, 0xabb5f5e7, 0x20bbd8c3, 0xc1c22cce, 0xe6944262, 0xc5acdb23,
+ 0x80024021, 0x2232c635, 0x94b30c81, 0x55f07648, 0x78569acd, 0x9696ea39,
+ 0x4dd6b528, 0x1c3e1b40, 0xde5853b3, 0x8a2c3679, 0x6eb5a7d8, 0x56bda89a,
+ 0x8f9cf096, 0xfda86d5b, 0x6481c7e7, 0x50a6a7d5, 0x15bfb45d, 0x4f9a5381,
+ 0xc057d45d, 0x4fb10024, 0xa0009f00, 0x5e1ca0dd, 0xac420f74, 0xcfbb38bd,
+ 0xf0d4a615, 0x19bf0318, 0x0e3aef84, 0xcb3d7b20, 0x166c1e3e, 0x58272fdd,
+ 0x3bfacf9f, 0xc0f5ce46, 0x63a13528, 0xea59e333, 0xa020ca8c, 0xaadd116b,
+ 0x3dbb5a3d, 0xe5523f47, 0x747f55ea, 0x0922171e, 0x64d520fb, 0x6c709e84,
+ 0x07ce951b, 0x35fdc402, 0x7508eb6d, 0xc495a8fa, 0xb0d11c39, 0x81313d65,
+ 0x57447ef0, 0xa7b61e26, 0xf72301f3, 0xbb096315, 0x45a3a7c5, 0xa903a44b,
+ 0x00432f88, 0x19081987, 0xeb4e1b66, 0xbb7b66bd, 0x6d245171, 0xde4182f5,
+ 0x0d89bd0b, 0x87f4de6c, 0xf70d8a60, 0x9a87855b, 0x08a27449, 0x4ac7720a,
+ 0xd4964017, 0xb0d9ddac, 0x4db3488c, 0xfe397d44, 0xd07b745b, 0x197dcb7b,
+ 0x6e9d567d, 0xe3b90812, 0x9143fef1, 0xb9e002ac, 0x115ff96d, 0xf60a2201,
+ 0x5b61c9c8, 0x09abab2f, 0xb14a44a7, 0x0ca19c73, 0x843c7997, 0xe3a9bbe6,
+ 0x5e3fc18c, 0x0c0404ee, 0x764df59d, 0x990ec2c2, 0x4ad0ba3c, 0x05e8be0f,
+ 0xe599647d, 0xc19d365d, 0x4d0c2990, 0xe5a9d9ac, 0xb680a72d, 0x4ce2e5dd,
+ 0x6d6c0267, 0x06f9c25b, 0xbd6078e0, 0xb5fcdc81, 0xd742fa41, 0xcccc2399,
+ 0xc691adc0, 0x215ad82c, 0xea73b0c3, 0xa511e5b0, 0xf499e0a6, 0x53e27ab0,
+ 0xd94440a2, 0x47752521, 0x9a6e3644, 0xab113708, 0x8f8b301d, 0x058a42a3,
};
+#endif /* !__NO_LONG_DOUBLE_MATH */
#elif BITS_PER_MP_LIMB == 64
@@ -279,9 +711,9 @@ const mp_limb_t __tens[] =
0x26b2716ed595d80full, 0x1d153624adc666b0ull, 0x63ff540e3c42d35aull,
0x65f9ef17cc5573c0ull, 0x80dcc7f755bc28f2ull, 0x5fdcefcef46eeddcull,
0x00000000000553f7ull,
-#if FLT128_MAX_EXP > 1024
-# define TENS_P9_IDX (TENS_P8_IDX + TENS_P8_SIZE)
-# define TENS_P9_SIZE 28
+
+#define TENS_P9_IDX (TENS_P8_IDX + TENS_P8_SIZE)
+#define TENS_P9_SIZE 28
[TENS_P9_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
@@ -293,8 +725,8 @@ const mp_limb_t __tens[] =
0xb099bc817343afacull, 0xa269974845a71d46ull, 0x8a0b1f138cb07303ull,
0xc1d238d98cab8a97ull, 0x0000001c633415d4ull,
-# define TENS_P10_IDX (TENS_P9_IDX + TENS_P9_SIZE)
-# define TENS_P10_SIZE 55
+#define TENS_P10_IDX (TENS_P9_IDX + TENS_P9_SIZE)
+#define TENS_P10_SIZE 55
[TENS_P10_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
@@ -315,6 +747,7 @@ const mp_limb_t __tens[] =
0xd2db49ef47187094ull, 0xae6209d4926c3f5bull, 0x34f4a3c62d433949ull,
0xd9d61a05d4305d94ull, 0x0000000000000325ull,
+#if FLT128_MAX_EXP > 1024
# define TENS_P11_IDX (TENS_P10_IDX + TENS_P10_SIZE)
# define TENS_P11_SIZE 108
[TENS_P11_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
@@ -428,7 +861,441 @@ const mp_limb_t __tens[] =
0x35fcb457200c03a5ull, 0xf74eb9281bb6c6e4ull, 0x87cc1d213d5d0b54ull,
0x18ae42404964046full, 0x8bd2b496d868b275ull, 0xc234d8f51c5563f4ull,
0xf9151ffff868e970ull, 0x271133eeae7be4a2ull, 0x25254932bb0fd922ull,
- 0x104bcd64a60a9fc0ull, 0x0000006230290145ull
+ 0x104bcd64a60a9fc0ull, 0x0000006230290145ull,
+
+# define TENS_P13_IDX (TENS_P12_IDX + TENS_P12_SIZE)
+# define TENS_P13_SIZE 427
+ [TENS_P13_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x9f34522664cf8001ull, 0x7b8d5053644963e5ull,
+ 0xb945c82f49f0aa29ull, 0x933b6bb8430ff478ull, 0x64c501d45ff82d0aull,
+ 0x9ec1e1b373bbf174ull, 0xe90106893bfbe803ull, 0x3fef8d80f7390d8eull,
+ 0x2c73446bf31d1325ull, 0x1c19e379f5ca7a92ull, 0xf52d9d9c270af2beull,
+ 0x3abf72e1eb2bed48ull, 0x7ecf35084ac4ffc2ull, 0x38597a5a22019a82ull,
+ 0x9a51ff6ebe6a7b3cull, 0x0c0abe9da2d28437ull, 0xc79887ff7c9ec6eaull,
+ 0x436420d05851c899ull, 0x72b5547fefead581ull, 0x077ad8f899b1d2b5ull,
+ 0x3b4305ed5cddbf5bull, 0x2d88f3fde3861ac7ull, 0x393220aa3d6b43beull,
+ 0x1cd62095e5382405ull, 0x87a0d1e161a10c96ull, 0x68c933e6ca95a55dull,
+ 0x778089bb9ee082e2ull, 0xfbb6d8d441429ee9ull, 0x26cf5471c529500dull,
+ 0xd6c9b14068b9be29ull, 0x8415185207be635aull, 0x83730335b5572182ull,
+ 0xdd312d31eb2300b4ull, 0x488da59c05d6dd9bull, 0xda2c2e4037784d25ull,
+ 0x6a57d7206a8d92faull, 0xf07a8632950b41acull, 0x2ecad06acd55f062ull,
+ 0x34c98bb0e6a3dfe7ull, 0xb60521b19c767d8full, 0xe87d16be752aafd1ull,
+ 0xe58a8b0c9de1d728ull, 0x2fa2c119c6013830ull, 0x519b40c83c4f9156ull,
+ 0xab78701b5058fc8full, 0xc502a554adc59c47ull, 0x6647f04c0fb3286full,
+ 0x5ea495c89db4076eull, 0xb4f00f8b9c74fab1ull, 0xd092b4c6897c7a3cull,
+ 0x32f31fa8283e0340ull, 0x67b63de2eeb708ccull, 0xef2bc02b4f7b3c8bull,
+ 0xc49344c0da14bfe3ull, 0xb6c4e69eaabc85beull, 0x63a110162ece8aa6ull,
+ 0x726ae4d919cfba4dull, 0xee6ae7070fc90b42ull, 0x4d9aabc54290b04aull,
+ 0xf34906cdfb2b070eull, 0x52ca97091ff54b0aull, 0x164315700b42bfe1ull,
+ 0x6b5565bb980f3076ull, 0x9ce63c76eb8c4c4aull, 0x3da24c53b9e4c771ull,
+ 0xb50e3c666f0266faull, 0x01bb4b9676e34f79ull, 0x0fbea1249948cf3eull,
+ 0xa1fa4edc86bead12ull, 0xc3b97bf9d11e901cull, 0x370ca58e71730e03ull,
+ 0x886467e248b19715ull, 0x3c727e24db237497ull, 0x8e67d76e2116ccd2ull,
+ 0x34bdedd3f973aecfull, 0xb042ab0531d680ecull, 0xfc5c3c17770e96a0ull,
+ 0xb8204eceab6f1874ull, 0x416c0ced5843f3a5ull, 0x9578018311dd112full,
+ 0x7e0e8613b1c74bd8ull, 0xa79ffc1096c6453bull, 0xfcd6da0ab2157651ull,
+ 0x3dd0ccac836a34a7ull, 0x496049ed316e5a36ull, 0xdea1a97d0322bcb2ull,
+ 0x39578d53cdf2aa5aull, 0x030565c91d1aa931ull, 0x324e0a27d198cbedull,
+ 0x284325345db83e8aull, 0x5cb134c090bf23e8ull, 0x009e5051dd0adab6ull,
+ 0x7e36a6d7f8ad61daull, 0xbdffe6aa84c75e57ull, 0x138d680eb5d5532eull,
+ 0x4a5f74a1bd84ddacull, 0x55538cfaccff00d1ull, 0x48528011b0948b8cull,
+ 0x9e047ad7e345f82eull, 0xea77bef06ee770ffull, 0x2f1625670fc13669ull,
+ 0x0614686c869426acull, 0x4263ed823a3ff464ull, 0x57205a7ab3589b47ull,
+ 0xae6fc46b213f24adull, 0xd92b133f3de03e4eull, 0x1b49c24a315a589bull,
+ 0x1641c13873381bcbull, 0xbc680ada7bc99425ull, 0x962e9884a5cfbc9aull,
+ 0xfc8d12f60a960d70ull, 0x60acc868ed18ef4cull, 0x131130369aea5d14ull,
+ 0x2d99a5b0c747c87eull, 0x006b36583a369bb3ull, 0xe43fa6e6118a5135ull,
+ 0xa13dc05eb4947190ull, 0x0dbd7170d7733db8ull, 0x117ed7e7c3fb67d1ull,
+ 0xc05fe99ee2d72a49ull, 0xd971a25b9638db40ull, 0x1a1595594239d468ull,
+ 0xc1117392850a223cull, 0x567b5fc022d2dbd8ull, 0xc051007a92c5b4ebull,
+ 0xfb35572011cc0099ull, 0x398481616907810dull, 0x61d19ef25e8534f4ull,
+ 0x8a0ab03c2ee8c466ull, 0x879aa514c234af76ull, 0x59e5da579774a235ull,
+ 0xf339bd5a9bc466b3ull, 0xbbb5fd6744ab026dull, 0x3685c9f22b977202ull,
+ 0x7054359e03e5dc00ull, 0x9ba11f085239cfb0ull, 0x9c258687f8237562ull,
+ 0x52c7bf8fa3b510ddull, 0x3245e079b31ed0cfull, 0xbaee38c7ff9ff8d3ull,
+ 0xf702b3b9f17d5562ull, 0xcbca275dcc4c8563ull, 0xe817dbace005d9d1ull,
+ 0x62cee35005c6920aull, 0x19e049b90f1deac0ull, 0xb2a27a1659599f74ull,
+ 0x7dcef00df0911d5aull, 0x375522513603dd66ull, 0x5fa022da97813735ull,
+ 0xefbe57c20d849416ull, 0x5761929630a0e592ull, 0x11735043c953cc47ull,
+ 0xc0444be0a83526adull, 0x16ff5136b5f8463cull, 0xf037572c2a0a6631ull,
+ 0xb1bf8daad30464daull, 0x0f3e9e7e7f5718f7ull, 0xc26f2624e5a4cfe7ull,
+ 0xdfe8f4858c9b5ae4ull, 0xc64a1509f6fa82e3ull, 0x3024b220acb24aeaull,
+ 0xddcdfeddddb02ac0ull, 0x384c86c3d834c574ull, 0xdd48a571d904e099ull,
+ 0x77b35c744550a05full, 0xaaebdc6d81e85f71ull, 0xd4cdc0540f9bb0b1ull,
+ 0x845786af7af4df85ull, 0xdf2a91cae5e53887ull, 0x5689a3c4f6a58211ull,
+ 0xa705983a8cf6aa15ull, 0x2ce7fef09fbf2f52ull, 0x4a3b536548e84a62ull,
+ 0xd48a0872f8281a47ull, 0xf0929c3e8423dcf6ull, 0xe9ec071b044a5049ull,
+ 0x20e30c1b17decc36ull, 0x3342196a45fc2813ull, 0x6601e33746afb7f9ull,
+ 0xf18094d130754439ull, 0x61410dd1d38b4112ull, 0xd97d4dd8d8796b36ull,
+ 0x8080519147e9bc0bull, 0xcde438c11584e2daull, 0x409659a1955d24f1ull,
+ 0x5a09635f1b0950b1ull, 0x615472b965b1febeull, 0x6308e067525dc00aull,
+ 0xd4e705a44089e2d4ull, 0x32c18b2643fc9209ull, 0xaf2711534447a5faull,
+ 0x4dc4f0d23617cadcull, 0x6aa116ef692eb386ull, 0x0641dc0b655991bcull,
+ 0xc655966454469597ull, 0x4bdc0d1a749c0fe8ull, 0xc5292a61a7d3381eull,
+ 0x42474cc24eb65fdcull, 0x19dfc9eef2c6b173ull, 0xbece2ee30a19a199ull,
+ 0xaa03aa7cc68b778dull, 0xae54d2bec8db86f0ull, 0xdee3f48fb92a01e0ull,
+ 0xf6ae28526023c0a9ull, 0xa441cb9ea233763bull, 0x3a8bb4b73246ddddull,
+ 0x308ef2c844faa3c3ull, 0xd2862534fd1c8516ull, 0x62336f6f3b25ebe7ull,
+ 0x0b8e2ce60c336a45ull, 0x11eea1f2e867f171ull, 0x68df4903523972ecull,
+ 0x51ef4cb750c05824ull, 0x3ffae115cb4df2a8ull, 0x3ed1635fb51aca2full,
+ 0x0a5ac09fd6ff1cc6ull, 0x0a3dc76fde8ed9d6ull, 0x37991dde5dc2d8ddull,
+ 0x80ad6e13f95bacb2ull, 0xd4f8c7a6163005eeull, 0xa4760f083225d180ull,
+ 0x9b2b1a875fff004dull, 0x5cd00b66e7ea8576ull, 0x285dd80dec478452ull,
+ 0x4301b3a120112439ull, 0xfacbb68cff879fc8ull, 0xb17fdf84af6af6b8ull,
+ 0xf4489576c208d9f1ull, 0xadcc862c8794a6e9ull, 0x931685a40e83e54cull,
+ 0x1e40293bab01c580ull, 0x1f1ddf7fcad784faull, 0xcee722b26b856084ull,
+ 0x74254eb41c39938bull, 0xb9c26d9ac7ccebf4ull, 0x2e3ece246b08dfb9ull,
+ 0xdff60410981455ecull, 0xe06fa38bbc804e2bull, 0x72e53c52b534540cull,
+ 0xb2a5c05a02dfb2efull, 0x973133385002a2a5ull, 0xd61df455597c53ffull,
+ 0x39ac2ec534e5261aull, 0x388b7539c6bc0cabull, 0x00eac7043f732fc0ull,
+ 0xc089971e92fb21d9ull, 0x7af93f8fb4ffa503ull, 0xa8311b2372e353b6ull,
+ 0x1de496ca8266c9afull, 0xd6fa0b51dbdb16b0ull, 0xbd5630899991a5efull,
+ 0x0954a1e3168cbe0full, 0x53d09723537b9245ull, 0x86558cb92867272dull,
+ 0xfac85d100b83f026ull, 0x1e5ddb95f8562951ull, 0x48d27b92ad3668c8ull,
+ 0x19b58a99c930b7e6ull, 0xa9cda917a3de74e3ull, 0x7a4dd16ecb6e35eeull,
+ 0x4d84073f4c80e9d5ull, 0x9cffcfc074a95ba8ull, 0x15796372d28485ebull,
+ 0x77eda8df5717e9cdull, 0xadb965e1ab473c4eull, 0x5bc05659ffad6959ull,
+ 0xfb2402276ed63880ull, 0xd15fdddf2014850bull, 0xb538f37dfdd74592ull,
+ 0x1473396f3a8e2e82ull, 0x3ce41a21f6a5edf8ull, 0x754e82640cc4351aull,
+ 0xc7821b96aab95e73ull, 0xc242faaaf42ff463ull, 0x087e260edd00ac65ull,
+ 0x0dbe032817d193f5ull, 0xf9d10f96844a63c9ull, 0xbaf127ec85aa91ddull,
+ 0xce85e6a50ab6dabbull, 0xe7b56a161af5d24full, 0x57d1d79fcd6c5a19ull,
+ 0xec4dd2f05dfc2b28ull, 0x8d72216a18fe64a1ull, 0x72f14a085f222077ull,
+ 0x3bf038abd8b09b11ull, 0xc4265d7cc6cf1f44ull, 0x46398d2cdab1b0e7ull,
+ 0xb6e705d37dcfdc68ull, 0x362c11834aafd1e6ull, 0xf6ac98b7d8701107ull,
+ 0xd6649424ad114d7eull, 0xddd1c6e4c40ab551ull, 0xc9d284c8a132030full,
+ 0x824069eedb1f662aull, 0xc846b3ad4157904bull, 0x0a248c17d38481caull,
+ 0xe8745febc846831full, 0x00000000000025a8ull,
+
+# define TENS_P14_IDX (TENS_P13_IDX + TENS_P13_SIZE)
+# define TENS_P14_SIZE 852
+ [TENS_P14_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
+ 0x41b5687d099f0001ull, 0x8c75ee63cbfd1b6eull, 0xd75296ad4b191ceaull,
+ 0x1eb5da9b2394d80aull, 0x5c79fed918a004edull, 0xed67a1b837e3b01cull,
+ 0x2a1a34d578d9a714ull, 0x6b1d35168fbe7f0dull, 0xa7825681e57c43eaull,
+ 0xd3e716e1c81d32e8ull, 0xa6d93d6558860b00ull, 0x0113232f83159c97ull,
+ 0x7321c3a0d6122269ull, 0xca4ca9d3be6a92f3ull, 0xc0e55163d1e276a5ull,
+ 0x7b7a78c1b05915d6ull, 0x62a3df4b0fae0ca4ull, 0x13030d1108abec6full,
+ 0x60dcc8f2d446338aull, 0x25e1f9f65f05d1d5ull, 0x7f8c711304a40beeull,
+ 0x589ff59a88f47ec0ull, 0xea5068a1308c3661ull, 0x06e87dff95fb108full,
+ 0xd4d4abdc1559e741ull, 0xee16907c01e092e4ull, 0xe73aabcb5a7b78e6ull,
+ 0xad372889146bb7e0ull, 0xfd49fc1d4f6b43c5ull, 0xd37392530f29f589ull,
+ 0xe2acfcc2c4745a56ull, 0xedd016cdd75ccbc7ull, 0xef82ccd3ac5a63e0ull,
+ 0x2bdabfc4b352496eull, 0x01b0197f5b3d0401ull, 0x29d9253dade96d3cull,
+ 0x73c56b1b19bebdbaull, 0x1f2b7f1e255e7b25ull, 0x6299c836a56a457eull,
+ 0xa2ca74c65c63cc78ull, 0xee571bea5c85fe93ull, 0x2db5f1d0508e2561ull,
+ 0xa9b87b99b1fde6a9ull, 0xf7260f074fb90a37ull, 0x56ee7e97ff58c5fdull,
+ 0x42e6f9cebab9fa46ull, 0x1b76d26778816f73ull, 0x4566519cfdb2c728ull,
+ 0xb9f6a95fae17dd8dull, 0x67160dea1cd533a1ull, 0xfcd8f8f914534bacull,
+ 0x708b1f0af3f2901dull, 0x9457a1df8829063bull, 0x36bb93358f872aa1ull,
+ 0xd889d109b5672c0eull, 0x933066727ec63a6aull, 0x8239ab6839b6d457ull,
+ 0xbe0d7a1fef2e2506ull, 0x05f655224251b635ull, 0x032868910ef0bd55ull,
+ 0x9815fbac2c42b664ull, 0x814e379c471fd611ull, 0xa4a25bda7dd8349dull,
+ 0x01b9e39d9886b84cull, 0xae31cbc95a7ce1a2ull, 0x83ef8faf86d07f32ull,
+ 0x58470fdfb66b5b76ull, 0x5161888996d59b73ull, 0xfc8e0fc6dc400cf7ull,
+ 0x09a08e56af693670ull, 0x74f682e191737de6ull, 0x7f8ac56d0e03923full,
+ 0x8e05e49a7400cfd4ull, 0x384e11644cebea3cull, 0xb50ae05eb2e43d8cull,
+ 0xa40061230f0b3ed9ull, 0x4e9a193464137137ull, 0xd9621be605404100ull,
+ 0x5c347ebb9329a255ull, 0xe684346b75cbeb1bull, 0xba6a9753840fee55ull,
+ 0x60505b7bf43836f6ull, 0xfd6d475d334a9278ull, 0x267375aa5db94761ull,
+ 0x024f6d63c110e160ull, 0xa99b4c192ec96610ull, 0x338cfd90b915c9f4ull,
+ 0xb9e51a09f02ea846ull, 0xfae31d88ae928fb1ull, 0x8475dd261a3db721ull,
+ 0x7ad4c4075769489dull, 0x34e275c80a49e9f0ull, 0x1d63114a3d075d83ull,
+ 0x6b98e94772a96415ull, 0xd50fdc361d500b5full, 0x87751275141e5085ull,
+ 0x2278809ee7843834ull, 0x947aead2b15c52eeull, 0x5197b744fedb7b02ull,
+ 0x8849d0a664e09ba8ull, 0x11ecb91323beaa85ull, 0x5d9848480f7ed667ull,
+ 0x588290e99f6331eaull, 0x7e09e9e5a24d64d1ull, 0x03a501df32592033ull,
+ 0xbb3df73827c270a6ull, 0x4190833c3c7c5a70ull, 0x80e5d89b7d4bf9f4ull,
+ 0xfaefb663a7fc6194ull, 0xd3b6adcd62e52b49ull, 0x1f2cf73a809646fcull,
+ 0x531e4bfbb765ed4full, 0xaf12d1a692cd05f2ull, 0x38da107422ee30f3ull,
+ 0x1a725608ed6447bbull, 0x7a3c6f54aff222d3ull, 0x7b0e8d12bca79a56ull,
+ 0x6e34d6fb1c4660c5ull, 0xfe9dc99c6f481a9full, 0xd8489ea0f888db82ull,
+ 0xc0dea28184b4c0faull, 0xae30e887977a8583ull, 0x1d4848cb8c1cbcecull,
+ 0xd011b0fc0ee0d137ull, 0x478d7dd494b5fd49ull, 0xacab62ad3d67f2e7ull,
+ 0x1dfc7df50ab4e62aull, 0x870b0e75d22e4553ull, 0x1b73bf6d49b7b001ull,
+ 0xdc9f073712807ffdull, 0xc0e2f2506f3e5852ull, 0x4d96a55a93e62e4aull,
+ 0x83a126dbc1d0e185ull, 0xefbfd043190b917bull, 0x8f25b6ddc7df1669ull,
+ 0x476c17a62062eac9ull, 0x25460383cb60f278ull, 0xda8c05be0e85e996ull,
+ 0x692062346f678a34ull, 0x1947b69af59be929ull, 0x90fd83220ebfa11bull,
+ 0xd699b1ec15c1e9bfull, 0x7001d002b2f0343full, 0xc0778ab5cf76eaaaull,
+ 0xb7b008e25173eda8ull, 0x505d3f4d4e00e4c6ull, 0x1c9d4e1299dd341aull,
+ 0x474c5e954ffb6978ull, 0xda19f9386e9ca6ddull, 0x98dc318ee2dda6e0ull,
+ 0x3f67b836da455e54ull, 0xa97e9a6421e4181cull, 0x527a08bb1e17f655ull,
+ 0x682972ad1712dc21ull, 0xccbeadf10042d256ull, 0x861e99e0ca497b96ull,
+ 0xeeb0f6500d8aa585ull, 0x506af77edcc3c3daull, 0x7c9d60be5deb9768ull,
+ 0x37b37e95e9d978b7ull, 0x42747f7577ad0b94ull, 0x6d5fd2fe07be42c4ull,
+ 0x0d8fc27d4c8c5da9ull, 0x0ccf60230f2fd50full, 0x3b1101bd5b56053full,
+ 0xc0feca2756d34906ull, 0xc4888da47602a150ull, 0x56d10633419abe54ull,
+ 0x8db14123c76120edull, 0x741e8f76b656e675ull, 0x96be6f21d297b94eull,
+ 0x9b409e273662439dull, 0x35fff92a6626574dull, 0x69e02439bf558205ull,
+ 0x6400fd4cbe6838b7ull, 0x1f4b158aa00f64caull, 0x04cca5589e2052aeull,
+ 0x58da644cfb5ee69eull, 0x8ab1940196f26e1full, 0xed8bf908bee1e16bull,
+ 0xd50babab2f2809a4ull, 0x6b0a89296e57f7e6ull, 0xb54a4cfcf7356431ull,
+ 0x6f9fd6cb9a1d0ac4ull, 0x3b42f469836bfbf8ull, 0x40111b6b8bd32129ull,
+ 0xb345d9557c278fb1ull, 0xd32cd13cff1fd188ull, 0x3789f792f7ec3aa0ull,
+ 0x4d79a4bfab707fa4ull, 0xd9c24d8eb3a28cebull, 0x06e2eb3e7134dadcull,
+ 0xb379d811d7c04f76ull, 0x8c94fc332b3b0ebcull, 0xc06c5d01a28b53abull,
+ 0x7fea91cad900432aull, 0x64845f086d30b008ull, 0xfde4687d796f5349ull,
+ 0xe0046c56f888fe67ull, 0xce98cb11ae482177ull, 0x1feb440084590c46ull,
+ 0xff2f16116e1ba29bull, 0x3159ca8cf73f3e9cull, 0x56f0ed4634845918ull,
+ 0xd9a16a01b7d10c32ull, 0x3cee3e24405b9e91ull, 0x2ab396b48739e4a6ull,
+ 0x09835dfd3f1b7871ull, 0x1592b74a8c7a489full, 0x0e8d3f3705df7c81ull,
+ 0x68b29622a61ff273ull, 0x43ff84a6259cd337ull, 0x566ed88381cf8fe9ull,
+ 0x35c7942848427fc6ull, 0xa97e8c8bcfd2fb59ull, 0x32ddca23750aaed8ull,
+ 0x96fbfff9aa8108efull, 0xe3cdf588a1d039aaull, 0xcd6b3fdb47e77e00ull,
+ 0x9a522152e72a9a80ull, 0xef175610eda06283ull, 0x339fe6c4a670cfa1ull,
+ 0xc2d7f53b2dfbf3eeull, 0xcc47e4b092a44e27ull, 0xd64f83c9dfa212bcull,
+ 0xb51319bf997e5475ull, 0x1fc2c7b69fffe599ull, 0x832169ddef5605e7ull,
+ 0xbf921dc8feb6be4eull, 0x72759f8d60bdfb1dull, 0x020eebed3546efa0ull,
+ 0xdb20a2fecaab3d64ull, 0xb2b62bddba1218f6ull, 0x8fde5cfa3101eff0ull,
+ 0xa52114d22e319213ull, 0xdf08b1dd87eead3full, 0x746f34d0a5387642ull,
+ 0x4cc40317d76c4844ull, 0xb7d76071e4f689c9ull, 0x6e1c79155fe0b4a2ull,
+ 0x3efb7d71c7d43f53ull, 0x35a75f5f068dd906ull, 0x750f4607652d7770ull,
+ 0x36c2cf8e64a1656cull, 0x9348ef93214d758bull, 0x9674b7f3e4058978ull,
+ 0xbdfaba8f10570b0bull, 0xa92b261fcef09dd7ull, 0xcbebb81f071c21b6ull,
+ 0x44228cd6f427ed6cull, 0x5036c46065e56fcfull, 0xccfd848bad919defull,
+ 0x7527dca361d158a6ull, 0x508550754cf30459ull, 0x3540f5aaa70dfd09ull,
+ 0xb5ba3d4e35577adbull, 0xcdfb689f35736c4full, 0x97ab0dcaefe8fa82ull,
+ 0x77a7fe9c51bd2ff3ull, 0x3d618b813107846cull, 0xfc5e9651bca797a4ull,
+ 0xf7e8791fe2e08fbcull, 0x7c426f9d772f1cc0ull, 0x0080c3ab08d56f88ull,
+ 0xe6d46ec60deea663ull, 0x6b681d9d7dca4eb7ull, 0x4af0e0f2da06730bull,
+ 0x52097463038bf468ull, 0xbc09bb9aca19d302ull, 0x3ded4433aa55aeb1ull,
+ 0x3e4b7865f27938baull, 0x7ef9631428296be7ull, 0xdf0b6b477a1d55ccull,
+ 0xcedda5bdcde11852ull, 0x72ca1a8bf00a0eb3ull, 0xb002fdcc5241b572ull,
+ 0xc4878862ff8898b3ull, 0xbf4bca29b3e85372ull, 0xf2d831897e1fef45ull,
+ 0x3cdf9e050f5427afull, 0xf65c06ac75bae885ull, 0xa3145eac9c71a700ull,
+ 0x76255bbfde63bab2ull, 0x4c6ad3d06e817be6ull, 0xe95ef2f825ab9935ull,
+ 0xd54f78de11cd095aull, 0xb3829dcba001ae7eull, 0x18eb9c9e5abd18bdull,
+ 0xe3e3556cada3c504ull, 0x5191ac5fd35479aaull, 0xc8d1d9d3221821acull,
+ 0x088c3fc8313a8c51ull, 0xb154abedc146a264ull, 0x349ec09392755bc5ull,
+ 0x41d5886cf94aba57ull, 0x36aba94b0a5ad8b2ull, 0xa9ad229f883a6758ull,
+ 0x0546172f5d64069aull, 0xc3808ea40366da16ull, 0x70f0a2350b172403ull,
+ 0x4fceb827fa816e66ull, 0x167b56d5a65fcfeaull, 0xfec36bcdfe2b9fb2ull,
+ 0xcd96320fa84c4cc9ull, 0x09eda8b83e128584ull, 0x7ec7e17b91eca525ull,
+ 0xc14032f4bc45bedcull, 0x2eb20bc09be689a7ull, 0x14ef835fffdf1efcull,
+ 0xcd778dd8c6966c59ull, 0x23d477155feb0f3bull, 0x5722a550d64b87c8ull,
+ 0x315a1a8b62883198ull, 0x4b7e9d7a648e17e6ull, 0x67caca842ba43d28ull,
+ 0x6e660159741f0398ull, 0x3dde3c453e16e1a9ull, 0xc7eb0aefa53e56aeull,
+ 0x78751d733f39f33eull, 0x626770f745816df8ull, 0x909e87f4cb17d28dull,
+ 0xc1dcf32893a86abaull, 0xd895d0421a1e4ce2ull, 0xbb00eaf5b9f6dd69ull,
+ 0xca609578acc37687ull, 0xf8b86d4c5b490d39ull, 0x39419f6df2737ef0ull,
+ 0x72524a0369267bc0ull, 0xdbc01e936eb060c4ull, 0x83984d54291035b1ull,
+ 0xe08cbc20f673ad85ull, 0x584803a61fb24915ull, 0x4088ddb5e15bbcd7ull,
+ 0x2c18041ad4c22542ull, 0xb2ba69b4a51372d1ull, 0xcd11c2962299283full,
+ 0xac54df2325dcd6f3ull, 0x77e16e1d24a3a55eull, 0xb99d85c0b3cd415bull,
+ 0xe91154e3497befc7ull, 0xb55100aa7365cd8bull, 0xfc0927a60ee699ebull,
+ 0x8acaa910efb374deull, 0xda3f000683b40e3dull, 0xc6ce1b758590a089ull,
+ 0xfda2f7f354f6ff20ull, 0xd0763b6dd2ab58f6ull, 0x2519622d6caf2515ull,
+ 0x9863638fc3714057ull, 0x09ea4a4dea00bb4full, 0x6b01fe5fe69de96dull,
+ 0x529e32ec960161a5ull, 0x01a37eeaf8260ae9ull, 0x5aa0716f69710577ull,
+ 0x4260fedacb3fb1daull, 0x76012f75a33fb790ull, 0x130f09ae24c0e5beull,
+ 0x5c8ecb762e8323dcull, 0x401b5f5c17cb8f12ull, 0x47e1560a5f0a63e0ull,
+ 0xee1377d4dc57a786ull, 0x0aa294b9228e7ee5ull, 0x55b0fe2faea6c534ull,
+ 0xf108b772922d318aull, 0xdfb69702f15bddf6ull, 0x90e1db66cd438a4eull,
+ 0x568ef6cb584ce4a1ull, 0x6da376ba69e55f9dull, 0x45c7e2945ca6c109ull,
+ 0xcf5b6c0cc977b3e9ull, 0x11b487ae1d694499ull, 0xbcb3cc6ecf8339acull,
+ 0x046b107150b828e0ull, 0x2c6159465703ed0dull, 0xa908dbd0720d1610ull,
+ 0x22c076e2742bbe33ull, 0x1d0cefa448966a66ull, 0x601352bf1dde819full,
+ 0xa585cc4ab9370c39ull, 0x5a2f7206eb857f94ull, 0x49cd0f1f3fae6b58ull,
+ 0x1b89d47678e5fb3dull, 0xed82945b74e9e65bull, 0x2941c4d9b74e6483ull,
+ 0x565c18dc7e087accull, 0xbf4ccd3d1a09f2e5ull, 0xa522631dd304e977ull,
+ 0x4517109b6123378eull, 0x4bf1a506b7e4285aull, 0x683172f8625803c2ull,
+ 0x3f8a2b11c84e7354ull, 0xed4204917dd12b89ull, 0x9853fb978c698b0bull,
+ 0xb697e1c99631777bull, 0x510381105f028f05ull, 0x30e255e39055f055ull,
+ 0xb990321ee2d0c1b6ull, 0xff4dc144a8fdf4d1ull, 0x148999e0521a3056ull,
+ 0xa9c96852a8111c66ull, 0x4b394a948157f508ull, 0x94ec2e93a0dc4df1ull,
+ 0x8fc283776e6afa56ull, 0xc435186ff72ffa04ull, 0x8d037f6ff91488b7ull,
+ 0x48757727a899ec1eull, 0xb8cf377d4101b612ull, 0xb4570569a5a54e68ull,
+ 0x063d9cfd2ac5a0a0ull, 0xf1a5884c7c504c74ull, 0x8d0b91bf0a9b1955ull,
+ 0x79ff5361e5f6862full, 0xc6fd31fb0ed3d38full, 0x85b9c6489fe131c7ull,
+ 0x8e77e86b8febf2b4ull, 0x56429986992ba80eull, 0x608cdda56848879aull,
+ 0x754b300e3e0d106eull, 0xafd5195b25200576ull, 0xe81f09395d37aad9ull,
+ 0xdeeea20ae00a390eull, 0xb5d51155f5fef0beull, 0x9e72ebcf6e27d173ull,
+ 0xb966f7bab776e978ull, 0x726c840809520238ull, 0x65dce5a23347ebc5ull,
+ 0x8c92d7403ec78337ull, 0x32caec933cdde3feull, 0x411be811d20379aeull,
+ 0x72fa1bbd41756580ull, 0x84c42f04a92125b3ull, 0x3a25922cdd4ee5feull,
+ 0x49ad3be096446853ull, 0x1c841afe2880366dull, 0xfb905fe1f1e09019ull,
+ 0x3ba9d0c9a451ad59ull, 0xa42419f256db2e9cull, 0x3c9a3ca5e921e7a0ull,
+ 0xcec7d091ad8ea375ull, 0x477ef58f99bdb940ull, 0xb2598b8d8a4933c7ull,
+ 0xcfac1e1cf5659df7ull, 0xe2a04aab339f8748ull, 0x45bc6f37e122b03full,
+ 0x9c75aaa0c9feeb30ull, 0x0ea0585dc13c174eull, 0x3a96bd5adc58bbb4ull,
+ 0x3c7a714d20251482ull, 0x6cb83b6b696897ebull, 0x3b496b5fa37de406ull,
+ 0x380dd38237e75d6aull, 0xda26fac90e1a513cull, 0x12b5c6eaf2458364ull,
+ 0x1ff1fcbf79ce9e47ull, 0x59a6a7babe7c6e86ull, 0x947614538d70f515ull,
+ 0x8768ffb26b04e425ull, 0x3f9e84071ca5f425ull, 0x5f8f67563b641184ull,
+ 0x56bc212062b1a5a5ull, 0x17f2fa18d1e5da68ull, 0xa1bc9c068cce5e2dull,
+ 0x892df1af8e290fb1ull, 0xb43e5517ad10b8c8ull, 0x4407c38fd0597409ull,
+ 0xfea9c9b64a020d81ull, 0xd5b2aaf9d8e0e7d6ull, 0xda44ed4ade5e9b40ull,
+ 0x87aa3ca045d6bf41ull, 0x4708acc8c62d12fcull, 0x0d1227ff10212e26ull,
+ 0x5da02550feeb5742ull, 0x1d56e5e1d66668e7ull, 0xae1e0bef32c215ecull,
+ 0x58c0e9227f048b7eull, 0x58251aac2aea8619ull, 0xa1fea536bbe10425ull,
+ 0xd233eb7d2e1d9667ull, 0xb0693c67cf435c0bull, 0x903ec9f061d918eaull,
+ 0x0efb1788d6c4e8acull, 0x1709d878b0098f5bull, 0x3f6ce1b73c12b35eull,
+ 0x8a8f7dbba1b3ff54ull, 0x73e8563e37608d6aull, 0x64e00749a3330540ull,
+ 0x8d5caaf9ebbfcab9ull, 0xedb2bd943bc87c7eull, 0xe656dec322f8f62dull,
+ 0x670c1626c5683222ull, 0x4237542f94089e7full, 0x2fc4e53047d29440ull,
+ 0x8b288dac8419441eull, 0xa7afb4e97f9245f9ull, 0x082adef78a15650dull,
+ 0x043c62de3104ef19ull, 0x7ecd06350aff3dc5ull, 0xe0600fade7e80a8bull,
+ 0x81ebf4e04d8e81ccull, 0x7b372af7f587e30full, 0xdee11c6f2d8f8ca0ull,
+ 0xf8adc426d3624b1cull, 0x5c22de4fca9debedull, 0xfae3186b3634f778ull,
+ 0xd7bfa75facf8b595ull, 0xbbfe3cf6003cd316ull, 0xc51055a1b023cb50ull,
+ 0x93869a770063cffdull, 0xfbceeb1051e022d4ull, 0x109defc95187457eull,
+ 0xe13cfde2673892d8ull, 0xc09c8134d4aa3272ull, 0x0327181bbf89ad5bull,
+ 0xaa21b63209511ec7ull, 0xe41885b5d7e72186ull, 0x493d278946713f9cull,
+ 0xd5d22a5c1386c526ull, 0xcf59281ccefddfc4ull, 0x4ebe43f692973ea6ull,
+ 0x6cf4897deac5c6adull, 0x82ce562ad95082a0ull, 0x28d8f0db28e5e9bdull,
+ 0x707b0166ddf06e81ull, 0xfbf5756a7dae3f00ull, 0x4f114102035a4680ull,
+ 0x5190fedfe7ba4b33ull, 0xe5f1bc49106a7594ull, 0xd7a1a766aae3ad67ull,
+ 0x9120a214040ee971ull, 0x1edc87eaf415b374ull, 0xc6ad637d17aab43cull,
+ 0xd90303c7885858c1ull, 0x3ff4eb0ebfd4b70bull, 0xd81eea30344a9a88ull,
+ 0x5adef0ec95925446ull, 0x20bbd8c3abb5f5e7ull, 0xe6944262c1c22cceull,
+ 0x80024021c5acdb23ull, 0x94b30c812232c635ull, 0x78569acd55f07648ull,
+ 0x4dd6b5289696ea39ull, 0xde5853b31c3e1b40ull, 0x6eb5a7d88a2c3679ull,
+ 0x8f9cf09656bda89aull, 0x6481c7e7fda86d5bull, 0x15bfb45d50a6a7d5ull,
+ 0xc057d45d4f9a5381ull, 0xa0009f004fb10024ull, 0xac420f745e1ca0ddull,
+ 0xf0d4a615cfbb38bdull, 0x0e3aef8419bf0318ull, 0x166c1e3ecb3d7b20ull,
+ 0x3bfacf9f58272fddull, 0x63a13528c0f5ce46ull, 0xa020ca8cea59e333ull,
+ 0x3dbb5a3daadd116bull, 0x747f55eae5523f47ull, 0x64d520fb0922171eull,
+ 0x07ce951b6c709e84ull, 0x7508eb6d35fdc402ull, 0xb0d11c39c495a8faull,
+ 0x57447ef081313d65ull, 0xf72301f3a7b61e26ull, 0x45a3a7c5bb096315ull,
+ 0x00432f88a903a44bull, 0xeb4e1b6619081987ull, 0x6d245171bb7b66bdull,
+ 0x0d89bd0bde4182f5ull, 0xf70d8a6087f4de6cull, 0x08a274499a87855bull,
+ 0xd49640174ac7720aull, 0x4db3488cb0d9ddacull, 0xd07b745bfe397d44ull,
+ 0x6e9d567d197dcb7bull, 0x9143fef1e3b90812ull, 0x115ff96db9e002acull,
+ 0x5b61c9c8f60a2201ull, 0xb14a44a709abab2full, 0x843c79970ca19c73ull,
+ 0x5e3fc18ce3a9bbe6ull, 0x764df59d0c0404eeull, 0x4ad0ba3c990ec2c2ull,
+ 0xe599647d05e8be0full, 0x4d0c2990c19d365dull, 0xb680a72de5a9d9acull,
+ 0x6d6c02674ce2e5ddull, 0xbd6078e006f9c25bull, 0xd742fa41b5fcdc81ull,
+ 0xc691adc0cccc2399ull, 0xea73b0c3215ad82cull, 0xf499e0a6a511e5b0ull,
+ 0xd94440a253e27ab0ull, 0x9a6e364447752521ull, 0x8f8b301dab113708ull,
+ 0x00000000058a42a3ull,
#endif
};
@@ -439,7 +1306,7 @@ const mp_limb_t __tens[] =
/* Each of array variable above defines one mpn integer which is a power of 10.
This table points to those variables, indexed by the exponent. */
-const struct mp_power _fpioconst_pow10[FLT128_MAX_10_EXP_LOG + 1] =
+const struct mp_power _fpioconst_pow10[FPIOCONST_POW10_ARRAY_SIZE] =
{
{ TENS_P0_IDX, TENS_P0_SIZE, 4, },
{ TENS_P1_IDX, TENS_P1_SIZE, 7, 4 },
@@ -450,14 +1317,12 @@ const struct mp_power _fpioconst_pow10[FLT128_MAX_10_EXP_LOG + 1] =
{ TENS_P6_IDX, TENS_P6_SIZE, 213, 210 },
{ TENS_P7_IDX, TENS_P7_SIZE, 426, 422 },
{ TENS_P8_IDX, TENS_P8_SIZE, 851, 848 },
-#if FLT128_MAX_EXP > 1024
{ TENS_P9_IDX, TENS_P9_SIZE, 1701, 1698 },
{ TENS_P10_IDX, TENS_P10_SIZE, 3402, 3399 },
+#if FLT128_MAX_EXP > 1024
{ TENS_P11_IDX, TENS_P11_SIZE, 6804, 6800 },
- { TENS_P12_IDX, TENS_P12_SIZE, 13607, 13604 }
+ { TENS_P12_IDX, TENS_P12_SIZE, 13607, 13604 },
+ { TENS_P13_IDX, TENS_P13_SIZE, 27214, 27210 },
+ { TENS_P14_IDX, TENS_P14_SIZE, 54427, 54424 },
#endif
};
-
-#if LAST_POW10 > _LAST_POW10
-# error "Need to expand 10^(2^i) table for i up to" LAST_POW10
-#endif
diff --git a/libquadmath/printf/fpioconst.h b/libquadmath/printf/fpioconst.h
index 4187555470..7b7a40a27b 100644
--- a/libquadmath/printf/fpioconst.h
+++ b/libquadmath/printf/fpioconst.h
@@ -35,6 +35,14 @@
#define FLT128_MAX_10_EXP_LOG 12 /* = floor(log_2(FLT128_MAX_10_EXP)) */
+/* For strtoq, we need powers of 10 up to floor (log_2 (FLT128_MANT_DIG
+ - FLT128_MIN_EXP + 2)). */
+#if !defined __NO_LONG_DOUBLE_MATH && FLT128_MAX_EXP > 1024
+# define FPIOCONST_POW10_ARRAY_SIZE 15
+#else
+# define FPIOCONST_POW10_ARRAY_SIZE 11
+#endif
+
/* The array with the number representation. */
#define __tens __quadmath_tens
@@ -50,7 +58,7 @@ struct mp_power
int m_expo; /* Exponent of the number 10^-(2^i-1). */
};
#define _fpioconst_pow10 __quadmath_fpioconst_pow10
-extern const struct mp_power _fpioconst_pow10[FLT128_MAX_10_EXP_LOG + 1]
+extern const struct mp_power _fpioconst_pow10[FPIOCONST_POW10_ARRAY_SIZE]
attribute_hidden;
/* The constants in the array `_fpioconst_pow10' have an offset. */
diff --git a/libquadmath/printf/gmp-impl.h b/libquadmath/printf/gmp-impl.h
index 0f1419277d..969574c853 100644
--- a/libquadmath/printf/gmp-impl.h
+++ b/libquadmath/printf/gmp-impl.h
@@ -60,7 +60,7 @@ typedef unsigned int UHWtype;
#define attribute_hidden
#endif
-#include "../../libgcc/longlong.h"
+#include "longlong.h"
/* Copy NLIMBS *limbs* from SRC to DST. */
#define MPN_COPY_INCR(DST, SRC, NLIMBS) \
diff --git a/libquadmath/printf/printf_fp.c b/libquadmath/printf/printf_fp.c
index eb663726da..8effcee88f 100644
--- a/libquadmath/printf/printf_fp.c
+++ b/libquadmath/printf/printf_fp.c
@@ -1,5 +1,5 @@
/* Floating point output for `printf'.
- Copyright (C) 1995-2003, 2006-2008, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -15,16 +15,17 @@
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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <float.h>
+#include <limits.h>
#include <math.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdbool.h>
#define NDEBUG
#include <assert.h>
#ifdef HAVE_ERRNO_H
@@ -32,6 +33,9 @@
#endif
#include <stdio.h>
#include <stdarg.h>
+#ifdef HAVE_FENV_H
+#include "quadmath-rounding-mode.h"
+#endif
#include "quadmath-printf.h"
#include "fpioconst.h"
@@ -162,7 +166,8 @@ __quadmath_printf_fp (struct __quadmath_printf_file *fp,
MPN_VAR(tmp);
/* Digit which is result of last hack_digit() call. */
- wchar_t digit;
+ wchar_t last_digit, next_digit;
+ bool more_bits;
/* The type of output format that will be used: 'e'/'E' or 'f'. */
int type;
@@ -370,11 +375,11 @@ __quadmath_printf_fp (struct __quadmath_printf_file *fp,
special = "NAN";
wspecial = L_("NAN");
}
- else
- {
- special = "nan";
+ else
+ {
+ special = "nan";
wspecial = L_("nan");
- }
+ }
}
else if (isinfq (fpnum))
{
@@ -935,33 +940,32 @@ __quadmath_printf_fp (struct __quadmath_printf_file *fp,
}
/* Do rounding. */
- digit = hack_digit ();
- if (digit > L_('4'))
+ last_digit = wcp[-1] != decimalwc ? wcp[-1] : wcp[-2];
+ next_digit =hack_digit ();
+
+ if (next_digit != L_('0') && next_digit != L_('5'))
+ more_bits = true;
+ else if (fracsize == 1 && frac[0] == 0)
+ /* Rest of the number is zero. */
+ more_bits = false;
+ else if (scalesize == 0)
{
- wchar_t *wtp = wcp;
+ /* Here we have to see whether all limbs are zero since no
+ normalization happened. */
+ size_t lcnt = fracsize;
+ while (lcnt >= 1 && frac[lcnt - 1] == 0)
+ --lcnt;
+ more_bits = lcnt > 0;
+ }
+ else
+ more_bits = true;
- if (digit == L_('5')
- && ((*(wcp - 1) != decimalwc && (*(wcp - 1) & 1) == 0)
- || ((*(wcp - 1) == decimalwc && (*(wcp - 2) & 1) == 0))))
- {
- /* This is the critical case. */
- if (fracsize == 1 && frac[0] == 0)
- /* Rest of the number is zero -> round to even.
- (IEEE 754-1985 4.1 says this is the default rounding.) */
- goto do_expo;
- else if (scalesize == 0)
- {
- /* Here we have to see whether all limbs are zero since no
- normalization happened. */
- size_t lcnt = fracsize;
- while (lcnt >= 1 && frac[lcnt - 1] == 0)
- --lcnt;
- if (lcnt == 0)
- /* Rest of the number is zero -> round to even.
- (IEEE 754-1985 4.1 says this is the default rounding.) */
- goto do_expo;
- }
- }
+#ifdef HAVE_FENV_H
+ int rounding_mode = get_rounding_mode ();
+ if (round_away (is_neg, (last_digit - L_('0')) & 1, next_digit >= L_('5'),
+ more_bits, rounding_mode))
+ {
+ wchar_t *wtp = wcp;
if (fracdig_no > 0)
{
@@ -1055,8 +1059,8 @@ __quadmath_printf_fp (struct __quadmath_printf_file *fp,
}
}
}
+#endif
- do_expo:
/* Now remove unnecessary '0' at the end of the string. */
while (fracdig_no > fracdig_min + added_zeros && *(wcp - 1) == L_('0'))
{
@@ -1249,15 +1253,19 @@ guess_grouping (unsigned int intdig_max, const char *grouping)
++groups;
intdig_max -= *grouping++;
- if (*grouping == 0)
+ if (*grouping == CHAR_MAX
+#if CHAR_MIN < 0
+ || *grouping < 0
+#endif
+ )
+ /* No more grouping should be done. */
+ break;
+ else if (*grouping == 0)
{
/* Same grouping repeats. */
groups += (intdig_max - 1) / grouping[-1];
break;
}
- else if (*grouping == CHAR_MAX || *grouping <= 0)
- /* No more grouping should be done. */
- break;
}
return groups;
@@ -1289,12 +1297,16 @@ group_number (wchar_t *buf, wchar_t *bufend, unsigned int intdig_no,
while (--len > 0);
*p-- = thousands_sep;
- if (*grouping == 0)
- /* Same grouping repeats. */
- --grouping;
- else if (*grouping == CHAR_MAX || *grouping <= 0)
+ if (*grouping == CHAR_MAX
+#if CHAR_MIN < 0
+ || *grouping < 0
+#endif
+ )
/* No more grouping should be done. */
break;
+ else if (*grouping == 0)
+ /* Same grouping repeats. */
+ --grouping;
} while (intdig_no > (unsigned int) *grouping);
/* Copy the remaining ungrouped digits. */
diff --git a/libquadmath/printf/printf_fphex.c b/libquadmath/printf/printf_fphex.c
index 941e93307e..fc960f38eb 100644
--- a/libquadmath/printf/printf_fphex.c
+++ b/libquadmath/printf/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2002,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -14,17 +14,18 @@
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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <stdbool.h>
#define NDEBUG
#include <assert.h>
+#include "quadmath-rounding-mode.h"
#include "quadmath-printf.h"
#include "_itoa.h"
#include "_itowa.h"
@@ -116,6 +117,8 @@ __quadmath_printf_fphex (struct __quadmath_printf_file *fp,
/* Nonzero if this is output on a wide character stream. */
int wide = info->wide;
+ bool do_round_away;
+
/* Figure out the decimal point character. */
#ifdef USE_NL_LANGINFO
if (info->extra == 0)
@@ -274,8 +277,8 @@ __quadmath_printf_fphex (struct __quadmath_printf_file *fp,
/* Fill with zeroes. */
while (numstr > numbuf + (sizeof numbuf - 112 / 4))
{
- *--numstr = '0';
*--wnumstr = L_('0');
+ *--numstr = '0';
}
leading = fpnum.ieee.exponent == 0 ? '0' : '1';
@@ -316,21 +319,35 @@ __quadmath_printf_fphex (struct __quadmath_printf_file *fp,
--numend;
}
+ do_round_away = false;
+
+ if (precision != -1 && precision < numend - numstr)
+ {
+ char last_digit = precision > 0 ? numstr[precision - 1] : leading;
+ char next_digit = numstr[precision];
+ int last_digit_value = (last_digit >= 'A' && last_digit <= 'F'
+ ? last_digit - 'A' + 10
+ : (last_digit >= 'a' && last_digit <= 'f'
+ ? last_digit - 'a' + 10
+ : last_digit - '0'));
+ int next_digit_value = (next_digit >= 'A' && next_digit <= 'F'
+ ? next_digit - 'A' + 10
+ : (next_digit >= 'a' && next_digit <= 'f'
+ ? next_digit - 'a' + 10
+ : next_digit - '0'));
+ bool more_bits = ((next_digit_value & 7) != 0
+ || precision + 1 < numend - numstr);
+#ifdef HAVE_FENV_H
+ int rounding_mode = get_rounding_mode ();
+ do_round_away = round_away (negative, last_digit_value & 1,
+ next_digit_value >= 8, more_bits,
+ rounding_mode);
+#endif
+ }
+
if (precision == -1)
precision = numend - numstr;
- else if (precision < numend - numstr
- && (numstr[precision] > '8'
- || (('A' < '0' || 'a' < '0')
- && numstr[precision] < '0')
- || (numstr[precision] == '8'
- && (precision + 1 < numend - numstr
- /* Round to even. */
- || (precision > 0
- && ((numstr[precision - 1] & 1)
- ^ (isdigit (numstr[precision - 1]) == 0)))
- || (precision == 0
- && ((leading & 1)
- ^ (isdigit (leading) == 0)))))))
+ else if (do_round_away)
{
/* Round up. */
int cnt = precision;
diff --git a/libquadmath/quadmath-imp.h b/libquadmath/quadmath-imp.h
index bac714d1c8..40b346b6ff 100644
--- a/libquadmath/quadmath-imp.h
+++ b/libquadmath/quadmath-imp.h
@@ -27,12 +27,26 @@ Boston, MA 02110-1301, USA. */
#include "config.h"
+/* Under IEEE 754, an architecture may determine tininess of
+ floating-point results either "before rounding" or "after
+ rounding", but must do so in the same way for all operations
+ returning binary results. Define TININESS_AFTER_ROUNDING to 1 for
+ "after rounding" architectures, 0 for "before rounding"
+ architectures. */
+
+#define TININESS_AFTER_ROUNDING 1
+
+
/* Prototypes for internal functions. */
extern int32_t __quadmath_rem_pio2q (__float128, __float128 *);
extern void __quadmath_kernel_sincosq (__float128, __float128, __float128 *,
__float128 *, int);
extern __float128 __quadmath_kernel_sinq (__float128, __float128, int);
extern __float128 __quadmath_kernel_cosq (__float128, __float128);
+extern __float128 __quadmath_x2y2m1q (__float128 x, __float128 y);
+extern int __quadmath_isinf_nsq (__float128 x);
+
+
diff --git a/libquadmath/quadmath-rounding-mode.h b/libquadmath/quadmath-rounding-mode.h
new file mode 100644
index 0000000000..a806794835
--- /dev/null
+++ b/libquadmath/quadmath-rounding-mode.h
@@ -0,0 +1,74 @@
+/* GCC Quad-Precision Math Library
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of the libquadmath library.
+Libquadmath is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libquadmath 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libquadmath; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+
+#ifndef QUADMATH_ROUNDING_MODE_H
+#define QUADMATH_ROUNDING_MODE_H
+
+#include <stdbool.h>
+
+
+#if defined(HAVE_FENV_H)
+# include <fenv.h>
+#endif /* HAVE_FENV_H */
+
+static inline int
+get_rounding_mode (void)
+{
+#if defined(HAVE_FENV_H) && (defined(FE_DOWNWARD) || defined(FE_TONEAREST) \
+ || defined(FE_TOWARDZERO) || defined(FE_UPWARD))
+ return fegetround ();
+#else
+ return 0;
+#endif
+}
+
+static inline bool
+round_away (bool negative, bool last_digit_odd, bool half_bit, bool more_bits,
+ int mode)
+{
+ switch (mode)
+ {
+#ifdef FE_DOWNWARD
+ case FE_DOWNWARD:
+ return negative && (half_bit || more_bits);
+#endif
+
+#ifdef FE_DOWNWARD
+ case FE_TONEAREST:
+ return half_bit && (last_digit_odd || more_bits);
+#endif
+
+#ifdef FE_TOWARDZERO
+ case FE_TOWARDZERO:
+ return false;
+#endif
+
+
+#ifdef FE_UPWARD
+ case FE_UPWARD:
+ return !negative && (half_bit || more_bits);
+#endif
+
+ default:
+ return false;
+ }
+}
+
+#endif /* QUADMATH_ROUNDING_MODE_H */
diff --git a/libquadmath/quadmath.h b/libquadmath/quadmath.h
index 863fe440b2..aa9ef51b39 100644
--- a/libquadmath/quadmath.h
+++ b/libquadmath/quadmath.h
@@ -23,6 +23,10 @@ Boston, MA 02110-1301, USA. */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Define the complex type corresponding to __float128
("_Complex __float128" is not allowed) */
typedef _Complex float __attribute__((mode(TC))) __complex128;
@@ -189,4 +193,8 @@ __quadmath_nth (conjq (__complex128 __z))
return __extension__ ~__z;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libquadmath/strtod/strtod_l.c b/libquadmath/strtod/strtod_l.c
index a3df5e2bae..0b0e85a3cf 100644
--- a/libquadmath/strtod/strtod_l.c
+++ b/libquadmath/strtod/strtod_l.c
@@ -1,6 +1,5 @@
/* Convert string representing a number to float value, using given locale.
- Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009,2010
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -15,13 +14,14 @@
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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdarg.h>
#include <string.h>
+#include <stdint.h>
+#include <stdbool.h>
#include <float.h>
#include <math.h>
#define NDEBUG 1
@@ -29,10 +29,17 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+
+#ifdef HAVE_FENV_H
+#include <fenv.h>
+#endif
+
+#ifdef HAVE_FENV_H
+#include "quadmath-rounding-mode.h"
+#endif
#include "../printf/quadmath-printf.h"
#include "../printf/fpioconst.h"
-
#undef L_
#ifdef USE_WIDE_CHAR
# define STRING_TYPE wchar_t
@@ -89,6 +96,8 @@ __quadmath_strncasecmp_c (const char *s1, const char *s2, size_t n)
#define MIN_EXP PASTE(FLT,_MIN_EXP)
#define MAX_10_EXP PASTE(FLT,_MAX_10_EXP)
#define MIN_10_EXP PASTE(FLT,_MIN_10_EXP)
+#define MAX_VALUE PASTE(FLT,_MAX)
+#define MIN_VALUE PASTE(FLT,_MIN)
/* Extra macros required to get FLT expanded before the pasting. */
#define PASTE(a,b) PASTE1(a,b)
@@ -125,33 +134,62 @@ extern const mp_limb_t _tens_in_limb[MAX_DIG_PER_LIMB + 1] attribute_hidden;
do { if (endptr != NULL) *endptr = (STRING_TYPE *) (end); \
return val; } while (0)
-/* Maximum size necessary for mpn integers to hold floating point numbers. */
-#define MPNSIZE (howmany (MAX_EXP + 2 * MANT_DIG, BITS_PER_MP_LIMB) \
- + 2)
+/* Maximum size necessary for mpn integers to hold floating point
+ numbers. The largest number we need to hold is 10^n where 2^-n is
+ 1/4 ulp of the smallest representable value (that is, n = MANT_DIG
+ - MIN_EXP + 2). Approximate using 10^3 < 2^10. */
+#define MPNSIZE (howmany (1 + ((MANT_DIG - MIN_EXP + 2) * 10) / 3, \
+ BITS_PER_MP_LIMB) + 2)
/* Declare an mpn integer variable that big. */
#define MPN_VAR(name) mp_limb_t name[MPNSIZE]; mp_size_t name##size
/* Copy an mpn integer value. */
#define MPN_ASSIGN(dst, src) \
memcpy (dst, src, (dst##size = src##size) * sizeof (mp_limb_t))
+/* Set errno and return an overflowing value with sign specified by
+ NEGATIVE. */
+static FLOAT
+overflow_value (int negative)
+{
+#if defined HAVE_ERRNO_H && defined ERANGE
+ errno = ERANGE;
+#endif
+ FLOAT result = (negative ? -MAX_VALUE : MAX_VALUE) * MAX_VALUE;
+ return result;
+}
+
+/* Set errno and return an underflowing value with sign specified by
+ NEGATIVE. */
+static FLOAT
+underflow_value (int negative)
+{
+#if defined HAVE_ERRNO_H && defined ERANGE
+ errno = ERANGE;
+#endif
+ FLOAT result = (negative ? -MIN_VALUE : MIN_VALUE) * MIN_VALUE;
+ return result;
+}
/* Return a floating point number of the needed type according to the given
multi-precision number after possible rounding. */
static FLOAT
-round_and_return (mp_limb_t *retval, int exponent, int negative,
+round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
mp_limb_t round_limb, mp_size_t round_bit, int more_bits)
{
+#ifdef HAVE_FENV_H
+ int mode = get_rounding_mode ();
+#endif
+
if (exponent < MIN_EXP - 1)
{
- mp_size_t shift = MIN_EXP - 1 - exponent;
+ mp_size_t shift;
+ bool is_tiny;
- if (shift > MANT_DIG)
- {
-#if defined HAVE_ERRNO_H && defined EDOM
- errno = EDOM;
-#endif
- return 0.0;
- }
+ if (exponent < MIN_EXP - 1 - MANT_DIG)
+ return underflow_value (negative);
+
+ shift = MIN_EXP - 1 - exponent;
+ is_tiny = true;
more_bits |= (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0;
if (shift == MANT_DIG)
@@ -185,6 +223,35 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
}
else if (shift > 0)
{
+#ifdef HAVE_FENV_H
+ if (TININESS_AFTER_ROUNDING && shift == 1)
+ {
+ /* Whether the result counts as tiny depends on whether,
+ after rounding to the normal precision, it still has
+ a subnormal exponent. */
+ mp_limb_t retval_normal[RETURN_LIMB_SIZE];
+ if (round_away (negative,
+ (retval[0] & 1) != 0,
+ (round_limb
+ & (((mp_limb_t) 1) << round_bit)) != 0,
+ (more_bits
+ || ((round_limb
+ & ((((mp_limb_t) 1) << round_bit) - 1))
+ != 0)),
+ mode))
+ {
+ mp_limb_t cy = mpn_add_1 (retval_normal, retval,
+ RETURN_LIMB_SIZE, 1);
+
+ if (((MANT_DIG % BITS_PER_MP_LIMB) == 0 && cy) ||
+ ((MANT_DIG % BITS_PER_MP_LIMB) != 0 &&
+ ((retval_normal[RETURN_LIMB_SIZE - 1]
+ & (((mp_limb_t) 1) << (MANT_DIG % BITS_PER_MP_LIMB)))
+ != 0)))
+ is_tiny = false;
+ }
+ }
+#endif
round_limb = retval[0];
round_bit = shift - 1;
(void) mpn_rshift (retval, retval, RETURN_LIMB_SIZE, shift);
@@ -196,14 +263,29 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
# define DENORM_EXP (MIN_EXP - 2)
#endif
exponent = DENORM_EXP;
+ if (is_tiny
+ && ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
+ || more_bits
+ || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0))
+ {
#if defined HAVE_ERRNO_H && defined ERANGE
- errno = ERANGE;
+ errno = ERANGE;
#endif
+ volatile FLOAT force_underflow_exception = MIN_VALUE * MIN_VALUE;
+ (void) force_underflow_exception;
+ }
}
- if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
- && (more_bits || (retval[0] & 1) != 0
- || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0))
+ if (exponent > MAX_EXP)
+ goto overflow;
+
+#ifdef HAVE_FENV_H
+ if (round_away (negative,
+ (retval[0] & 1) != 0,
+ (round_limb & (((mp_limb_t) 1) << round_bit)) != 0,
+ (more_bits
+ || (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0),
+ mode))
{
mp_limb_t cy = mpn_add_1 (retval, retval, RETURN_LIMB_SIZE, 1);
@@ -224,9 +306,11 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
/* The number was denormalized but now normalized. */
exponent = MIN_EXP - 1;
}
+#endif
if (exponent > MAX_EXP)
- return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
+ overflow:
+ return overflow_value (negative);
return MPN2FLOAT (retval, exponent, negative);
}
@@ -239,7 +323,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
factor for the resulting number (see code) multiply by it. */
static const STRING_TYPE *
str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
- int *exponent
+ intmax_t *exponent
#ifndef USE_WIDE_CHAR
, const char *decimal, size_t decimal_len, const char *thousands
#endif
@@ -269,6 +353,7 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
cy += mpn_add_1 (n, n, *nsize, low);
if (cy != 0)
{
+ assert (*nsize < MPNSIZE);
n[*nsize] = cy;
++(*nsize);
}
@@ -303,7 +388,7 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
}
while (--digcnt > 0);
- if (*exponent > 0 && cnt + *exponent <= MAX_DIG_PER_LIMB)
+ if (*exponent > 0 && *exponent <= MAX_DIG_PER_LIMB - cnt)
{
low *= _tens_in_limb[*exponent];
start = _tens_in_limb[cnt + *exponent];
@@ -323,7 +408,10 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
cy = mpn_mul_1 (n, n, *nsize, start);
cy += mpn_add_1 (n, n, *nsize, low);
if (cy != 0)
- n[(*nsize)++] = cy;
+ {
+ assert (*nsize < MPNSIZE);
+ n[(*nsize)++] = cy;
+ }
}
return str;
@@ -333,28 +421,30 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
/* Shift {PTR, SIZE} COUNT bits to the left, and fill the vacated bits
with the COUNT most significant bits of LIMB.
- Tege doesn't like this function so I have to write it here myself. :)
+ Implemented as a macro, so that __builtin_constant_p works even at -O0.
+
+ Tege doesn't like this macro so I have to write it here myself. :)
--drepper */
-static inline void
-__attribute ((always_inline))
-mpn_lshift_1 (mp_limb_t *ptr, mp_size_t size, unsigned int count,
- mp_limb_t limb)
-{
- if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB)
- {
- /* Optimize the case of shifting by exactly a word:
- just copy words, with no actual bit-shifting. */
- mp_size_t i;
- for (i = size - 1; i > 0; --i)
- ptr[i] = ptr[i - 1];
- ptr[0] = limb;
- }
- else
- {
- (void) mpn_lshift (ptr, ptr, size, count);
- ptr[0] |= limb >> (BITS_PER_MP_LIMB - count);
- }
-}
+#define mpn_lshift_1(ptr, size, count, limb) \
+ do \
+ { \
+ mp_limb_t *__ptr = (ptr); \
+ if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB) \
+ { \
+ mp_size_t i; \
+ for (i = (size) - 1; i > 0; --i) \
+ __ptr[i] = __ptr[i - 1]; \
+ __ptr[0] = (limb); \
+ } \
+ else \
+ { \
+ /* We assume count > 0 && count < BITS_PER_MP_LIMB here. */ \
+ unsigned int __count = (count); \
+ (void) mpn_lshift (__ptr, __ptr, size, __count); \
+ __ptr[0] |= (limb) >> (BITS_PER_MP_LIMB - __count); \
+ } \
+ } \
+ while (0)
#define INTERNAL(x) INTERNAL1(x)
@@ -380,7 +470,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
{
int negative; /* The sign of the number. */
MPN_VAR (num); /* MP representation of the number. */
- int exponent; /* Exponent of the number. */
+ intmax_t exponent; /* Exponent of the number. */
/* Numbers starting `0X' or `0x' have to be processed with base 16. */
int base = 10;
@@ -402,10 +492,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
/* Points at the character following the integer and fractional digits. */
const STRING_TYPE *expp;
/* Total number of digit and number of digits in integer part. */
- int dig_no, int_no, lead_zero;
+ size_t dig_no, int_no, lead_zero;
/* Contains the last character read. */
CHAR_TYPE c;
+/* We should get wint_t from <stddef.h>, but not all GCC versions define it
+ there. So define it ourselves if it remains undefined. */
+#ifndef _WINT_T
+ typedef unsigned int wint_t;
+#endif
/* The radix character of the current locale. */
#ifdef USE_WIDE_CHAR
wchar_t decimal;
@@ -758,7 +853,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
are all or any is really a fractional digit will be decided
later. */
int_no = dig_no;
- lead_zero = int_no == 0 ? -1 : 0;
+ lead_zero = int_no == 0 ? (size_t) -1 : 0;
/* Read the fractional digits. A special case are the 'american
style' numbers like `16.' i.e. with decimal point but without
@@ -780,12 +875,13 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
(base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
lo >= L_('a') && lo <= L_('f'); })))
{
- if (c != L_('0') && lead_zero == -1)
+ if (c != L_('0') && lead_zero == (size_t) -1)
lead_zero = dig_no - int_no;
++dig_no;
c = *++cp;
}
}
+ assert (dig_no <= (uintmax_t) INTMAX_MAX);
/* Remember start of exponent (if any). */
expp = cp;
@@ -808,24 +904,80 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
if (c >= L_('0') && c <= L_('9'))
{
- int exp_limit;
+ intmax_t exp_limit;
/* Get the exponent limit. */
if (base == 16)
- exp_limit = (exp_negative ?
- -MIN_EXP + MANT_DIG + 4 * int_no :
- MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
+ {
+ if (exp_negative)
+ {
+ assert (int_no <= (uintmax_t) (INTMAX_MAX
+ + MIN_EXP - MANT_DIG) / 4);
+ exp_limit = -MIN_EXP + MANT_DIG + 4 * (intmax_t) int_no;
+ }
+ else
+ {
+ if (int_no)
+ {
+ assert (lead_zero == 0
+ && int_no <= (uintmax_t) INTMAX_MAX / 4);
+ exp_limit = MAX_EXP - 4 * (intmax_t) int_no + 3;
+ }
+ else if (lead_zero == (size_t) -1)
+ {
+ /* The number is zero and this limit is
+ arbitrary. */
+ exp_limit = MAX_EXP + 3;
+ }
+ else
+ {
+ assert (lead_zero
+ <= (uintmax_t) (INTMAX_MAX - MAX_EXP - 3) / 4);
+ exp_limit = (MAX_EXP
+ + 4 * (intmax_t) lead_zero
+ + 3);
+ }
+ }
+ }
else
- exp_limit = (exp_negative ?
- -MIN_10_EXP + MANT_DIG + int_no :
- MAX_10_EXP - int_no + lead_zero + 1);
+ {
+ if (exp_negative)
+ {
+ assert (int_no
+ <= (uintmax_t) (INTMAX_MAX + MIN_10_EXP - MANT_DIG));
+ exp_limit = -MIN_10_EXP + MANT_DIG + (intmax_t) int_no;
+ }
+ else
+ {
+ if (int_no)
+ {
+ assert (lead_zero == 0
+ && int_no <= (uintmax_t) INTMAX_MAX);
+ exp_limit = MAX_10_EXP - (intmax_t) int_no + 1;
+ }
+ else if (lead_zero == (size_t) -1)
+ {
+ /* The number is zero and this limit is
+ arbitrary. */
+ exp_limit = MAX_10_EXP + 1;
+ }
+ else
+ {
+ assert (lead_zero
+ <= (uintmax_t) (INTMAX_MAX - MAX_10_EXP - 1));
+ exp_limit = MAX_10_EXP + (intmax_t) lead_zero + 1;
+ }
+ }
+ }
+
+ if (exp_limit < 0)
+ exp_limit = 0;
do
{
- exponent *= 10;
- exponent += c - L_('0');
-
- if (__builtin_expect (exponent > exp_limit, 0))
+ if (__builtin_expect ((exponent > exp_limit / 10
+ || (exponent == exp_limit / 10
+ && c - L_('0') > exp_limit % 10)), 0))
/* The exponent is too large/small to represent a valid
number. */
{
@@ -834,7 +986,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
/* We have to take care for special situation: a joker
might have written "0.0e100000" which is in fact
zero. */
- if (lead_zero == -1)
+ if (lead_zero == (size_t) -1)
result = negative ? -0.0 : 0.0;
else
{
@@ -855,6 +1007,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
/* NOTREACHED */
}
+ exponent *= 10;
+ exponent += c - L_('0');
+
c = *++cp;
}
while (c >= L_('0') && c <= L_('9'));
@@ -923,7 +1078,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
}
#endif
startp += lead_zero + decimal_len;
- exponent -= base == 16 ? 4 * lead_zero : lead_zero;
+ assert (lead_zero <= (base == 16
+ ? (uintmax_t) INTMAX_MAX / 4
+ : (uintmax_t) INTMAX_MAX));
+ assert (lead_zero <= (base == 16
+ ? ((uintmax_t) exponent
+ - (uintmax_t) INTMAX_MIN) / 4
+ : ((uintmax_t) exponent - (uintmax_t) INTMAX_MIN)));
+ exponent -= base == 16 ? 4 * (intmax_t) lead_zero : (intmax_t) lead_zero;
dig_no -= lead_zero;
}
@@ -965,7 +1127,10 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
}
/* Adjust the exponent for the bits we are shifting in. */
- exponent += bits - 1 + (int_no - 1) * 4;
+ assert (int_no <= (uintmax_t) (exponent < 0
+ ? (INTMAX_MAX - bits + 1) / 4
+ : (INTMAX_MAX - exponent - bits + 1) / 4));
+ exponent += bits - 1 + ((intmax_t) int_no - 1) * 4;
while (--dig_no > 0 && idx >= 0)
{
@@ -986,8 +1151,20 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
retval[idx--] |= val >> (4 - pos - 1);
val <<= BITS_PER_MP_LIMB - (4 - pos - 1);
if (idx < 0)
- return round_and_return (retval, exponent, negative, val,
- BITS_PER_MP_LIMB - 1, dig_no > 0);
+ {
+ int rest_nonzero = 0;
+ while (--dig_no > 0)
+ {
+ if (*startp != L_('0'))
+ {
+ rest_nonzero = 1;
+ break;
+ }
+ startp++;
+ }
+ return round_and_return (retval, exponent, negative, val,
+ BITS_PER_MP_LIMB - 1, rest_nonzero);
+ }
retval[idx] = val;
pos = BITS_PER_MP_LIMB - 1 - (4 - pos - 1);
@@ -1005,27 +1182,19 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
really integer digits or belong to the fractional part; i.e. we normalize
123e-2 to 1.23. */
{
- register int incr = (exponent < 0 ? MAX (-int_no, exponent)
- : MIN (dig_no - int_no, exponent));
+ register intmax_t incr = (exponent < 0
+ ? MAX (-(intmax_t) int_no, exponent)
+ : MIN ((intmax_t) dig_no - (intmax_t) int_no,
+ exponent));
int_no += incr;
exponent -= incr;
}
- if (__builtin_expect (int_no + exponent > MAX_10_EXP + 1, 0))
- {
-#if defined HAVE_ERRNO_H && defined ERANGE
- errno = ERANGE;
-#endif
- return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
- }
+ if (__builtin_expect (exponent > MAX_10_EXP + 1 - (intmax_t) int_no, 0))
+ return overflow_value (negative);
if (__builtin_expect (exponent < MIN_10_EXP - (DIG + 1), 0))
- {
-#if defined HAVE_ERRNO_H && defined ERANGE
- errno = ERANGE;
-#endif
- return negative ? -0.0 : 0.0;
- }
+ return underflow_value (negative);
if (int_no > 0)
{
@@ -1086,12 +1255,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
/* Now we know the exponent of the number in base two.
Check it against the maximum possible exponent. */
if (__builtin_expect (bits > MAX_EXP, 0))
- {
-#if defined HAVE_ERRNO_H && defined ERANGE
- errno = ERANGE;
-#endif
- return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
- }
+ return overflow_value (negative);
/* We have already the first BITS bits of the result. Together with
the information whether more non-zero bits follow this is enough
@@ -1188,29 +1352,66 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
int expbit;
int neg_exp;
int more_bits;
+ int need_frac_digits;
mp_limb_t cy;
mp_limb_t *psrc = den;
mp_limb_t *pdest = num;
const struct mp_power *ttab = &_fpioconst_pow10[0];
- assert (dig_no > int_no && exponent <= 0);
+ assert (dig_no > int_no
+ && exponent <= 0
+ && exponent >= MIN_10_EXP - (DIG + 1));
+
+ /* We need to compute MANT_DIG - BITS fractional bits that lie
+ within the mantissa of the result, the following bit for
+ rounding, and to know whether any subsequent bit is 0.
+ Computing a bit with value 2^-n means looking at n digits after
+ the decimal point. */
+ if (bits > 0)
+ {
+ /* The bits required are those immediately after the point. */
+ assert (int_no > 0 && exponent == 0);
+ need_frac_digits = 1 + MANT_DIG - bits;
+ }
+ else
+ {
+ /* The number is in the form .123eEXPONENT. */
+ assert (int_no == 0 && *startp != L_('0'));
+ /* The number is at least 10^(EXPONENT-1), and 10^3 <
+ 2^10. */
+ int neg_exp_2 = ((1 - exponent) * 10) / 3 + 1;
+ /* The number is at least 2^-NEG_EXP_2. We need up to
+ MANT_DIG bits following that bit. */
+ need_frac_digits = neg_exp_2 + MANT_DIG;
+ /* However, we never need bits beyond 1/4 ulp of the smallest
+ representable value. (That 1/4 ulp bit is only needed to
+ determine tinyness on machines where tinyness is determined
+ after rounding.) */
+ if (need_frac_digits > MANT_DIG - MIN_EXP + 2)
+ need_frac_digits = MANT_DIG - MIN_EXP + 2;
+ /* At this point, NEED_FRAC_DIGITS is the total number of
+ digits needed after the point, but some of those may be
+ leading 0s. */
+ need_frac_digits += exponent;
+ /* Any cases underflowing enough that none of the fractional
+ digits are needed should have been caught earlier (such
+ cases are on the order of 10^-n or smaller where 2^-n is
+ the least subnormal). */
+ assert (need_frac_digits > 0);
+ }
+ if (need_frac_digits > (intmax_t) dig_no - (intmax_t) int_no)
+ need_frac_digits = (intmax_t) dig_no - (intmax_t) int_no;
- /* For the fractional part we need not process too many digits. One
- decimal digits gives us log_2(10) ~ 3.32 bits. If we now compute
- ceil(BITS / 3) =: N
- digits we should have enough bits for the result. The remaining
- decimal digits give us the information that more bits are following.
- This can be used while rounding. (Two added as a safety margin.) */
- if (dig_no - int_no > (MANT_DIG - bits + 2) / 3 + 2)
+ if ((intmax_t) dig_no > (intmax_t) int_no + need_frac_digits)
{
- dig_no = int_no + (MANT_DIG - bits + 2) / 3 + 2;
+ dig_no = int_no + need_frac_digits;
more_bits = 1;
}
else
more_bits = 0;
- neg_exp = dig_no - int_no - exponent;
+ neg_exp = (intmax_t) dig_no - (intmax_t) int_no - exponent;
/* Construct the denominator. */
densize = 0;
@@ -1510,6 +1711,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
assert (numsize == densize);
for (i = numsize; i > 0; --i)
num[i] = num[i - 1];
+ num[0] = 0;
}
den[densize] = 0;
@@ -1554,6 +1756,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group)
n0 = num[densize] = num[densize - 1];
for (i = densize - 1; i > 0; --i)
num[i] = num[i - 1];
+ num[0] = 0;
got_limb;
}