summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2017-09-26 09:01:56 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-24 03:14:30 -0300
commite121cea29ef9da649959dcfcfd6e42b212b04136 (patch)
tree56231c03d772ba0cd91ec0bba5b100e7637e22f6
parentb8bedcfda33a0e7fab7a9fc796a47021422aa2b9 (diff)
downloadFreeBSD-src-e121cea29ef9da649959dcfcfd6e42b212b04136.zip
FreeBSD-src-e121cea29ef9da649959dcfcfd6e42b212b04136.tar.gz
Synchronize most of libm with head as of r323004. This excludes a few
arch-specific updates for powerpcspe, mips and riscv, for which support has not been merged yet. Bump __FreeBSD_version for the addition of cacoshl, cacosl, casinhl, casinl, catanl, catanhl, sincos, sincosf, and sincosl. MFC r305382 (by bde): Add asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm versions of fmodf() amd fmodl() on i387. fmod is similar to remainder, and the C versions are 3 to 9 times slower than the asm versions on x86 for both, but we had the strange mixture of all 6 variants of remainder in asm and only 1 of 6 variants of fmod in asm. MFC r305384 (by bde): Disconnect the "optimized" asm variants of cos(), sin() and tan() from the build on i386. Leave them in the source tree for regression tests. The asm functions were always much less accurate (by a factor of more than 10**18 in the worst case). They were faster on old CPUs. But with each new generation of CPUs they get relatively slower. The double precision C version's average advantage is about a factor of 2 on Haswell. The asm functions were already intentionally avoided in float and long double precision on i386 and in all precisions on amd64. Float precision and amd64 give larger advantages to the C version. The long double precision C code and compilers' understanding of long double precision are not so good, so the i387 is still slightly faster for long double precision, except for the unimportant subcase of huge args where the sub-optimal C code now somehow beats the i387 by about a factor of 2. MFC r305385 (by bde): Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was actually the amd64 version. MFC r306409 (by emaste): libm: fix some unused variable (rcsid) and dangling else warnings s_{fabs,fmax,logb,scalb}{,f,l}.c may be built elsewhere with a higher WARNS setting. Reviewed by: ed Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8061 MFC r306410 (by emaste): libm: simplify i387 subdir logic with make's :S substitution MFC r306527 (by emaste): libm: remove unused variables for LDBL_MANT_DIG != 113 Sponsored by: The FreeBSD Foundation MFC r306709 (by emaste): libm: remove unused variables Sponsored by: The FreeBSD Foundation MFC r307066 (by br): Don't use fmaxl/fminl on platforms with no long double support, use fmax/fmin instead. This fixes fmaxmin test failure on MIPS64. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8216 MFC r308172 (by emaste): libm: add braces around initialization of subobjects This cleans up a warning when building libm at higher WARNS levels and makes the intent more clear. By the C standard the values are assigned to subobject members in order so this change introduces no functional change. (6.7.9 20) Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8333 MFC r313761 (by mmokhi): Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun to improve C11 conformance. PR: 216850 216851 216852 216856 216857 216858 Submitted by: mmokhi Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde, mat, theraven Approved by: bde (src committer), mat (mentor) Differential Revision: https://reviews.freebsd.org/D9491 MFC r313863 (by mmokhi): Fix building of r313761 on platforms that `long double` is alias of `double` (MIPS, etc) PR: 216850 216851 216852 216856 216857 216858 Reported by: emsate Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 MFC r313864 (by mmokhi): Add documentations related to new APIs of r313761 PR: 216850 216851 216852 216856 216857 216858 Submitted by: sgk@troutmask.apl.washington.edu Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 MFC r314950 (by ngie): Don't expect :test_large_inputs to fail with i386 anymore Recent changes (maybe a side-effect of the ATF-ification in r314649) invalidate the failure expectation. PR: 205446 Sponsored by: Dell EMC Isilon MFC r317349 (by pfg): msun: Remove trailing space in Sunsoft copyright statement. Submittedby: kargl MFC r319047 (by mmel): Implement sincos, sincosf, and sincosl. The primary benefit of these functions is that argument reduction is done once instead of twice in independent calls to sin() and cos(). * lib/msun/Makefile: . Add s_sincos[fl].c to the build. . Add sincos.3 documentation. . Add appropriate MLINKS. * lib/msun/Symbol.map: . Expose sincos[fl] symbols in dynamic libm.so. * lib/msun/man/sincos.3: . Documentation for sincos[fl]. * lib/msun/src/k_sincos.h: . Kernel for sincos() function. This merges the individual kernels for sin() and cos(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/k_sincosf.h: . Kernel for sincosf() function. This merges the individual kernels for sinf() and cosf(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/k_sincosl.h: . Kernel for sincosl() function. This merges the individual kernels for sinl() and cosl(). The merger offered an opportunity to re-arrange the individual kernels for better performance. * lib/msun/src/math.h: . Add prototytpes for sincos[fl](). * lib/msun/src/math_private.h: . Add RETURNV macros. This is needed to reset fpsetprec on I386 hardware for a function with type void. * lib/msun/src/s_sincos.c: . Implementation of sincos() where sin() and cos() were merged into one routine and possibly re-arranged for better performance. * lib/msun/src/s_sincosf.c: . Implementation of sincosf() where sinf() and cosf() were merged into one routine and possibly re-arranged for better performance. * lib/msun/src/s_sincosl.c: . Implementation of sincosl() where sinl() and cosl() were merged into one routine and possibly re-arranged for better performance. PR: 215977, 218300 Submitted by: Steven G. Kargl <sgk@troutmask.apl.washington.edu> Differential Revision: https://reviews.freebsd.org/D10765 MFC r321457 (by ngie): Mark :reduction as an expected failure It fails with clang 5.0+. PR: 220989 Reported by: Jenkins MFC r322418 (by rlibby): lib/msun: avoid referring to broken LDBL_MAX LDBL_MAX is broken on i386: https://lists.freebsd.org/pipermail/freebsd-numerics/2012-September/000288.html Gcc has produced +Infinity for LDBL_MAX on i386 and amd64 with -m32 for some time, and newer versions of gcc are now warning that the "floating constant exceeds range of 'long double'". Avoid this by referring to half the value of LDBL_MAX instead. Reviewed by: bde Approved by: markj (mentor) Sponsored by: Dell EMC Isilon MFC r322435 (by rlibby): Revert r322418, LDBL_MAX_EXP unsuitable for macro pasting on some arches Either need a different way to spell HALF_LDBL_MAX, or a different way to spell LDBL_MAX_EXP, or a different approach. Reported by: ian MFC r322921 (by ngie): Revert r321457 It doesn't fail after ^/head@r322855 (the releng_50 clang merge). PR: 220989 (cherry picked from commit 68896d08c13fabea18690d4c5369de8a5e24ba82)
-rw-r--r--lib/msun/Makefile36
-rw-r--r--lib/msun/Symbol.map13
-rw-r--r--lib/msun/amd64/Makefile.inc3
-rw-r--r--lib/msun/amd64/e_fmod.S54
-rw-r--r--lib/msun/amd64/e_fmodf.S24
-rw-r--r--lib/msun/amd64/e_fmodl.S50
-rw-r--r--lib/msun/i387/Makefile.inc9
-rw-r--r--lib/msun/i387/e_fmodf.S20
-rw-r--r--lib/msun/i387/e_fmodl.S50
-rw-r--r--lib/msun/ld80/e_lgammal_r.c2
-rw-r--r--lib/msun/ld80/k_expl.h256
-rw-r--r--lib/msun/ld80/s_logl.c516
-rw-r--r--lib/msun/man/cacos.346
-rw-r--r--lib/msun/man/sincos.382
-rw-r--r--lib/msun/src/catrig.c9
-rw-r--r--lib/msun/src/catrigl.c417
-rw-r--r--lib/msun/src/e_asin.c2
-rw-r--r--lib/msun/src/e_coshl.c2
-rw-r--r--lib/msun/src/e_lgammaf_r.c2
-rw-r--r--lib/msun/src/e_sinhl.c5
-rw-r--r--lib/msun/src/k_sincos.h52
-rw-r--r--lib/msun/src/k_sincosf.h43
-rw-r--r--lib/msun/src/k_sincosl.h134
-rw-r--r--lib/msun/src/math.h3
-rw-r--r--lib/msun/src/math_private.h14
-rw-r--r--lib/msun/src/s_fabs.c5
-rw-r--r--lib/msun/src/s_fmax.c5
-rw-r--r--lib/msun/src/s_fmin.c5
-rw-r--r--lib/msun/src/s_logbl.c5
-rw-r--r--lib/msun/src/s_scalbn.c12
-rw-r--r--lib/msun/src/s_scalbnf.c11
-rw-r--r--lib/msun/src/s_scalbnl.c12
-rw-r--r--lib/msun/src/s_sincos.c80
-rw-r--r--lib/msun/src/s_sincosf.c126
-rw-r--r--lib/msun/src/s_sincosl.c105
-rw-r--r--lib/msun/src/s_tanhl.c2
-rw-r--r--lib/msun/tests/ctrig_test.c4
37 files changed, 1768 insertions, 448 deletions
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 820855c..99ab57e 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -13,11 +13,7 @@
#
PACKAGE= clibs
-.if ${MACHINE_CPUARCH} == "i386"
-ARCH_SUBDIR= i387
-.else
-ARCH_SUBDIR= ${MACHINE_CPUARCH}
-.endif
+ARCH_SUBDIR= ${MACHINE_CPUARCH:S/i386/i387/}
.include "${ARCH_SUBDIR}/Makefile.inc"
@@ -67,8 +63,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \
s_finite.c s_finitef.c \
s_floor.c s_floorf.c s_fma.c s_fmaf.c \
- s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c \
- s_fminf.c s_fminl.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \
+ s_fmax.c s_fmaxf.c s_fmin.c \
+ s_fminf.c s_frexp.c s_frexpf.c s_ilogb.c s_ilogbf.c \
s_ilogbl.c s_isfinite.c s_isnan.c s_isnormal.c \
s_llrint.c s_llrintf.c s_llround.c s_llroundf.c s_llroundl.c \
s_log1p.c s_log1pf.c s_logb.c s_logbf.c s_lrint.c s_lrintf.c \
@@ -77,7 +73,8 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
s_nexttowardf.c s_remquo.c s_remquof.c \
s_rint.c s_rintf.c s_round.c s_roundf.c \
s_scalbln.c s_scalbn.c s_scalbnf.c s_signbit.c \
- s_signgam.c s_significand.c s_significandf.c s_sin.c s_sinf.c \
+ s_signgam.c s_significand.c s_significandf.c s_sin.c \
+ s_sincos.c s_sincosf.c s_sinf.c \
s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \
w_cabs.c w_cabsf.c w_drem.c w_dremf.c
@@ -98,16 +95,18 @@ SYMBOL_MAPS= ${SYM_MAPS}
COMMON_SRCS+= s_copysignl.c s_fabsl.c s_llrintl.c s_lrintl.c s_modfl.c
.if ${LDBL_PREC} != 53
# If long double != double use these; otherwise, we alias the double versions.
-COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \
+COMMON_SRCS+= catrigl.c \
+ e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \
e_coshl.c e_fmodl.c e_hypotl.c \
e_lgammal.c e_lgammal_r.c \
e_remainderl.c e_sinhl.c e_sqrtl.c \
invtrig.c k_cosl.c k_sinl.c k_tanl.c \
s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \
s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \
- s_frexpl.c s_logbl.c s_logl.c s_nanl.c s_nextafterl.c \
- s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c s_scalbnl.c \
- s_sinl.c s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c
+ s_fmaxl.c s_fminl.c s_frexpl.c s_logbl.c s_logl.c s_nanl.c \
+ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \
+ s_scalbnl.c s_sinl.c s_sincosl.c \
+ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c
.endif
# C99 complex functions
@@ -140,7 +139,8 @@ MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \
fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \
lgamma.3 log.3 lrint.3 lround.3 math.3 nan.3 \
nextafter.3 remainder.3 rint.3 \
- round.3 scalbn.3 signbit.3 sin.3 sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \
+ round.3 scalbn.3 signbit.3 sin.3 sincos.3 \
+ sinh.3 sqrt.3 tan.3 tanh.3 trunc.3 \
complex.3
MLINKS+=acos.3 acosf.3 acos.3 acosl.3
@@ -151,9 +151,12 @@ MLINKS+=atan.3 atanf.3 atan.3 atanl.3
MLINKS+=atanh.3 atanhf.3 atanh.3 atanhl.3
MLINKS+=atan2.3 atan2f.3 atan2.3 atan2l.3 \
atan2.3 carg.3 atan2.3 cargf.3 atan2.3 cargl.3
-MLINKS+=cacos.3 cacosf.3 cacos.3 cacosh.3 cacos.3 cacoshf.3 \
- cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinh.3 cacos.3 casinhf.3 \
- cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanh.3 cacos.3 catanhf.3
+MLINKS+=cacos.3 cacosf.3 cacos.3 cacosl.3 \
+ cacos.3 cacosh.3 cacos.3 cacoshf.3 cacos.3 cacoshl.3 \
+ cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinl.3 \
+ cacos.3 casinh.3 cacos.3 casinhf.3 cacos.3 casinhl.3 \
+ cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanl.3 \
+ cacos.3 catanh.3 cacos.3 catanhf.3 cacos.3 catanhl.3
MLINKS+=ccos.3 ccosf.3 ccos.3 csin.3 ccos.3 csinf.3 ccos.3 ctan.3 ccos.3 ctanf.3
MLINKS+=ccosh.3 ccoshf.3 ccosh.3 csinh.3 ccosh.3 csinhf.3 \
ccosh.3 ctanh.3 ccosh.3 ctanhf.3
@@ -215,6 +218,7 @@ MLINKS+=round.3 roundf.3 round.3 roundl.3
MLINKS+=scalbn.3 scalbln.3 scalbn.3 scalblnf.3 scalbn.3 scalblnl.3
MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3
MLINKS+=sin.3 sinf.3 sin.3 sinl.3
+MLINKS+=sincos.3 sincosf.3 sin.3 sincosl.3
MLINKS+=sinh.3 sinhf.3 sinh.3 sinhl.3
MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 cbrtl.3 sqrt.3 sqrtf.3 \
sqrt.3 sqrtl.3
diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map
index d5b7f46..f7d9e03 100644
--- a/lib/msun/Symbol.map
+++ b/lib/msun/Symbol.map
@@ -285,3 +285,16 @@ FBSD_1.3 {
FBSD_1.4 {
lgammal_r;
};
+
+/* First added in 12.0-CURRENT */
+FBSD_1.5 {
+ cacoshl;
+ cacosl;
+ casinhl;
+ casinl;
+ catanl;
+ catanhl;
+ sincos;
+ sincosf;
+ sincosl;
+};
diff --git a/lib/msun/amd64/Makefile.inc b/lib/msun/amd64/Makefile.inc
index 6ad2276..02264c4 100644
--- a/lib/msun/amd64/Makefile.inc
+++ b/lib/msun/amd64/Makefile.inc
@@ -1,6 +1,7 @@
# $FreeBSD$
-ARCH_SRCS = e_remainder.S e_remainderf.S e_remainderl.S \
+ARCH_SRCS = e_fmod.S e_fmodf.S e_fmodl.S \
+ e_remainder.S e_remainderf.S e_remainderl.S \
e_sqrt.S e_sqrtf.S e_sqrtl.S \
s_llrint.S s_llrintf.S s_llrintl.S \
s_logbl.S s_lrint.S s_lrintf.S s_lrintl.S \
diff --git a/lib/msun/amd64/e_fmod.S b/lib/msun/amd64/e_fmod.S
new file mode 100644
index 0000000..6163134
--- /dev/null
+++ b/lib/msun/amd64/e_fmod.S
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1993,94 Winning Strategies, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Winning Strategies, Inc.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Based on the i387 version written by:
+ * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$")
+
+ENTRY(fmod)
+ movsd %xmm0,-8(%rsp)
+ movsd %xmm1,-16(%rsp)
+ fldl -16(%rsp)
+ fldl -8(%rsp)
+1: fprem
+ fstsw %ax
+ testw $0x400,%ax
+ jne 1b
+ fstpl -8(%rsp)
+ movsd -8(%rsp),%xmm0
+ fstp %st
+ ret
+END(fmod)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/msun/amd64/e_fmodf.S b/lib/msun/amd64/e_fmodf.S
new file mode 100644
index 0000000..4b52040
--- /dev/null
+++ b/lib/msun/amd64/e_fmodf.S
@@ -0,0 +1,24 @@
+/*
+ * Based on the i387 version written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$")
+
+ENTRY(fmodf)
+ movss %xmm0,-4(%rsp)
+ movss %xmm1,-8(%rsp)
+ flds -8(%rsp)
+ flds -4(%rsp)
+1: fprem
+ fstsw %ax
+ testw $0x400,%ax
+ jne 1b
+ fstps -4(%rsp)
+ movss -4(%rsp),%xmm0
+ fstp %st
+ ret
+END(fmodf)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/msun/amd64/e_fmodl.S b/lib/msun/amd64/e_fmodl.S
new file mode 100644
index 0000000..8f7a3b5
--- /dev/null
+++ b/lib/msun/amd64/e_fmodl.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1993,94 Winning Strategies, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Winning Strategies, Inc.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Based on the i387 version written by:
+ * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$")
+
+ENTRY(fmodl)
+ fldt 24(%rsp)
+ fldt 8(%rsp)
+1: fprem
+ fstsw %ax
+ testw $0x400,%ax
+ jne 1b
+ fstp %st(1)
+ ret
+END(fmodl)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/msun/i387/Makefile.inc b/lib/msun/i387/Makefile.inc
index f387e90..daa93f6 100644
--- a/lib/msun/i387/Makefile.inc
+++ b/lib/msun/i387/Makefile.inc
@@ -2,18 +2,19 @@
ARCH_SRCS = e_exp.S e_fmod.S e_log.S e_log10.S \
e_remainder.S e_sqrt.S s_ceil.S s_copysign.S \
- s_cos.S s_finite.S s_floor.S s_llrint.S s_logb.S s_lrint.S \
- s_remquo.S s_rint.S s_scalbn.S s_significand.S s_sin.S s_tan.S \
+ s_finite.S s_floor.S s_llrint.S s_logb.S s_lrint.S \
+ s_remquo.S s_rint.S s_scalbn.S s_significand.S \
s_trunc.S
# float counterparts
-ARCH_SRCS+= e_log10f.S e_logf.S e_remainderf.S \
+ARCH_SRCS+= e_fmodf.S e_log10f.S e_logf.S e_remainderf.S \
e_sqrtf.S s_ceilf.S s_copysignf.S s_floorf.S \
s_llrintf.S s_logbf.S s_lrintf.S \
s_remquof.S s_rintf.S s_scalbnf.S s_significandf.S s_truncf.S
# long double counterparts
-ARCH_SRCS+= e_remainderl.S e_sqrtl.S s_ceill.S s_copysignl.S \
+ARCH_SRCS+= e_fmodl.S \
+ e_remainderl.S e_sqrtl.S s_ceill.S s_copysignl.S \
s_floorl.S s_llrintl.S \
s_logbl.S s_lrintl.S s_remquol.S s_rintl.S s_scalbnl.S s_truncl.S
diff --git a/lib/msun/i387/e_fmodf.S b/lib/msun/i387/e_fmodf.S
new file mode 100644
index 0000000..e269447
--- /dev/null
+++ b/lib/msun/i387/e_fmodf.S
@@ -0,0 +1,20 @@
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$")
+
+ENTRY(fmodf)
+ flds 8(%esp)
+ flds 4(%esp)
+1: fprem
+ fstsw %ax
+ sahf
+ jp 1b
+ fstp %st(1)
+ ret
+END(fmodf)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/msun/i387/e_fmodl.S b/lib/msun/i387/e_fmodl.S
new file mode 100644
index 0000000..57e986c
--- /dev/null
+++ b/lib/msun/i387/e_fmodl.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1993,94 Winning Strategies, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Winning Strategies, Inc.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Written by:
+ * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
+ */
+
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$")
+
+ENTRY(fmodl)
+ fldt 16(%esp)
+ fldt 4(%esp)
+1: fprem
+ fstsw %ax
+ sahf
+ jp 1b
+ fstp %st(1)
+ ret
+END(fmodl)
+
+ .section .note.GNU-stack,"",%progbits
diff --git a/lib/msun/ld80/e_lgammal_r.c b/lib/msun/ld80/e_lgammal_r.c
index 1e65769..f56758b 100644
--- a/lib/msun/ld80/e_lgammal_r.c
+++ b/lib/msun/ld80/e_lgammal_r.c
@@ -249,7 +249,7 @@ sin_pil(long double x)
long double
lgammal_r(long double x, int *signgamp)
{
- long double nadj,p,p1,p2,p3,q,r,t,w,y,z;
+ long double nadj,p,p1,p2,q,r,t,w,y,z;
uint64_t lx;
int i;
uint16_t hx,ix;
diff --git a/lib/msun/ld80/k_expl.h b/lib/msun/ld80/k_expl.h
index 9b081fa..1c2213e 100644
--- a/lib/msun/ld80/k_expl.h
+++ b/lib/msun/ld80/k_expl.h
@@ -75,140 +75,140 @@ static const struct {
double hi;
double lo;
} tbl[INTERVALS] = {
- 0x1p+0, 0x0p+0,
+ { 0x1p+0, 0x0p+0 },
/*
* XXX hi is rounded down, and the formatting is not quite normal.
* But I rather like both. The 0x1.*p format is good for 4N+1
* mantissa bits. Rounding down makes the lo terms positive,
* so that the columnar formatting can be simpler.
*/
- 0x1.0163da9fb3335p+0, 0x1.b61299ab8cdb7p-54,
- 0x1.02c9a3e778060p+0, 0x1.dcdef95949ef4p-53,
- 0x1.04315e86e7f84p+0, 0x1.7ae71f3441b49p-53,
- 0x1.059b0d3158574p+0, 0x1.d73e2a475b465p-55,
- 0x1.0706b29ddf6ddp+0, 0x1.8db880753b0f6p-53,
- 0x1.0874518759bc8p+0, 0x1.186be4bb284ffp-57,
- 0x1.09e3ecac6f383p+0, 0x1.1487818316136p-54,
- 0x1.0b5586cf9890fp+0, 0x1.8a62e4adc610bp-54,
- 0x1.0cc922b7247f7p+0, 0x1.01edc16e24f71p-54,
- 0x1.0e3ec32d3d1a2p+0, 0x1.03a1727c57b53p-59,
- 0x1.0fb66affed31ap+0, 0x1.e464123bb1428p-53,
- 0x1.11301d0125b50p+0, 0x1.49d77e35db263p-53,
- 0x1.12abdc06c31cbp+0, 0x1.f72575a649ad2p-53,
- 0x1.1429aaea92ddfp+0, 0x1.66820328764b1p-53,
- 0x1.15a98c8a58e51p+0, 0x1.2406ab9eeab0ap-55,
- 0x1.172b83c7d517ap+0, 0x1.b9bef918a1d63p-53,
- 0x1.18af9388c8de9p+0, 0x1.777ee1734784ap-53,
- 0x1.1a35beb6fcb75p+0, 0x1.e5b4c7b4968e4p-55,
- 0x1.1bbe084045cd3p+0, 0x1.3563ce56884fcp-53,
- 0x1.1d4873168b9aap+0, 0x1.e016e00a2643cp-54,
- 0x1.1ed5022fcd91cp+0, 0x1.71033fec2243ap-53,
- 0x1.2063b88628cd6p+0, 0x1.dc775814a8495p-55,
- 0x1.21f49917ddc96p+0, 0x1.2a97e9494a5eep-55,
- 0x1.2387a6e756238p+0, 0x1.9b07eb6c70573p-54,
- 0x1.251ce4fb2a63fp+0, 0x1.ac155bef4f4a4p-55,
- 0x1.26b4565e27cddp+0, 0x1.2bd339940e9d9p-55,
- 0x1.284dfe1f56380p+0, 0x1.2d9e2b9e07941p-53,
- 0x1.29e9df51fdee1p+0, 0x1.612e8afad1255p-55,
- 0x1.2b87fd0dad98fp+0, 0x1.fbbd48ca71f95p-53,
- 0x1.2d285a6e4030bp+0, 0x1.0024754db41d5p-54,
- 0x1.2ecafa93e2f56p+0, 0x1.1ca0f45d52383p-56,
- 0x1.306fe0a31b715p+0, 0x1.6f46ad23182e4p-55,
- 0x1.32170fc4cd831p+0, 0x1.a9ce78e18047cp-55,
- 0x1.33c08b26416ffp+0, 0x1.32721843659a6p-54,
- 0x1.356c55f929ff0p+0, 0x1.928c468ec6e76p-53,
- 0x1.371a7373aa9cap+0, 0x1.4e28aa05e8a8fp-53,
- 0x1.38cae6d05d865p+0, 0x1.0b53961b37da2p-53,
- 0x1.3a7db34e59ff6p+0, 0x1.d43792533c144p-53,
- 0x1.3c32dc313a8e4p+0, 0x1.08003e4516b1ep-53,
- 0x1.3dea64c123422p+0, 0x1.ada0911f09ebcp-55,
- 0x1.3fa4504ac801bp+0, 0x1.417ee03548306p-53,
- 0x1.4160a21f72e29p+0, 0x1.f0864b71e7b6cp-53,
- 0x1.431f5d950a896p+0, 0x1.b8e088728219ap-53,
- 0x1.44e086061892dp+0, 0x1.89b7a04ef80d0p-59,
- 0x1.46a41ed1d0057p+0, 0x1.c944bd1648a76p-54,
- 0x1.486a2b5c13cd0p+0, 0x1.3c1a3b69062f0p-56,
- 0x1.4a32af0d7d3dep+0, 0x1.9cb62f3d1be56p-54,
- 0x1.4bfdad5362a27p+0, 0x1.d4397afec42e2p-56,
- 0x1.4dcb299fddd0dp+0, 0x1.8ecdbbc6a7833p-54,
- 0x1.4f9b2769d2ca6p+0, 0x1.5a67b16d3540ep-53,
- 0x1.516daa2cf6641p+0, 0x1.8225ea5909b04p-53,
- 0x1.5342b569d4f81p+0, 0x1.be1507893b0d5p-53,
- 0x1.551a4ca5d920ep+0, 0x1.8a5d8c4048699p-53,
- 0x1.56f4736b527dap+0, 0x1.9bb2c011d93adp-54,
- 0x1.58d12d497c7fdp+0, 0x1.295e15b9a1de8p-55,
- 0x1.5ab07dd485429p+0, 0x1.6324c054647adp-54,
- 0x1.5c9268a5946b7p+0, 0x1.c4b1b816986a2p-60,
- 0x1.5e76f15ad2148p+0, 0x1.ba6f93080e65ep-54,
- 0x1.605e1b976dc08p+0, 0x1.60edeb25490dcp-53,
- 0x1.6247eb03a5584p+0, 0x1.63e1f40dfa5b5p-53,
- 0x1.6434634ccc31fp+0, 0x1.8edf0e2989db3p-53,
- 0x1.6623882552224p+0, 0x1.224fb3c5371e6p-53,
- 0x1.68155d44ca973p+0, 0x1.038ae44f73e65p-57,
- 0x1.6a09e667f3bccp+0, 0x1.21165f626cdd5p-53,
- 0x1.6c012750bdabep+0, 0x1.daed533001e9ep-53,
- 0x1.6dfb23c651a2ep+0, 0x1.e441c597c3775p-53,
- 0x1.6ff7df9519483p+0, 0x1.9f0fc369e7c42p-53,
- 0x1.71f75e8ec5f73p+0, 0x1.ba46e1e5de15ap-53,
- 0x1.73f9a48a58173p+0, 0x1.7ab9349cd1562p-53,
- 0x1.75feb564267c8p+0, 0x1.7edd354674916p-53,
- 0x1.780694fde5d3fp+0, 0x1.866b80a02162dp-54,
- 0x1.7a11473eb0186p+0, 0x1.afaa2047ed9b4p-53,
- 0x1.7c1ed0130c132p+0, 0x1.f124cd1164dd6p-54,
- 0x1.7e2f336cf4e62p+0, 0x1.05d02ba15797ep-56,
- 0x1.80427543e1a11p+0, 0x1.6c1bccec9346bp-53,
- 0x1.82589994cce12p+0, 0x1.159f115f56694p-53,
- 0x1.8471a4623c7acp+0, 0x1.9ca5ed72f8c81p-53,
- 0x1.868d99b4492ecp+0, 0x1.01c83b21584a3p-53,
- 0x1.88ac7d98a6699p+0, 0x1.994c2f37cb53ap-54,
- 0x1.8ace5422aa0dbp+0, 0x1.6e9f156864b27p-54,
- 0x1.8cf3216b5448bp+0, 0x1.de55439a2c38bp-53,
- 0x1.8f1ae99157736p+0, 0x1.5cc13a2e3976cp-55,
- 0x1.9145b0b91ffc5p+0, 0x1.114c368d3ed6ep-53,
- 0x1.93737b0cdc5e4p+0, 0x1.e8a0387e4a814p-53,
- 0x1.95a44cbc8520ep+0, 0x1.d36906d2b41f9p-53,
- 0x1.97d829fde4e4fp+0, 0x1.173d241f23d18p-53,
- 0x1.9a0f170ca07b9p+0, 0x1.7462137188ce7p-53,
- 0x1.9c49182a3f090p+0, 0x1.c7c46b071f2bep-56,
- 0x1.9e86319e32323p+0, 0x1.824ca78e64c6ep-56,
- 0x1.a0c667b5de564p+0, 0x1.6535b51719567p-53,
- 0x1.a309bec4a2d33p+0, 0x1.6305c7ddc36abp-54,
- 0x1.a5503b23e255cp+0, 0x1.1684892395f0fp-53,
- 0x1.a799e1330b358p+0, 0x1.bcb7ecac563c7p-54,
- 0x1.a9e6b5579fdbfp+0, 0x1.0fac90ef7fd31p-54,
- 0x1.ac36bbfd3f379p+0, 0x1.81b72cd4624ccp-53,
- 0x1.ae89f995ad3adp+0, 0x1.7a1cd345dcc81p-54,
- 0x1.b0e07298db665p+0, 0x1.2108559bf8deep-53,
- 0x1.b33a2b84f15fap+0, 0x1.ed7fa1cf7b290p-53,
- 0x1.b59728de55939p+0, 0x1.1c7102222c90ep-53,
- 0x1.b7f76f2fb5e46p+0, 0x1.d54f610356a79p-53,
- 0x1.ba5b030a10649p+0, 0x1.0819678d5eb69p-53,
- 0x1.bcc1e904bc1d2p+0, 0x1.23dd07a2d9e84p-55,
- 0x1.bf2c25bd71e08p+0, 0x1.0811ae04a31c7p-53,
- 0x1.c199bdd85529cp+0, 0x1.11065895048ddp-55,
- 0x1.c40ab5fffd07ap+0, 0x1.b4537e083c60ap-54,
- 0x1.c67f12e57d14bp+0, 0x1.2884dff483cadp-54,
- 0x1.c8f6d9406e7b5p+0, 0x1.1acbc48805c44p-56,
- 0x1.cb720dcef9069p+0, 0x1.503cbd1e949dbp-56,
- 0x1.cdf0b555dc3f9p+0, 0x1.889f12b1f58a3p-53,
- 0x1.d072d4a07897bp+0, 0x1.1a1e45e4342b2p-53,
- 0x1.d2f87080d89f1p+0, 0x1.15bc247313d44p-53,
- 0x1.d5818dcfba487p+0, 0x1.2ed02d75b3707p-55,
- 0x1.d80e316c98397p+0, 0x1.7709f3a09100cp-53,
- 0x1.da9e603db3285p+0, 0x1.c2300696db532p-54,
- 0x1.dd321f301b460p+0, 0x1.2da5778f018c3p-54,
- 0x1.dfc97337b9b5ep+0, 0x1.72d195873da52p-53,
- 0x1.e264614f5a128p+0, 0x1.424ec3f42f5b5p-53,
- 0x1.e502ee78b3ff6p+0, 0x1.39e8980a9cc8fp-55,
- 0x1.e7a51fbc74c83p+0, 0x1.2d522ca0c8de2p-54,
- 0x1.ea4afa2a490d9p+0, 0x1.0b1ee7431ebb6p-53,
- 0x1.ecf482d8e67f0p+0, 0x1.1b60625f7293ap-53,
- 0x1.efa1bee615a27p+0, 0x1.dc7f486a4b6b0p-54,
- 0x1.f252b376bba97p+0, 0x1.3a1a5bf0d8e43p-54,
- 0x1.f50765b6e4540p+0, 0x1.9d3e12dd8a18bp-54,
- 0x1.f7bfdad9cbe13p+0, 0x1.1227697fce57bp-53,
- 0x1.fa7c1819e90d8p+0, 0x1.74853f3a5931ep-55,
- 0x1.fd3c22b8f71f1p+0, 0x1.2eb74966579e7p-57
+ { 0x1.0163da9fb3335p+0, 0x1.b61299ab8cdb7p-54 },
+ { 0x1.02c9a3e778060p+0, 0x1.dcdef95949ef4p-53 },
+ { 0x1.04315e86e7f84p+0, 0x1.7ae71f3441b49p-53 },
+ { 0x1.059b0d3158574p+0, 0x1.d73e2a475b465p-55 },
+ { 0x1.0706b29ddf6ddp+0, 0x1.8db880753b0f6p-53 },
+ { 0x1.0874518759bc8p+0, 0x1.186be4bb284ffp-57 },
+ { 0x1.09e3ecac6f383p+0, 0x1.1487818316136p-54 },
+ { 0x1.0b5586cf9890fp+0, 0x1.8a62e4adc610bp-54 },
+ { 0x1.0cc922b7247f7p+0, 0x1.01edc16e24f71p-54 },
+ { 0x1.0e3ec32d3d1a2p+0, 0x1.03a1727c57b53p-59 },
+ { 0x1.0fb66affed31ap+0, 0x1.e464123bb1428p-53 },
+ { 0x1.11301d0125b50p+0, 0x1.49d77e35db263p-53 },
+ { 0x1.12abdc06c31cbp+0, 0x1.f72575a649ad2p-53 },
+ { 0x1.1429aaea92ddfp+0, 0x1.66820328764b1p-53 },
+ { 0x1.15a98c8a58e51p+0, 0x1.2406ab9eeab0ap-55 },
+ { 0x1.172b83c7d517ap+0, 0x1.b9bef918a1d63p-53 },
+ { 0x1.18af9388c8de9p+0, 0x1.777ee1734784ap-53 },
+ { 0x1.1a35beb6fcb75p+0, 0x1.e5b4c7b4968e4p-55 },
+ { 0x1.1bbe084045cd3p+0, 0x1.3563ce56884fcp-53 },
+ { 0x1.1d4873168b9aap+0, 0x1.e016e00a2643cp-54 },
+ { 0x1.1ed5022fcd91cp+0, 0x1.71033fec2243ap-53 },
+ { 0x1.2063b88628cd6p+0, 0x1.dc775814a8495p-55 },
+ { 0x1.21f49917ddc96p+0, 0x1.2a97e9494a5eep-55 },
+ { 0x1.2387a6e756238p+0, 0x1.9b07eb6c70573p-54 },
+ { 0x1.251ce4fb2a63fp+0, 0x1.ac155bef4f4a4p-55 },
+ { 0x1.26b4565e27cddp+0, 0x1.2bd339940e9d9p-55 },
+ { 0x1.284dfe1f56380p+0, 0x1.2d9e2b9e07941p-53 },
+ { 0x1.29e9df51fdee1p+0, 0x1.612e8afad1255p-55 },
+ { 0x1.2b87fd0dad98fp+0, 0x1.fbbd48ca71f95p-53 },
+ { 0x1.2d285a6e4030bp+0, 0x1.0024754db41d5p-54 },
+ { 0x1.2ecafa93e2f56p+0, 0x1.1ca0f45d52383p-56 },
+ { 0x1.306fe0a31b715p+0, 0x1.6f46ad23182e4p-55 },
+ { 0x1.32170fc4cd831p+0, 0x1.a9ce78e18047cp-55 },
+ { 0x1.33c08b26416ffp+0, 0x1.32721843659a6p-54 },
+ { 0x1.356c55f929ff0p+0, 0x1.928c468ec6e76p-53 },
+ { 0x1.371a7373aa9cap+0, 0x1.4e28aa05e8a8fp-53 },
+ { 0x1.38cae6d05d865p+0, 0x1.0b53961b37da2p-53 },
+ { 0x1.3a7db34e59ff6p+0, 0x1.d43792533c144p-53 },
+ { 0x1.3c32dc313a8e4p+0, 0x1.08003e4516b1ep-53 },
+ { 0x1.3dea64c123422p+0, 0x1.ada0911f09ebcp-55 },
+ { 0x1.3fa4504ac801bp+0, 0x1.417ee03548306p-53 },
+ { 0x1.4160a21f72e29p+0, 0x1.f0864b71e7b6cp-53 },
+ { 0x1.431f5d950a896p+0, 0x1.b8e088728219ap-53 },
+ { 0x1.44e086061892dp+0, 0x1.89b7a04ef80d0p-59 },
+ { 0x1.46a41ed1d0057p+0, 0x1.c944bd1648a76p-54 },
+ { 0x1.486a2b5c13cd0p+0, 0x1.3c1a3b69062f0p-56 },
+ { 0x1.4a32af0d7d3dep+0, 0x1.9cb62f3d1be56p-54 },
+ { 0x1.4bfdad5362a27p+0, 0x1.d4397afec42e2p-56 },
+ { 0x1.4dcb299fddd0dp+0, 0x1.8ecdbbc6a7833p-54 },
+ { 0x1.4f9b2769d2ca6p+0, 0x1.5a67b16d3540ep-53 },
+ { 0x1.516daa2cf6641p+0, 0x1.8225ea5909b04p-53 },
+ { 0x1.5342b569d4f81p+0, 0x1.be1507893b0d5p-53 },
+ { 0x1.551a4ca5d920ep+0, 0x1.8a5d8c4048699p-53 },
+ { 0x1.56f4736b527dap+0, 0x1.9bb2c011d93adp-54 },
+ { 0x1.58d12d497c7fdp+0, 0x1.295e15b9a1de8p-55 },
+ { 0x1.5ab07dd485429p+0, 0x1.6324c054647adp-54 },
+ { 0x1.5c9268a5946b7p+0, 0x1.c4b1b816986a2p-60 },
+ { 0x1.5e76f15ad2148p+0, 0x1.ba6f93080e65ep-54 },
+ { 0x1.605e1b976dc08p+0, 0x1.60edeb25490dcp-53 },
+ { 0x1.6247eb03a5584p+0, 0x1.63e1f40dfa5b5p-53 },
+ { 0x1.6434634ccc31fp+0, 0x1.8edf0e2989db3p-53 },
+ { 0x1.6623882552224p+0, 0x1.224fb3c5371e6p-53 },
+ { 0x1.68155d44ca973p+0, 0x1.038ae44f73e65p-57 },
+ { 0x1.6a09e667f3bccp+0, 0x1.21165f626cdd5p-53 },
+ { 0x1.6c012750bdabep+0, 0x1.daed533001e9ep-53 },
+ { 0x1.6dfb23c651a2ep+0, 0x1.e441c597c3775p-53 },
+ { 0x1.6ff7df9519483p+0, 0x1.9f0fc369e7c42p-53 },
+ { 0x1.71f75e8ec5f73p+0, 0x1.ba46e1e5de15ap-53 },
+ { 0x1.73f9a48a58173p+0, 0x1.7ab9349cd1562p-53 },
+ { 0x1.75feb564267c8p+0, 0x1.7edd354674916p-53 },
+ { 0x1.780694fde5d3fp+0, 0x1.866b80a02162dp-54 },
+ { 0x1.7a11473eb0186p+0, 0x1.afaa2047ed9b4p-53 },
+ { 0x1.7c1ed0130c132p+0, 0x1.f124cd1164dd6p-54 },
+ { 0x1.7e2f336cf4e62p+0, 0x1.05d02ba15797ep-56 },
+ { 0x1.80427543e1a11p+0, 0x1.6c1bccec9346bp-53 },
+ { 0x1.82589994cce12p+0, 0x1.159f115f56694p-53 },
+ { 0x1.8471a4623c7acp+0, 0x1.9ca5ed72f8c81p-53 },
+ { 0x1.868d99b4492ecp+0, 0x1.01c83b21584a3p-53 },
+ { 0x1.88ac7d98a6699p+0, 0x1.994c2f37cb53ap-54 },
+ { 0x1.8ace5422aa0dbp+0, 0x1.6e9f156864b27p-54 },
+ { 0x1.8cf3216b5448bp+0, 0x1.de55439a2c38bp-53 },
+ { 0x1.8f1ae99157736p+0, 0x1.5cc13a2e3976cp-55 },
+ { 0x1.9145b0b91ffc5p+0, 0x1.114c368d3ed6ep-53 },
+ { 0x1.93737b0cdc5e4p+0, 0x1.e8a0387e4a814p-53 },
+ { 0x1.95a44cbc8520ep+0, 0x1.d36906d2b41f9p-53 },
+ { 0x1.97d829fde4e4fp+0, 0x1.173d241f23d18p-53 },
+ { 0x1.9a0f170ca07b9p+0, 0x1.7462137188ce7p-53 },
+ { 0x1.9c49182a3f090p+0, 0x1.c7c46b071f2bep-56 },
+ { 0x1.9e86319e32323p+0, 0x1.824ca78e64c6ep-56 },
+ { 0x1.a0c667b5de564p+0, 0x1.6535b51719567p-53 },
+ { 0x1.a309bec4a2d33p+0, 0x1.6305c7ddc36abp-54 },
+ { 0x1.a5503b23e255cp+0, 0x1.1684892395f0fp-53 },
+ { 0x1.a799e1330b358p+0, 0x1.bcb7ecac563c7p-54 },
+ { 0x1.a9e6b5579fdbfp+0, 0x1.0fac90ef7fd31p-54 },
+ { 0x1.ac36bbfd3f379p+0, 0x1.81b72cd4624ccp-53 },
+ { 0x1.ae89f995ad3adp+0, 0x1.7a1cd345dcc81p-54 },
+ { 0x1.b0e07298db665p+0, 0x1.2108559bf8deep-53 },
+ { 0x1.b33a2b84f15fap+0, 0x1.ed7fa1cf7b290p-53 },
+ { 0x1.b59728de55939p+0, 0x1.1c7102222c90ep-53 },
+ { 0x1.b7f76f2fb5e46p+0, 0x1.d54f610356a79p-53 },
+ { 0x1.ba5b030a10649p+0, 0x1.0819678d5eb69p-53 },
+ { 0x1.bcc1e904bc1d2p+0, 0x1.23dd07a2d9e84p-55 },
+ { 0x1.bf2c25bd71e08p+0, 0x1.0811ae04a31c7p-53 },
+ { 0x1.c199bdd85529cp+0, 0x1.11065895048ddp-55 },
+ { 0x1.c40ab5fffd07ap+0, 0x1.b4537e083c60ap-54 },
+ { 0x1.c67f12e57d14bp+0, 0x1.2884dff483cadp-54 },
+ { 0x1.c8f6d9406e7b5p+0, 0x1.1acbc48805c44p-56 },
+ { 0x1.cb720dcef9069p+0, 0x1.503cbd1e949dbp-56 },
+ { 0x1.cdf0b555dc3f9p+0, 0x1.889f12b1f58a3p-53 },
+ { 0x1.d072d4a07897bp+0, 0x1.1a1e45e4342b2p-53 },
+ { 0x1.d2f87080d89f1p+0, 0x1.15bc247313d44p-53 },
+ { 0x1.d5818dcfba487p+0, 0x1.2ed02d75b3707p-55 },
+ { 0x1.d80e316c98397p+0, 0x1.7709f3a09100cp-53 },
+ { 0x1.da9e603db3285p+0, 0x1.c2300696db532p-54 },
+ { 0x1.dd321f301b460p+0, 0x1.2da5778f018c3p-54 },
+ { 0x1.dfc97337b9b5ep+0, 0x1.72d195873da52p-53 },
+ { 0x1.e264614f5a128p+0, 0x1.424ec3f42f5b5p-53 },
+ { 0x1.e502ee78b3ff6p+0, 0x1.39e8980a9cc8fp-55 },
+ { 0x1.e7a51fbc74c83p+0, 0x1.2d522ca0c8de2p-54 },
+ { 0x1.ea4afa2a490d9p+0, 0x1.0b1ee7431ebb6p-53 },
+ { 0x1.ecf482d8e67f0p+0, 0x1.1b60625f7293ap-53 },
+ { 0x1.efa1bee615a27p+0, 0x1.dc7f486a4b6b0p-54 },
+ { 0x1.f252b376bba97p+0, 0x1.3a1a5bf0d8e43p-54 },
+ { 0x1.f50765b6e4540p+0, 0x1.9d3e12dd8a18bp-54 },
+ { 0x1.f7bfdad9cbe13p+0, 0x1.1227697fce57bp-53 },
+ { 0x1.fa7c1819e90d8p+0, 0x1.74853f3a5931ep-55 },
+ { 0x1.fd3c22b8f71f1p+0, 0x1.2eb74966579e7p-57 }
};
/*
diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c
index 3a35753..e0daed7 100644
--- a/lib/msun/ld80/s_logl.c
+++ b/lib/msun/ld80/s_logl.c
@@ -152,135 +152,135 @@ static const struct {
* mainly to minimize the size of the table. Using all 24 bits
* in a float for it automatically satisfies the above constraints.
*/
- 0x800000.0p-23, 0, 0,
- 0xfe0000.0p-24, 0x8080ac.0p-30, -0x14ee431dae6675.0p-84,
- 0xfc0000.0p-24, 0x8102b3.0p-29, -0x1db29ee2d83718.0p-84,
- 0xfa0000.0p-24, 0xc24929.0p-29, 0x1191957d173698.0p-83,
- 0xf80000.0p-24, 0x820aec.0p-28, 0x13ce8888e02e79.0p-82,
- 0xf60000.0p-24, 0xa33577.0p-28, -0x17a4382ce6eb7c.0p-82,
- 0xf48000.0p-24, 0xbc42cb.0p-28, -0x172a21161a1076.0p-83,
- 0xf30000.0p-24, 0xd57797.0p-28, -0x1e09de07cb9589.0p-82,
- 0xf10000.0p-24, 0xf7518e.0p-28, 0x1ae1eec1b036c5.0p-91,
- 0xef0000.0p-24, 0x8cb9df.0p-27, -0x1d7355325d560e.0p-81,
- 0xed8000.0p-24, 0x999ec0.0p-27, -0x1f9f02d256d503.0p-82,
- 0xec0000.0p-24, 0xa6988b.0p-27, -0x16fc0a9d12c17a.0p-83,
- 0xea0000.0p-24, 0xb80698.0p-27, 0x15d581c1e8da9a.0p-81,
- 0xe80000.0p-24, 0xc99af3.0p-27, -0x1535b3ba8f150b.0p-83,
- 0xe70000.0p-24, 0xd273b2.0p-27, 0x163786f5251af0.0p-85,
- 0xe50000.0p-24, 0xe442c0.0p-27, 0x1bc4b2368e32d5.0p-84,
- 0xe38000.0p-24, 0xf1b83f.0p-27, 0x1c6090f684e676.0p-81,
- 0xe20000.0p-24, 0xff448a.0p-27, -0x1890aa69ac9f42.0p-82,
- 0xe08000.0p-24, 0x8673f6.0p-26, 0x1b9985194b6b00.0p-80,
- 0xdf0000.0p-24, 0x8d515c.0p-26, -0x1dc08d61c6ef1e.0p-83,
- 0xdd8000.0p-24, 0x943a9e.0p-26, -0x1f72a2dac729b4.0p-82,
- 0xdc0000.0p-24, 0x9b2fe6.0p-26, -0x1fd4dfd3a0afb9.0p-80,
- 0xda8000.0p-24, 0xa2315d.0p-26, -0x11b26121629c47.0p-82,
- 0xd90000.0p-24, 0xa93f2f.0p-26, 0x1286d633e8e569.0p-81,
- 0xd78000.0p-24, 0xb05988.0p-26, 0x16128eba936770.0p-84,
- 0xd60000.0p-24, 0xb78094.0p-26, 0x16ead577390d32.0p-80,
- 0xd50000.0p-24, 0xbc4c6c.0p-26, 0x151131ccf7c7b7.0p-81,
- 0xd38000.0p-24, 0xc3890a.0p-26, -0x115e2cd714bd06.0p-80,
- 0xd20000.0p-24, 0xcad2d7.0p-26, -0x1847f406ebd3b0.0p-82,
- 0xd10000.0p-24, 0xcfb620.0p-26, 0x1c2259904d6866.0p-81,
- 0xcf8000.0p-24, 0xd71653.0p-26, 0x1ece57a8d5ae55.0p-80,
- 0xce0000.0p-24, 0xde843a.0p-26, -0x1f109d4bc45954.0p-81,
- 0xcd0000.0p-24, 0xe37fde.0p-26, 0x1bc03dc271a74d.0p-81,
- 0xcb8000.0p-24, 0xeb050c.0p-26, -0x1bf2badc0df842.0p-85,
- 0xca0000.0p-24, 0xf29878.0p-26, -0x18efededd89fbe.0p-87,
- 0xc90000.0p-24, 0xf7ad6f.0p-26, 0x1373ff977baa69.0p-81,
- 0xc80000.0p-24, 0xfcc8e3.0p-26, 0x196766f2fb3283.0p-80,
- 0xc68000.0p-24, 0x823f30.0p-25, 0x19bd076f7c434e.0p-79,
- 0xc58000.0p-24, 0x84d52c.0p-25, -0x1a327257af0f46.0p-79,
- 0xc40000.0p-24, 0x88bc74.0p-25, 0x113f23def19c5a.0p-81,
- 0xc30000.0p-24, 0x8b5ae6.0p-25, 0x1759f6e6b37de9.0p-79,
- 0xc20000.0p-24, 0x8dfccb.0p-25, 0x1ad35ca6ed5148.0p-81,
- 0xc10000.0p-24, 0x90a22b.0p-25, 0x1a1d71a87deba4.0p-79,
- 0xbf8000.0p-24, 0x94a0d8.0p-25, -0x139e5210c2b731.0p-80,
- 0xbe8000.0p-24, 0x974f16.0p-25, -0x18f6ebcff3ed73.0p-81,
- 0xbd8000.0p-24, 0x9a00f1.0p-25, -0x1aa268be39aab7.0p-79,
- 0xbc8000.0p-24, 0x9cb672.0p-25, -0x14c8815839c566.0p-79,
- 0xbb0000.0p-24, 0xa0cda1.0p-25, 0x1eaf46390dbb24.0p-81,
- 0xba0000.0p-24, 0xa38c6e.0p-25, 0x138e20d831f698.0p-81,
- 0xb90000.0p-24, 0xa64f05.0p-25, -0x1e8d3c41123616.0p-82,
- 0xb80000.0p-24, 0xa91570.0p-25, 0x1ce28f5f3840b2.0p-80,
- 0xb70000.0p-24, 0xabdfbb.0p-25, -0x186e5c0a424234.0p-79,
- 0xb60000.0p-24, 0xaeadef.0p-25, -0x14d41a0b2a08a4.0p-83,
- 0xb50000.0p-24, 0xb18018.0p-25, 0x16755892770634.0p-79,
- 0xb40000.0p-24, 0xb45642.0p-25, -0x16395ebe59b152.0p-82,
- 0xb30000.0p-24, 0xb73077.0p-25, 0x1abc65c8595f09.0p-80,
- 0xb20000.0p-24, 0xba0ec4.0p-25, -0x1273089d3dad89.0p-79,
- 0xb10000.0p-24, 0xbcf133.0p-25, 0x10f9f67b1f4bbf.0p-79,
- 0xb00000.0p-24, 0xbfd7d2.0p-25, -0x109fab90486409.0p-80,
- 0xaf0000.0p-24, 0xc2c2ac.0p-25, -0x1124680aa43333.0p-79,
- 0xae8000.0p-24, 0xc439b3.0p-25, -0x1f360cc4710fc0.0p-80,
- 0xad8000.0p-24, 0xc72afd.0p-25, -0x132d91f21d89c9.0p-80,
- 0xac8000.0p-24, 0xca20a2.0p-25, -0x16bf9b4d1f8da8.0p-79,
- 0xab8000.0p-24, 0xcd1aae.0p-25, 0x19deb5ce6a6a87.0p-81,
- 0xaa8000.0p-24, 0xd0192f.0p-25, 0x1a29fb48f7d3cb.0p-79,
- 0xaa0000.0p-24, 0xd19a20.0p-25, 0x1127d3c6457f9d.0p-81,
- 0xa90000.0p-24, 0xd49f6a.0p-25, -0x1ba930e486a0ac.0p-81,
- 0xa80000.0p-24, 0xd7a94b.0p-25, -0x1b6e645f31549e.0p-79,
- 0xa70000.0p-24, 0xdab7d0.0p-25, 0x1118a425494b61.0p-80,
- 0xa68000.0p-24, 0xdc40d5.0p-25, 0x1966f24d29d3a3.0p-80,
- 0xa58000.0p-24, 0xdf566d.0p-25, -0x1d8e52eb2248f1.0p-82,
- 0xa48000.0p-24, 0xe270ce.0p-25, -0x1ee370f96e6b68.0p-80,
- 0xa40000.0p-24, 0xe3ffce.0p-25, 0x1d155324911f57.0p-80,
- 0xa30000.0p-24, 0xe72179.0p-25, -0x1fe6e2f2f867d9.0p-80,
- 0xa20000.0p-24, 0xea4812.0p-25, 0x1b7be9add7f4d4.0p-80,
- 0xa18000.0p-24, 0xebdd3d.0p-25, 0x1b3cfb3f7511dd.0p-79,
- 0xa08000.0p-24, 0xef0b5b.0p-25, -0x1220de1f730190.0p-79,
- 0xa00000.0p-24, 0xf0a451.0p-25, -0x176364c9ac81cd.0p-80,
- 0x9f0000.0p-24, 0xf3da16.0p-25, 0x1eed6b9aafac8d.0p-81,
- 0x9e8000.0p-24, 0xf576e9.0p-25, 0x1d593218675af2.0p-79,
- 0x9d8000.0p-24, 0xf8b47c.0p-25, -0x13e8eb7da053e0.0p-84,
- 0x9d0000.0p-24, 0xfa553f.0p-25, 0x1c063259bcade0.0p-79,
- 0x9c0000.0p-24, 0xfd9ac5.0p-25, 0x1ef491085fa3c1.0p-79,
- 0x9b8000.0p-24, 0xff3f8c.0p-25, 0x1d607a7c2b8c53.0p-79,
- 0x9a8000.0p-24, 0x814697.0p-24, -0x12ad3817004f3f.0p-78,
- 0x9a0000.0p-24, 0x821b06.0p-24, -0x189fc53117f9e5.0p-81,
- 0x990000.0p-24, 0x83c5f8.0p-24, 0x14cf15a048907b.0p-79,
- 0x988000.0p-24, 0x849c7d.0p-24, 0x1cbb1d35fb8287.0p-78,
- 0x978000.0p-24, 0x864ba6.0p-24, 0x1128639b814f9c.0p-78,
- 0x970000.0p-24, 0x87244c.0p-24, 0x184733853300f0.0p-79,
- 0x968000.0p-24, 0x87fdaa.0p-24, 0x109d23aef77dd6.0p-80,
- 0x958000.0p-24, 0x89b293.0p-24, -0x1a81ef367a59de.0p-78,
- 0x950000.0p-24, 0x8a8e20.0p-24, -0x121ad3dbb2f452.0p-78,
- 0x948000.0p-24, 0x8b6a6a.0p-24, -0x1cfb981628af72.0p-79,
- 0x938000.0p-24, 0x8d253a.0p-24, -0x1d21730ea76cfe.0p-79,
- 0x930000.0p-24, 0x8e03c2.0p-24, 0x135cc00e566f77.0p-78,
- 0x928000.0p-24, 0x8ee30d.0p-24, -0x10fcb5df257a26.0p-80,
- 0x918000.0p-24, 0x90a3ee.0p-24, -0x16e171b15433d7.0p-79,
- 0x910000.0p-24, 0x918587.0p-24, -0x1d050da07f3237.0p-79,
- 0x908000.0p-24, 0x9267e7.0p-24, 0x1be03669a5268d.0p-79,
- 0x8f8000.0p-24, 0x942f04.0p-24, 0x10b28e0e26c337.0p-79,
- 0x8f0000.0p-24, 0x9513c3.0p-24, 0x1a1d820da57cf3.0p-78,
- 0x8e8000.0p-24, 0x95f950.0p-24, -0x19ef8f13ae3cf1.0p-79,
- 0x8e0000.0p-24, 0x96dfab.0p-24, -0x109e417a6e507c.0p-78,
- 0x8d0000.0p-24, 0x98aed2.0p-24, 0x10d01a2c5b0e98.0p-79,
- 0x8c8000.0p-24, 0x9997a2.0p-24, -0x1d6a50d4b61ea7.0p-78,
- 0x8c0000.0p-24, 0x9a8145.0p-24, 0x1b3b190b83f952.0p-78,
- 0x8b8000.0p-24, 0x9b6bbf.0p-24, 0x13a69fad7e7abe.0p-78,
- 0x8b0000.0p-24, 0x9c5711.0p-24, -0x11cd12316f576b.0p-78,
- 0x8a8000.0p-24, 0x9d433b.0p-24, 0x1c95c444b807a2.0p-79,
- 0x898000.0p-24, 0x9f1e22.0p-24, -0x1b9c224ea698c3.0p-79,
- 0x890000.0p-24, 0xa00ce1.0p-24, 0x125ca93186cf0f.0p-81,
- 0x888000.0p-24, 0xa0fc80.0p-24, -0x1ee38a7bc228b3.0p-79,
- 0x880000.0p-24, 0xa1ed00.0p-24, -0x1a0db876613d20.0p-78,
- 0x878000.0p-24, 0xa2de62.0p-24, 0x193224e8516c01.0p-79,
- 0x870000.0p-24, 0xa3d0a9.0p-24, 0x1fa28b4d2541ad.0p-79,
- 0x868000.0p-24, 0xa4c3d6.0p-24, 0x1c1b5760fb4572.0p-78,
- 0x858000.0p-24, 0xa6acea.0p-24, 0x1fed5d0f65949c.0p-80,
- 0x850000.0p-24, 0xa7a2d4.0p-24, 0x1ad270c9d74936.0p-80,
- 0x848000.0p-24, 0xa899ab.0p-24, 0x199ff15ce53266.0p-79,
- 0x840000.0p-24, 0xa99171.0p-24, 0x1a19e15ccc45d2.0p-79,
- 0x838000.0p-24, 0xaa8a28.0p-24, -0x121a14ec532b36.0p-80,
- 0x830000.0p-24, 0xab83d1.0p-24, 0x1aee319980bff3.0p-79,
- 0x828000.0p-24, 0xac7e6f.0p-24, -0x18ffd9e3900346.0p-80,
- 0x820000.0p-24, 0xad7a03.0p-24, -0x1e4db102ce29f8.0p-80,
- 0x818000.0p-24, 0xae768f.0p-24, 0x17c35c55a04a83.0p-81,
- 0x810000.0p-24, 0xaf7415.0p-24, 0x1448324047019b.0p-78,
- 0x808000.0p-24, 0xb07298.0p-24, -0x1750ee3915a198.0p-78,
- 0x800000.0p-24, 0xb17218.0p-24, -0x105c610ca86c39.0p-81,
+ { 0x800000.0p-23, 0, 0 },
+ { 0xfe0000.0p-24, 0x8080ac.0p-30, -0x14ee431dae6675.0p-84 },
+ { 0xfc0000.0p-24, 0x8102b3.0p-29, -0x1db29ee2d83718.0p-84 },
+ { 0xfa0000.0p-24, 0xc24929.0p-29, 0x1191957d173698.0p-83 },
+ { 0xf80000.0p-24, 0x820aec.0p-28, 0x13ce8888e02e79.0p-82 },
+ { 0xf60000.0p-24, 0xa33577.0p-28, -0x17a4382ce6eb7c.0p-82 },
+ { 0xf48000.0p-24, 0xbc42cb.0p-28, -0x172a21161a1076.0p-83 },
+ { 0xf30000.0p-24, 0xd57797.0p-28, -0x1e09de07cb9589.0p-82 },
+ { 0xf10000.0p-24, 0xf7518e.0p-28, 0x1ae1eec1b036c5.0p-91 },
+ { 0xef0000.0p-24, 0x8cb9df.0p-27, -0x1d7355325d560e.0p-81 },
+ { 0xed8000.0p-24, 0x999ec0.0p-27, -0x1f9f02d256d503.0p-82 },
+ { 0xec0000.0p-24, 0xa6988b.0p-27, -0x16fc0a9d12c17a.0p-83 },
+ { 0xea0000.0p-24, 0xb80698.0p-27, 0x15d581c1e8da9a.0p-81 },
+ { 0xe80000.0p-24, 0xc99af3.0p-27, -0x1535b3ba8f150b.0p-83 },
+ { 0xe70000.0p-24, 0xd273b2.0p-27, 0x163786f5251af0.0p-85 },
+ { 0xe50000.0p-24, 0xe442c0.0p-27, 0x1bc4b2368e32d5.0p-84 },
+ { 0xe38000.0p-24, 0xf1b83f.0p-27, 0x1c6090f684e676.0p-81 },
+ { 0xe20000.0p-24, 0xff448a.0p-27, -0x1890aa69ac9f42.0p-82 },
+ { 0xe08000.0p-24, 0x8673f6.0p-26, 0x1b9985194b6b00.0p-80 },
+ { 0xdf0000.0p-24, 0x8d515c.0p-26, -0x1dc08d61c6ef1e.0p-83 },
+ { 0xdd8000.0p-24, 0x943a9e.0p-26, -0x1f72a2dac729b4.0p-82 },
+ { 0xdc0000.0p-24, 0x9b2fe6.0p-26, -0x1fd4dfd3a0afb9.0p-80 },
+ { 0xda8000.0p-24, 0xa2315d.0p-26, -0x11b26121629c47.0p-82 },
+ { 0xd90000.0p-24, 0xa93f2f.0p-26, 0x1286d633e8e569.0p-81 },
+ { 0xd78000.0p-24, 0xb05988.0p-26, 0x16128eba936770.0p-84 },
+ { 0xd60000.0p-24, 0xb78094.0p-26, 0x16ead577390d32.0p-80 },
+ { 0xd50000.0p-24, 0xbc4c6c.0p-26, 0x151131ccf7c7b7.0p-81 },
+ { 0xd38000.0p-24, 0xc3890a.0p-26, -0x115e2cd714bd06.0p-80 },
+ { 0xd20000.0p-24, 0xcad2d7.0p-26, -0x1847f406ebd3b0.0p-82 },
+ { 0xd10000.0p-24, 0xcfb620.0p-26, 0x1c2259904d6866.0p-81 },
+ { 0xcf8000.0p-24, 0xd71653.0p-26, 0x1ece57a8d5ae55.0p-80 },
+ { 0xce0000.0p-24, 0xde843a.0p-26, -0x1f109d4bc45954.0p-81 },
+ { 0xcd0000.0p-24, 0xe37fde.0p-26, 0x1bc03dc271a74d.0p-81 },
+ { 0xcb8000.0p-24, 0xeb050c.0p-26, -0x1bf2badc0df842.0p-85 },
+ { 0xca0000.0p-24, 0xf29878.0p-26, -0x18efededd89fbe.0p-87 },
+ { 0xc90000.0p-24, 0xf7ad6f.0p-26, 0x1373ff977baa69.0p-81 },
+ { 0xc80000.0p-24, 0xfcc8e3.0p-26, 0x196766f2fb3283.0p-80 },
+ { 0xc68000.0p-24, 0x823f30.0p-25, 0x19bd076f7c434e.0p-79 },
+ { 0xc58000.0p-24, 0x84d52c.0p-25, -0x1a327257af0f46.0p-79 },
+ { 0xc40000.0p-24, 0x88bc74.0p-25, 0x113f23def19c5a.0p-81 },
+ { 0xc30000.0p-24, 0x8b5ae6.0p-25, 0x1759f6e6b37de9.0p-79 },
+ { 0xc20000.0p-24, 0x8dfccb.0p-25, 0x1ad35ca6ed5148.0p-81 },
+ { 0xc10000.0p-24, 0x90a22b.0p-25, 0x1a1d71a87deba4.0p-79 },
+ { 0xbf8000.0p-24, 0x94a0d8.0p-25, -0x139e5210c2b731.0p-80 },
+ { 0xbe8000.0p-24, 0x974f16.0p-25, -0x18f6ebcff3ed73.0p-81 },
+ { 0xbd8000.0p-24, 0x9a00f1.0p-25, -0x1aa268be39aab7.0p-79 },
+ { 0xbc8000.0p-24, 0x9cb672.0p-25, -0x14c8815839c566.0p-79 },
+ { 0xbb0000.0p-24, 0xa0cda1.0p-25, 0x1eaf46390dbb24.0p-81 },
+ { 0xba0000.0p-24, 0xa38c6e.0p-25, 0x138e20d831f698.0p-81 },
+ { 0xb90000.0p-24, 0xa64f05.0p-25, -0x1e8d3c41123616.0p-82 },
+ { 0xb80000.0p-24, 0xa91570.0p-25, 0x1ce28f5f3840b2.0p-80 },
+ { 0xb70000.0p-24, 0xabdfbb.0p-25, -0x186e5c0a424234.0p-79 },
+ { 0xb60000.0p-24, 0xaeadef.0p-25, -0x14d41a0b2a08a4.0p-83 },
+ { 0xb50000.0p-24, 0xb18018.0p-25, 0x16755892770634.0p-79 },
+ { 0xb40000.0p-24, 0xb45642.0p-25, -0x16395ebe59b152.0p-82 },
+ { 0xb30000.0p-24, 0xb73077.0p-25, 0x1abc65c8595f09.0p-80 },
+ { 0xb20000.0p-24, 0xba0ec4.0p-25, -0x1273089d3dad89.0p-79 },
+ { 0xb10000.0p-24, 0xbcf133.0p-25, 0x10f9f67b1f4bbf.0p-79 },
+ { 0xb00000.0p-24, 0xbfd7d2.0p-25, -0x109fab90486409.0p-80 },
+ { 0xaf0000.0p-24, 0xc2c2ac.0p-25, -0x1124680aa43333.0p-79 },
+ { 0xae8000.0p-24, 0xc439b3.0p-25, -0x1f360cc4710fc0.0p-80 },
+ { 0xad8000.0p-24, 0xc72afd.0p-25, -0x132d91f21d89c9.0p-80 },
+ { 0xac8000.0p-24, 0xca20a2.0p-25, -0x16bf9b4d1f8da8.0p-79 },
+ { 0xab8000.0p-24, 0xcd1aae.0p-25, 0x19deb5ce6a6a87.0p-81 },
+ { 0xaa8000.0p-24, 0xd0192f.0p-25, 0x1a29fb48f7d3cb.0p-79 },
+ { 0xaa0000.0p-24, 0xd19a20.0p-25, 0x1127d3c6457f9d.0p-81 },
+ { 0xa90000.0p-24, 0xd49f6a.0p-25, -0x1ba930e486a0ac.0p-81 },
+ { 0xa80000.0p-24, 0xd7a94b.0p-25, -0x1b6e645f31549e.0p-79 },
+ { 0xa70000.0p-24, 0xdab7d0.0p-25, 0x1118a425494b61.0p-80 },
+ { 0xa68000.0p-24, 0xdc40d5.0p-25, 0x1966f24d29d3a3.0p-80 },
+ { 0xa58000.0p-24, 0xdf566d.0p-25, -0x1d8e52eb2248f1.0p-82 },
+ { 0xa48000.0p-24, 0xe270ce.0p-25, -0x1ee370f96e6b68.0p-80 },
+ { 0xa40000.0p-24, 0xe3ffce.0p-25, 0x1d155324911f57.0p-80 },
+ { 0xa30000.0p-24, 0xe72179.0p-25, -0x1fe6e2f2f867d9.0p-80 },
+ { 0xa20000.0p-24, 0xea4812.0p-25, 0x1b7be9add7f4d4.0p-80 },
+ { 0xa18000.0p-24, 0xebdd3d.0p-25, 0x1b3cfb3f7511dd.0p-79 },
+ { 0xa08000.0p-24, 0xef0b5b.0p-25, -0x1220de1f730190.0p-79 },
+ { 0xa00000.0p-24, 0xf0a451.0p-25, -0x176364c9ac81cd.0p-80 },
+ { 0x9f0000.0p-24, 0xf3da16.0p-25, 0x1eed6b9aafac8d.0p-81 },
+ { 0x9e8000.0p-24, 0xf576e9.0p-25, 0x1d593218675af2.0p-79 },
+ { 0x9d8000.0p-24, 0xf8b47c.0p-25, -0x13e8eb7da053e0.0p-84 },
+ { 0x9d0000.0p-24, 0xfa553f.0p-25, 0x1c063259bcade0.0p-79 },
+ { 0x9c0000.0p-24, 0xfd9ac5.0p-25, 0x1ef491085fa3c1.0p-79 },
+ { 0x9b8000.0p-24, 0xff3f8c.0p-25, 0x1d607a7c2b8c53.0p-79 },
+ { 0x9a8000.0p-24, 0x814697.0p-24, -0x12ad3817004f3f.0p-78 },
+ { 0x9a0000.0p-24, 0x821b06.0p-24, -0x189fc53117f9e5.0p-81 },
+ { 0x990000.0p-24, 0x83c5f8.0p-24, 0x14cf15a048907b.0p-79 },
+ { 0x988000.0p-24, 0x849c7d.0p-24, 0x1cbb1d35fb8287.0p-78 },
+ { 0x978000.0p-24, 0x864ba6.0p-24, 0x1128639b814f9c.0p-78 },
+ { 0x970000.0p-24, 0x87244c.0p-24, 0x184733853300f0.0p-79 },
+ { 0x968000.0p-24, 0x87fdaa.0p-24, 0x109d23aef77dd6.0p-80 },
+ { 0x958000.0p-24, 0x89b293.0p-24, -0x1a81ef367a59de.0p-78 },
+ { 0x950000.0p-24, 0x8a8e20.0p-24, -0x121ad3dbb2f452.0p-78 },
+ { 0x948000.0p-24, 0x8b6a6a.0p-24, -0x1cfb981628af72.0p-79 },
+ { 0x938000.0p-24, 0x8d253a.0p-24, -0x1d21730ea76cfe.0p-79 },
+ { 0x930000.0p-24, 0x8e03c2.0p-24, 0x135cc00e566f77.0p-78 },
+ { 0x928000.0p-24, 0x8ee30d.0p-24, -0x10fcb5df257a26.0p-80 },
+ { 0x918000.0p-24, 0x90a3ee.0p-24, -0x16e171b15433d7.0p-79 },
+ { 0x910000.0p-24, 0x918587.0p-24, -0x1d050da07f3237.0p-79 },
+ { 0x908000.0p-24, 0x9267e7.0p-24, 0x1be03669a5268d.0p-79 },
+ { 0x8f8000.0p-24, 0x942f04.0p-24, 0x10b28e0e26c337.0p-79 },
+ { 0x8f0000.0p-24, 0x9513c3.0p-24, 0x1a1d820da57cf3.0p-78 },
+ { 0x8e8000.0p-24, 0x95f950.0p-24, -0x19ef8f13ae3cf1.0p-79 },
+ { 0x8e0000.0p-24, 0x96dfab.0p-24, -0x109e417a6e507c.0p-78 },
+ { 0x8d0000.0p-24, 0x98aed2.0p-24, 0x10d01a2c5b0e98.0p-79 },
+ { 0x8c8000.0p-24, 0x9997a2.0p-24, -0x1d6a50d4b61ea7.0p-78 },
+ { 0x8c0000.0p-24, 0x9a8145.0p-24, 0x1b3b190b83f952.0p-78 },
+ { 0x8b8000.0p-24, 0x9b6bbf.0p-24, 0x13a69fad7e7abe.0p-78 },
+ { 0x8b0000.0p-24, 0x9c5711.0p-24, -0x11cd12316f576b.0p-78 },
+ { 0x8a8000.0p-24, 0x9d433b.0p-24, 0x1c95c444b807a2.0p-79 },
+ { 0x898000.0p-24, 0x9f1e22.0p-24, -0x1b9c224ea698c3.0p-79 },
+ { 0x890000.0p-24, 0xa00ce1.0p-24, 0x125ca93186cf0f.0p-81 },
+ { 0x888000.0p-24, 0xa0fc80.0p-24, -0x1ee38a7bc228b3.0p-79 },
+ { 0x880000.0p-24, 0xa1ed00.0p-24, -0x1a0db876613d20.0p-78 },
+ { 0x878000.0p-24, 0xa2de62.0p-24, 0x193224e8516c01.0p-79 },
+ { 0x870000.0p-24, 0xa3d0a9.0p-24, 0x1fa28b4d2541ad.0p-79 },
+ { 0x868000.0p-24, 0xa4c3d6.0p-24, 0x1c1b5760fb4572.0p-78 },
+ { 0x858000.0p-24, 0xa6acea.0p-24, 0x1fed5d0f65949c.0p-80 },
+ { 0x850000.0p-24, 0xa7a2d4.0p-24, 0x1ad270c9d74936.0p-80 },
+ { 0x848000.0p-24, 0xa899ab.0p-24, 0x199ff15ce53266.0p-79 },
+ { 0x840000.0p-24, 0xa99171.0p-24, 0x1a19e15ccc45d2.0p-79 },
+ { 0x838000.0p-24, 0xaa8a28.0p-24, -0x121a14ec532b36.0p-80 },
+ { 0x830000.0p-24, 0xab83d1.0p-24, 0x1aee319980bff3.0p-79 },
+ { 0x828000.0p-24, 0xac7e6f.0p-24, -0x18ffd9e3900346.0p-80 },
+ { 0x820000.0p-24, 0xad7a03.0p-24, -0x1e4db102ce29f8.0p-80 },
+ { 0x818000.0p-24, 0xae768f.0p-24, 0x17c35c55a04a83.0p-81 },
+ { 0x810000.0p-24, 0xaf7415.0p-24, 0x1448324047019b.0p-78 },
+ { 0x808000.0p-24, 0xb07298.0p-24, -0x1750ee3915a198.0p-78 },
+ { 0x800000.0p-24, 0xb17218.0p-24, -0x105c610ca86c39.0p-81 },
};
#ifdef USE_UTAB
@@ -288,135 +288,135 @@ static const struct {
float H; /* 1 + i/INTERVALS (exact) */
float E; /* H(i) * G(i) - 1 (exact) */
} U[TSIZE] = {
- 0x800000.0p-23, 0,
- 0x810000.0p-23, -0x800000.0p-37,
- 0x820000.0p-23, -0x800000.0p-35,
- 0x830000.0p-23, -0x900000.0p-34,
- 0x840000.0p-23, -0x800000.0p-33,
- 0x850000.0p-23, -0xc80000.0p-33,
- 0x860000.0p-23, -0xa00000.0p-36,
- 0x870000.0p-23, 0x940000.0p-33,
- 0x880000.0p-23, 0x800000.0p-35,
- 0x890000.0p-23, -0xc80000.0p-34,
- 0x8a0000.0p-23, 0xe00000.0p-36,
- 0x8b0000.0p-23, 0x900000.0p-33,
- 0x8c0000.0p-23, -0x800000.0p-35,
- 0x8d0000.0p-23, -0xe00000.0p-33,
- 0x8e0000.0p-23, 0x880000.0p-33,
- 0x8f0000.0p-23, -0xa80000.0p-34,
- 0x900000.0p-23, -0x800000.0p-35,
- 0x910000.0p-23, 0x800000.0p-37,
- 0x920000.0p-23, 0x900000.0p-35,
- 0x930000.0p-23, 0xd00000.0p-35,
- 0x940000.0p-23, 0xe00000.0p-35,
- 0x950000.0p-23, 0xc00000.0p-35,
- 0x960000.0p-23, 0xe00000.0p-36,
- 0x970000.0p-23, -0x800000.0p-38,
- 0x980000.0p-23, -0xc00000.0p-35,
- 0x990000.0p-23, -0xd00000.0p-34,
- 0x9a0000.0p-23, 0x880000.0p-33,
- 0x9b0000.0p-23, 0xe80000.0p-35,
- 0x9c0000.0p-23, -0x800000.0p-35,
- 0x9d0000.0p-23, 0xb40000.0p-33,
- 0x9e0000.0p-23, 0x880000.0p-34,
- 0x9f0000.0p-23, -0xe00000.0p-35,
- 0xa00000.0p-23, 0x800000.0p-33,
- 0xa10000.0p-23, -0x900000.0p-36,
- 0xa20000.0p-23, -0xb00000.0p-33,
- 0xa30000.0p-23, -0xa00000.0p-36,
- 0xa40000.0p-23, 0x800000.0p-33,
- 0xa50000.0p-23, -0xf80000.0p-35,
- 0xa60000.0p-23, 0x880000.0p-34,
- 0xa70000.0p-23, -0x900000.0p-33,
- 0xa80000.0p-23, -0x800000.0p-35,
- 0xa90000.0p-23, 0x900000.0p-34,
- 0xaa0000.0p-23, 0xa80000.0p-33,
- 0xab0000.0p-23, -0xac0000.0p-34,
- 0xac0000.0p-23, -0x800000.0p-37,
- 0xad0000.0p-23, 0xf80000.0p-35,
- 0xae0000.0p-23, 0xf80000.0p-34,
- 0xaf0000.0p-23, -0xac0000.0p-33,
- 0xb00000.0p-23, -0x800000.0p-33,
- 0xb10000.0p-23, -0xb80000.0p-34,
- 0xb20000.0p-23, -0x800000.0p-34,
- 0xb30000.0p-23, -0xb00000.0p-35,
- 0xb40000.0p-23, -0x800000.0p-35,
- 0xb50000.0p-23, -0xe00000.0p-36,
- 0xb60000.0p-23, -0x800000.0p-35,
- 0xb70000.0p-23, -0xb00000.0p-35,
- 0xb80000.0p-23, -0x800000.0p-34,
- 0xb90000.0p-23, -0xb80000.0p-34,
- 0xba0000.0p-23, -0x800000.0p-33,
- 0xbb0000.0p-23, -0xac0000.0p-33,
- 0xbc0000.0p-23, 0x980000.0p-33,
- 0xbd0000.0p-23, 0xbc0000.0p-34,
- 0xbe0000.0p-23, 0xe00000.0p-36,
- 0xbf0000.0p-23, -0xb80000.0p-35,
- 0xc00000.0p-23, -0x800000.0p-33,
- 0xc10000.0p-23, 0xa80000.0p-33,
- 0xc20000.0p-23, 0x900000.0p-34,
- 0xc30000.0p-23, -0x800000.0p-35,
- 0xc40000.0p-23, -0x900000.0p-33,
- 0xc50000.0p-23, 0x820000.0p-33,
- 0xc60000.0p-23, 0x800000.0p-38,
- 0xc70000.0p-23, -0x820000.0p-33,
- 0xc80000.0p-23, 0x800000.0p-33,
- 0xc90000.0p-23, -0xa00000.0p-36,
- 0xca0000.0p-23, -0xb00000.0p-33,
- 0xcb0000.0p-23, 0x840000.0p-34,
- 0xcc0000.0p-23, -0xd00000.0p-34,
- 0xcd0000.0p-23, 0x800000.0p-33,
- 0xce0000.0p-23, -0xe00000.0p-35,
- 0xcf0000.0p-23, 0xa60000.0p-33,
- 0xd00000.0p-23, -0x800000.0p-35,
- 0xd10000.0p-23, 0xb40000.0p-33,
- 0xd20000.0p-23, -0x800000.0p-35,
- 0xd30000.0p-23, 0xaa0000.0p-33,
- 0xd40000.0p-23, -0xe00000.0p-35,
- 0xd50000.0p-23, 0x880000.0p-33,
- 0xd60000.0p-23, -0xd00000.0p-34,
- 0xd70000.0p-23, 0x9c0000.0p-34,
- 0xd80000.0p-23, -0xb00000.0p-33,
- 0xd90000.0p-23, -0x800000.0p-38,
- 0xda0000.0p-23, 0xa40000.0p-33,
- 0xdb0000.0p-23, -0xdc0000.0p-34,
- 0xdc0000.0p-23, 0xc00000.0p-35,
- 0xdd0000.0p-23, 0xca0000.0p-33,
- 0xde0000.0p-23, -0xb80000.0p-34,
- 0xdf0000.0p-23, 0xd00000.0p-35,
- 0xe00000.0p-23, 0xc00000.0p-33,
- 0xe10000.0p-23, -0xf40000.0p-34,
- 0xe20000.0p-23, 0x800000.0p-37,
- 0xe30000.0p-23, 0x860000.0p-33,
- 0xe40000.0p-23, -0xc80000.0p-33,
- 0xe50000.0p-23, -0xa80000.0p-34,
- 0xe60000.0p-23, 0xe00000.0p-36,
- 0xe70000.0p-23, 0x880000.0p-33,
- 0xe80000.0p-23, -0xe00000.0p-33,
- 0xe90000.0p-23, -0xfc0000.0p-34,
- 0xea0000.0p-23, -0x800000.0p-35,
- 0xeb0000.0p-23, 0xe80000.0p-35,
- 0xec0000.0p-23, 0x900000.0p-33,
- 0xed0000.0p-23, 0xe20000.0p-33,
- 0xee0000.0p-23, -0xac0000.0p-33,
- 0xef0000.0p-23, -0xc80000.0p-34,
- 0xf00000.0p-23, -0x800000.0p-35,
- 0xf10000.0p-23, 0x800000.0p-35,
- 0xf20000.0p-23, 0xb80000.0p-34,
- 0xf30000.0p-23, 0x940000.0p-33,
- 0xf40000.0p-23, 0xc80000.0p-33,
- 0xf50000.0p-23, -0xf20000.0p-33,
- 0xf60000.0p-23, -0xc80000.0p-33,
- 0xf70000.0p-23, -0xa20000.0p-33,
- 0xf80000.0p-23, -0x800000.0p-33,
- 0xf90000.0p-23, -0xc40000.0p-34,
- 0xfa0000.0p-23, -0x900000.0p-34,
- 0xfb0000.0p-23, -0xc80000.0p-35,
- 0xfc0000.0p-23, -0x800000.0p-35,
- 0xfd0000.0p-23, -0x900000.0p-36,
- 0xfe0000.0p-23, -0x800000.0p-37,
- 0xff0000.0p-23, -0x800000.0p-39,
- 0x800000.0p-22, 0,
+ { 0x800000.0p-23, 0 },
+ { 0x810000.0p-23, -0x800000.0p-37 },
+ { 0x820000.0p-23, -0x800000.0p-35 },
+ { 0x830000.0p-23, -0x900000.0p-34 },
+ { 0x840000.0p-23, -0x800000.0p-33 },
+ { 0x850000.0p-23, -0xc80000.0p-33 },
+ { 0x860000.0p-23, -0xa00000.0p-36 },
+ { 0x870000.0p-23, 0x940000.0p-33 },
+ { 0x880000.0p-23, 0x800000.0p-35 },
+ { 0x890000.0p-23, -0xc80000.0p-34 },
+ { 0x8a0000.0p-23, 0xe00000.0p-36 },
+ { 0x8b0000.0p-23, 0x900000.0p-33 },
+ { 0x8c0000.0p-23, -0x800000.0p-35 },
+ { 0x8d0000.0p-23, -0xe00000.0p-33 },
+ { 0x8e0000.0p-23, 0x880000.0p-33 },
+ { 0x8f0000.0p-23, -0xa80000.0p-34 },
+ { 0x900000.0p-23, -0x800000.0p-35 },
+ { 0x910000.0p-23, 0x800000.0p-37 },
+ { 0x920000.0p-23, 0x900000.0p-35 },
+ { 0x930000.0p-23, 0xd00000.0p-35 },
+ { 0x940000.0p-23, 0xe00000.0p-35 },
+ { 0x950000.0p-23, 0xc00000.0p-35 },
+ { 0x960000.0p-23, 0xe00000.0p-36 },
+ { 0x970000.0p-23, -0x800000.0p-38 },
+ { 0x980000.0p-23, -0xc00000.0p-35 },
+ { 0x990000.0p-23, -0xd00000.0p-34 },
+ { 0x9a0000.0p-23, 0x880000.0p-33 },
+ { 0x9b0000.0p-23, 0xe80000.0p-35 },
+ { 0x9c0000.0p-23, -0x800000.0p-35 },
+ { 0x9d0000.0p-23, 0xb40000.0p-33 },
+ { 0x9e0000.0p-23, 0x880000.0p-34 },
+ { 0x9f0000.0p-23, -0xe00000.0p-35 },
+ { 0xa00000.0p-23, 0x800000.0p-33 },
+ { 0xa10000.0p-23, -0x900000.0p-36 },
+ { 0xa20000.0p-23, -0xb00000.0p-33 },
+ { 0xa30000.0p-23, -0xa00000.0p-36 },
+ { 0xa40000.0p-23, 0x800000.0p-33 },
+ { 0xa50000.0p-23, -0xf80000.0p-35 },
+ { 0xa60000.0p-23, 0x880000.0p-34 },
+ { 0xa70000.0p-23, -0x900000.0p-33 },
+ { 0xa80000.0p-23, -0x800000.0p-35 },
+ { 0xa90000.0p-23, 0x900000.0p-34 },
+ { 0xaa0000.0p-23, 0xa80000.0p-33 },
+ { 0xab0000.0p-23, -0xac0000.0p-34 },
+ { 0xac0000.0p-23, -0x800000.0p-37 },
+ { 0xad0000.0p-23, 0xf80000.0p-35 },
+ { 0xae0000.0p-23, 0xf80000.0p-34 },
+ { 0xaf0000.0p-23, -0xac0000.0p-33 },
+ { 0xb00000.0p-23, -0x800000.0p-33 },
+ { 0xb10000.0p-23, -0xb80000.0p-34 },
+ { 0xb20000.0p-23, -0x800000.0p-34 },
+ { 0xb30000.0p-23, -0xb00000.0p-35 },
+ { 0xb40000.0p-23, -0x800000.0p-35 },
+ { 0xb50000.0p-23, -0xe00000.0p-36 },
+ { 0xb60000.0p-23, -0x800000.0p-35 },
+ { 0xb70000.0p-23, -0xb00000.0p-35 },
+ { 0xb80000.0p-23, -0x800000.0p-34 },
+ { 0xb90000.0p-23, -0xb80000.0p-34 },
+ { 0xba0000.0p-23, -0x800000.0p-33 },
+ { 0xbb0000.0p-23, -0xac0000.0p-33 },
+ { 0xbc0000.0p-23, 0x980000.0p-33 },
+ { 0xbd0000.0p-23, 0xbc0000.0p-34 },
+ { 0xbe0000.0p-23, 0xe00000.0p-36 },
+ { 0xbf0000.0p-23, -0xb80000.0p-35 },
+ { 0xc00000.0p-23, -0x800000.0p-33 },
+ { 0xc10000.0p-23, 0xa80000.0p-33 },
+ { 0xc20000.0p-23, 0x900000.0p-34 },
+ { 0xc30000.0p-23, -0x800000.0p-35 },
+ { 0xc40000.0p-23, -0x900000.0p-33 },
+ { 0xc50000.0p-23, 0x820000.0p-33 },
+ { 0xc60000.0p-23, 0x800000.0p-38 },
+ { 0xc70000.0p-23, -0x820000.0p-33 },
+ { 0xc80000.0p-23, 0x800000.0p-33 },
+ { 0xc90000.0p-23, -0xa00000.0p-36 },
+ { 0xca0000.0p-23, -0xb00000.0p-33 },
+ { 0xcb0000.0p-23, 0x840000.0p-34 },
+ { 0xcc0000.0p-23, -0xd00000.0p-34 },
+ { 0xcd0000.0p-23, 0x800000.0p-33 },
+ { 0xce0000.0p-23, -0xe00000.0p-35 },
+ { 0xcf0000.0p-23, 0xa60000.0p-33 },
+ { 0xd00000.0p-23, -0x800000.0p-35 },
+ { 0xd10000.0p-23, 0xb40000.0p-33 },
+ { 0xd20000.0p-23, -0x800000.0p-35 },
+ { 0xd30000.0p-23, 0xaa0000.0p-33 },
+ { 0xd40000.0p-23, -0xe00000.0p-35 },
+ { 0xd50000.0p-23, 0x880000.0p-33 },
+ { 0xd60000.0p-23, -0xd00000.0p-34 },
+ { 0xd70000.0p-23, 0x9c0000.0p-34 },
+ { 0xd80000.0p-23, -0xb00000.0p-33 },
+ { 0xd90000.0p-23, -0x800000.0p-38 },
+ { 0xda0000.0p-23, 0xa40000.0p-33 },
+ { 0xdb0000.0p-23, -0xdc0000.0p-34 },
+ { 0xdc0000.0p-23, 0xc00000.0p-35 },
+ { 0xdd0000.0p-23, 0xca0000.0p-33 },
+ { 0xde0000.0p-23, -0xb80000.0p-34 },
+ { 0xdf0000.0p-23, 0xd00000.0p-35 },
+ { 0xe00000.0p-23, 0xc00000.0p-33 },
+ { 0xe10000.0p-23, -0xf40000.0p-34 },
+ { 0xe20000.0p-23, 0x800000.0p-37 },
+ { 0xe30000.0p-23, 0x860000.0p-33 },
+ { 0xe40000.0p-23, -0xc80000.0p-33 },
+ { 0xe50000.0p-23, -0xa80000.0p-34 },
+ { 0xe60000.0p-23, 0xe00000.0p-36 },
+ { 0xe70000.0p-23, 0x880000.0p-33 },
+ { 0xe80000.0p-23, -0xe00000.0p-33 },
+ { 0xe90000.0p-23, -0xfc0000.0p-34 },
+ { 0xea0000.0p-23, -0x800000.0p-35 },
+ { 0xeb0000.0p-23, 0xe80000.0p-35 },
+ { 0xec0000.0p-23, 0x900000.0p-33 },
+ { 0xed0000.0p-23, 0xe20000.0p-33 },
+ { 0xee0000.0p-23, -0xac0000.0p-33 },
+ { 0xef0000.0p-23, -0xc80000.0p-34 },
+ { 0xf00000.0p-23, -0x800000.0p-35 },
+ { 0xf10000.0p-23, 0x800000.0p-35 },
+ { 0xf20000.0p-23, 0xb80000.0p-34 },
+ { 0xf30000.0p-23, 0x940000.0p-33 },
+ { 0xf40000.0p-23, 0xc80000.0p-33 },
+ { 0xf50000.0p-23, -0xf20000.0p-33 },
+ { 0xf60000.0p-23, -0xc80000.0p-33 },
+ { 0xf70000.0p-23, -0xa20000.0p-33 },
+ { 0xf80000.0p-23, -0x800000.0p-33 },
+ { 0xf90000.0p-23, -0xc40000.0p-34 },
+ { 0xfa0000.0p-23, -0x900000.0p-34 },
+ { 0xfb0000.0p-23, -0xc80000.0p-35 },
+ { 0xfc0000.0p-23, -0x800000.0p-35 },
+ { 0xfd0000.0p-23, -0x900000.0p-36 },
+ { 0xfe0000.0p-23, -0x800000.0p-37 },
+ { 0xff0000.0p-23, -0x800000.0p-39 },
+ { 0x800000.0p-22, 0 },
};
#endif /* USE_UTAB */
diff --git a/lib/msun/man/cacos.3 b/lib/msun/man/cacos.3
index 02f3f74..6d9f20a 100644
--- a/lib/msun/man/cacos.3
+++ b/lib/msun/man/cacos.3
@@ -24,23 +24,29 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Jul 14, 2015
+.Dd February 15, 2017
.Dt CACOS 3
.Os
.Sh NAME
.Nm cacos ,
.Nm cacosf ,
+.Nm cacosl ,
.Nm cacosh ,
.Nm cacoshf ,
+.Nm cacoshl ,
.Nm casin ,
-.Nm casinf
+.Nm casinf ,
+.Nm casinl ,
.Nm casinh ,
-.Nm casinhf
-.Nm catan ,
-.Nm catanf
+.Nm casinhf ,
+.Nm casinhl ,
+.Nm catan ,
+.Nm catanf ,
+.Nm catanl ,
.Nm catanh ,
-.Nm catanhf
-.Nd complex arc trigonometric and hyperbolic functions
+.Nm catanhf ,
+.Nm catanhl
+.Nd complex inverse trigonometric and hyperbolic functions
.Sh LIBRARY
.Lb libm
.Sh SYNOPSIS
@@ -49,26 +55,38 @@
.Fn cacos "double complex z"
.Ft float complex
.Fn cacosf "float complex z"
+.Ft long double complex
+.Fn cacosl "long double complex z"
.Ft double complex
.Fn cacosh "double complex z"
.Ft float complex
.Fn cacoshf "float complex z"
+.Ft long double complex
+.Fn cacoshl "long double complex z"
.Ft double complex
.Fn casin "double complex z"
.Ft float complex
.Fn casinf "float complex z"
+.Ft long double complex
+.Fn casinl "long double complex z"
.Ft double complex
.Fn casinh "double complex z"
.Ft float complex
.Fn casinhf "float complex z"
+.Ft long double complex
+.Fn casinhl "long double complex z"
.Ft double complex
.Fn catan "double complex z"
.Ft float complex
.Fn catanf "float complex z"
+.Ft long double complex
+.Fn catanl "long double complex z"
.Ft double complex
.Fn catanh "double complex z"
.Ft float complex
.Fn catanhf "float complex z"
+.Ft long double complex
+.Fn catanhl "long double complex z"
.Sh DESCRIPTION
The
.Fn cacos ,
@@ -97,10 +115,22 @@ and
functions perform the same operations in
.Fa float
precision.
+The
+.Fn cacosl ,
+.Fn casinl ,
+.Fn catanl
+.Fn cacoshl ,
+.Fn casinhl ,
+and
+.Fn catanhl
+functions perform the same operations in
+.Fa long double
+precision.
.Pp
.ds Un \[cu]
There is no universal convention for defining the principal values of
-these functions. The following table gives the branch cuts, and the
+these functions.
+The following table gives the branch cuts, and the
corresponding ranges for the return values, adopted by the C language.
.Bl -column ".Sy Function" ".Sy (-\*(If*I, -I) \*(Un (I, \*(If*I)" ".Sy [-\*(Pi/2*I, \*(Pi/2*I]"
.It Sy Function Ta Sy Branch Cut(s) Ta Sy Range
diff --git a/lib/msun/man/sincos.3 b/lib/msun/man/sincos.3
new file mode 100644
index 0000000..9c42a96
--- /dev/null
+++ b/lib/msun/man/sincos.3
@@ -0,0 +1,82 @@
+.\" Copyright (c) 2011 Steven G. Kargl.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 12, 2011
+.Dt SINCOS 3
+.Os
+.Sh NAME
+.Nm sincos ,
+.Nm sincosf ,
+.Nm sincosl
+.Nd sine and cosine functions
+.Sh LIBRARY
+.Lb libm
+.Sh SYNOPSIS
+.In math.h
+.Ft void
+.Fn sincos "double x" "double *s" "double *c"
+.Ft void
+.Fn sincosf "float x" "float *s" "float *c"
+.Ft void
+.Fn sincosl "long double x" "long double *s" "long double *c"
+.Sh DESCRIPTION
+The
+.Fn sincos ,
+.Fn sincosf ,
+and
+.Fn sincosl
+functions compute the sine and cosine of
+.Fa x .
+Using these functions allows argument reduction to occur only
+once instead of twice with individual invocations of
+.Fn sin
+and
+.Fn cos .
+Like
+.Fn sin
+and
+.Fn cos ,
+a large magnitude argument may yield a result with little
+or no significance.
+.Sh RETURN VALUES
+Upon returning from
+.Fn sincos ,
+.Fn sincosf ,
+and
+.Fn sincosl ,
+the memory pointed to by
+.Ar "*s"
+and
+.Ar "*c"
+are assigned the values of sine and cosine, respectively.
+.Sh SEE ALSO
+.Xr cos 3 ,
+.Xr sin 3 ,
+.Sh HISTORY
+These functions were added to
+.Fx 9.0
+to aid in writing various complex function contained in
+.St -isoC-99 .
+
diff --git a/lib/msun/src/catrig.c b/lib/msun/src/catrig.c
index f392862..ebfe356 100644
--- a/lib/msun/src/catrig.c
+++ b/lib/msun/src/catrig.c
@@ -637,3 +637,12 @@ catan(double complex z)
return (CMPLX(cimag(w), creal(w)));
}
+
+#if LDBL_MANT_DIG == 53
+__weak_reference(cacosh, cacoshl);
+__weak_reference(cacos, cacosl);
+__weak_reference(casinh, casinhl);
+__weak_reference(casin, casinl);
+__weak_reference(catanh, catanhl);
+__weak_reference(catan, catanl);
+#endif
diff --git a/lib/msun/src/catrigl.c b/lib/msun/src/catrigl.c
new file mode 100644
index 0000000..b798570
--- /dev/null
+++ b/lib/msun/src/catrigl.c
@@ -0,0 +1,417 @@
+/*-
+ * Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
+ * Copyright (c) 2017 Mahdi Mokhtari <mmokhi@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * The algorithm is very close to that in "Implementing the complex arcsine
+ * and arccosine functions using exception handling" by T. E. Hull, Thomas F.
+ * Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
+ * Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
+ * http://dl.acm.org/citation.cfm?id=275324.
+ *
+ * See catrig.c for complete comments.
+ *
+ * XXX comments were removed automatically, and even short ones on the right
+ * of statements were removed (all of them), contrary to normal style. Only
+ * a few comments on the right of declarations remain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <complex.h>
+#include <float.h>
+
+#include "invtrig.h"
+#include "math.h"
+#include "math_private.h"
+
+#undef isinf
+#define isinf(x) (fabsl(x) == INFINITY)
+#undef isnan
+#define isnan(x) ((x) != (x))
+#define raise_inexact() do { volatile float junk __unused = 1 + tiny; } while(0)
+#undef signbit
+#define signbit(x) (__builtin_signbitl(x))
+
+#if LDBL_MAX_EXP != 0x4000
+#error "Unsupported long double format"
+#endif
+
+static const long double
+A_crossover = 10,
+B_crossover = 0.6417,
+FOUR_SQRT_MIN = 0x1p-8189L,
+HALF_MAX = 0x1p16383L,
+QUARTER_SQRT_MAX = 0x1p8189L,
+RECIP_EPSILON = 1 / LDBL_EPSILON,
+SQRT_MIN = 0x1p-8191L;
+
+#if LDBL_MANT_DIG == 64
+static const union IEEEl2bits
+um_e = LD80C(0xadf85458a2bb4a9b, 1, 2.71828182845904523536e+0L),
+um_ln2 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309417e-1L);
+#define m_e um_e.e
+#define m_ln2 um_ln2.e
+static const long double
+/* The next 2 literals for non-i386. Misrounding them on i386 is harmless. */
+SQRT_3_EPSILON = 5.70316273435758915310e-10, /* 0x9cc470a0490973e8.0p-94 */
+SQRT_6_EPSILON = 8.06549008734932771664e-10; /* 0xddb3d742c265539e.0p-94 */
+#elif LDBL_MANT_DIG == 113
+static const long double
+m_e = 2.71828182845904523536028747135266250e0L, /* 0x15bf0a8b1457695355fb8ac404e7a.0p-111 */
+m_ln2 = 6.93147180559945309417232121458176568e-1L, /* 0x162e42fefa39ef35793c7673007e6.0p-113 */
+SQRT_3_EPSILON = 2.40370335797945490975336727199878124e-17, /* 0x1bb67ae8584caa73b25742d7078b8.0p-168 */
+SQRT_6_EPSILON = 3.39934988877629587239082586223300391e-17; /* 0x13988e1409212e7d0321914321a55.0p-167 */
+#else
+#error "Unsupported long double format"
+#endif
+
+static const volatile float
+tiny = 0x1p-100;
+
+static long double complex clog_for_large_values(long double complex z);
+
+static inline long double
+f(long double a, long double b, long double hypot_a_b)
+{
+ if (b < 0)
+ return ((hypot_a_b - b) / 2);
+ if (b == 0)
+ return (a / 2);
+ return (a * a / (hypot_a_b + b) / 2);
+}
+
+static inline void
+do_hard_work(long double x, long double y, long double *rx, int *B_is_usable,
+ long double *B, long double *sqrt_A2my2, long double *new_y)
+{
+ long double R, S, A;
+ long double Am1, Amy;
+
+ R = hypotl(x, y + 1);
+ S = hypotl(x, y - 1);
+
+ A = (R + S) / 2;
+ if (A < 1)
+ A = 1;
+
+ if (A < A_crossover) {
+ if (y == 1 && x < LDBL_EPSILON * LDBL_EPSILON / 128) {
+ *rx = sqrtl(x);
+ } else if (x >= LDBL_EPSILON * fabsl(y - 1)) {
+ Am1 = f(x, 1 + y, R) + f(x, 1 - y, S);
+ *rx = log1pl(Am1 + sqrtl(Am1 * (A + 1)));
+ } else if (y < 1) {
+ *rx = x / sqrtl((1 - y) * (1 + y));
+ } else {
+ *rx = log1pl((y - 1) + sqrtl((y - 1) * (y + 1)));
+ }
+ } else {
+ *rx = logl(A + sqrtl(A * A - 1));
+ }
+
+ *new_y = y;
+
+ if (y < FOUR_SQRT_MIN) {
+ *B_is_usable = 0;
+ *sqrt_A2my2 = A * (2 / LDBL_EPSILON);
+ *new_y = y * (2 / LDBL_EPSILON);
+ return;
+ }
+
+ *B = y / A;
+ *B_is_usable = 1;
+
+ if (*B > B_crossover) {
+ *B_is_usable = 0;
+ if (y == 1 && x < LDBL_EPSILON / 128) {
+ *sqrt_A2my2 = sqrtl(x) * sqrtl((A + y) / 2);
+ } else if (x >= LDBL_EPSILON * fabsl(y - 1)) {
+ Amy = f(x, y + 1, R) + f(x, y - 1, S);
+ *sqrt_A2my2 = sqrtl(Amy * (A + y));
+ } else if (y > 1) {
+ *sqrt_A2my2 = x * (4 / LDBL_EPSILON / LDBL_EPSILON) * y /
+ sqrtl((y + 1) * (y - 1));
+ *new_y = y * (4 / LDBL_EPSILON / LDBL_EPSILON);
+ } else {
+ *sqrt_A2my2 = sqrtl((1 - y) * (1 + y));
+ }
+ }
+}
+
+long double complex
+casinhl(long double complex z)
+{
+ long double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
+ int B_is_usable;
+ long double complex w;
+
+ x = creall(z);
+ y = cimagl(z);
+ ax = fabsl(x);
+ ay = fabsl(y);
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (CMPLXL(x, y + y));
+ if (isinf(y))
+ return (CMPLXL(y, x + x));
+ if (y == 0)
+ return (CMPLXL(x + x, y));
+ return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ if (signbit(x) == 0)
+ w = clog_for_large_values(z) + m_ln2;
+ else
+ w = clog_for_large_values(-z) + m_ln2;
+ return (CMPLXL(copysignl(creall(w), x),
+ copysignl(cimagl(w), y)));
+ }
+
+ if (x == 0 && y == 0)
+ return (z);
+
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (z);
+
+ do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
+ if (B_is_usable)
+ ry = asinl(B);
+ else
+ ry = atan2l(new_y, sqrt_A2my2);
+ return (CMPLXL(copysignl(rx, x), copysignl(ry, y)));
+}
+
+long double complex
+casinl(long double complex z)
+{
+ long double complex w;
+
+ w = casinhl(CMPLXL(cimagl(z), creall(z)));
+ return (CMPLXL(cimagl(w), creall(w)));
+}
+
+long double complex
+cacosl(long double complex z)
+{
+ long double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
+ int sx, sy;
+ int B_is_usable;
+ long double complex w;
+
+ x = creall(z);
+ y = cimagl(z);
+ sx = signbit(x);
+ sy = signbit(y);
+ ax = fabsl(x);
+ ay = fabsl(y);
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (CMPLXL(y + y, -INFINITY));
+ if (isinf(y))
+ return (CMPLXL(x + x, -y));
+ if (x == 0)
+ return (CMPLXL(pio2_hi + pio2_lo, y + y));
+ return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
+ w = clog_for_large_values(z);
+ rx = fabsl(cimagl(w));
+ ry = creall(w) + m_ln2;
+ if (sy == 0)
+ ry = -ry;
+ return (CMPLXL(rx, ry));
+ }
+
+ if (x == 1 && y == 0)
+ return (CMPLXL(0, -y));
+
+ raise_inexact();
+
+ if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
+ return (CMPLXL(pio2_hi - (x - pio2_lo), -y));
+
+ do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
+ if (B_is_usable) {
+ if (sx == 0)
+ rx = acosl(B);
+ else
+ rx = acosl(-B);
+ } else {
+ if (sx == 0)
+ rx = atan2l(sqrt_A2mx2, new_x);
+ else
+ rx = atan2l(sqrt_A2mx2, -new_x);
+ }
+ if (sy == 0)
+ ry = -ry;
+ return (CMPLXL(rx, ry));
+}
+
+long double complex
+cacoshl(long double complex z)
+{
+ long double complex w;
+ long double rx, ry;
+
+ w = cacosl(z);
+ rx = creall(w);
+ ry = cimagl(w);
+ if (isnan(rx) && isnan(ry))
+ return (CMPLXL(ry, rx));
+ if (isnan(rx))
+ return (CMPLXL(fabsl(ry), rx));
+ if (isnan(ry))
+ return (CMPLXL(ry, ry));
+ return (CMPLXL(fabsl(ry), copysignl(rx, cimagl(z))));
+}
+
+static long double complex
+clog_for_large_values(long double complex z)
+{
+ long double x, y;
+ long double ax, ay, t;
+
+ x = creall(z);
+ y = cimagl(z);
+ ax = fabsl(x);
+ ay = fabsl(y);
+ if (ax < ay) {
+ t = ax;
+ ax = ay;
+ ay = t;
+ }
+
+ if (ax > HALF_MAX)
+ return (CMPLXL(logl(hypotl(x / m_e, y / m_e)) + 1,
+ atan2l(y, x)));
+
+ if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
+ return (CMPLXL(logl(hypotl(x, y)), atan2l(y, x)));
+
+ return (CMPLXL(logl(ax * ax + ay * ay) / 2, atan2l(y, x)));
+}
+
+static inline long double
+sum_squares(long double x, long double y)
+{
+
+ if (y < SQRT_MIN)
+ return (x * x);
+
+ return (x * x + y * y);
+}
+
+static inline long double
+real_part_reciprocal(long double x, long double y)
+{
+ long double scale;
+ uint16_t hx, hy;
+ int16_t ix, iy;
+
+ GET_LDBL_EXPSIGN(hx, x);
+ ix = hx & 0x7fff;
+ GET_LDBL_EXPSIGN(hy, y);
+ iy = hy & 0x7fff;
+#define BIAS (LDBL_MAX_EXP - 1)
+#define CUTOFF (LDBL_MANT_DIG / 2 + 1)
+ if (ix - iy >= CUTOFF || isinf(x))
+ return (1 / x);
+ if (iy - ix >= CUTOFF)
+ return (x / y / y);
+ if (ix <= BIAS + LDBL_MAX_EXP / 2 - CUTOFF)
+ return (x / (x * x + y * y));
+ scale = 1;
+ SET_LDBL_EXPSIGN(scale, 0x7fff - ix);
+ x *= scale;
+ y *= scale;
+ return (x / (x * x + y * y) * scale);
+}
+
+long double complex
+catanhl(long double complex z)
+{
+ long double x, y, ax, ay, rx, ry;
+
+ x = creall(z);
+ y = cimagl(z);
+ ax = fabsl(x);
+ ay = fabsl(y);
+
+ if (y == 0 && ax <= 1)
+ return (CMPLXL(atanhl(x), y));
+
+ if (x == 0)
+ return (CMPLXL(x, atanl(y)));
+
+ if (isnan(x) || isnan(y)) {
+ if (isinf(x))
+ return (CMPLXL(copysignl(0, x), y + y));
+ if (isinf(y))
+ return (CMPLXL(copysignl(0, x),
+ copysignl(pio2_hi + pio2_lo, y)));
+ return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0)));
+ }
+
+ if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
+ return (CMPLXL(real_part_reciprocal(x, y),
+ copysignl(pio2_hi + pio2_lo, y)));
+
+ if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) {
+ raise_inexact();
+ return (z);
+ }
+
+ if (ax == 1 && ay < LDBL_EPSILON)
+ rx = (m_ln2 - logl(ay)) / 2;
+ else
+ rx = log1pl(4 * ax / sum_squares(ax - 1, ay)) / 4;
+
+ if (ax == 1)
+ ry = atan2l(2, -ay) / 2;
+ else if (ay < LDBL_EPSILON)
+ ry = atan2l(2 * ay, (1 - ax) * (1 + ax)) / 2;
+ else
+ ry = atan2l(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
+
+ return (CMPLXL(copysignl(rx, x), copysignl(ry, y)));
+}
+
+long double complex
+catanl(long double complex z)
+{
+ long double complex w;
+
+ w = catanhl(CMPLXL(cimagl(z), creall(z)));
+ return (CMPLXL(cimagl(w), creall(w)));
+}
diff --git a/lib/msun/src/e_asin.c b/lib/msun/src/e_asin.c
index 27de207..931b270 100644
--- a/lib/msun/src/e_asin.c
+++ b/lib/msun/src/e_asin.c
@@ -6,7 +6,7 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
diff --git a/lib/msun/src/e_coshl.c b/lib/msun/src/e_coshl.c
index 0a21277..4e3b283 100644
--- a/lib/msun/src/e_coshl.c
+++ b/lib/msun/src/e_coshl.c
@@ -86,7 +86,9 @@ long double
coshl(long double x)
{
long double hi,lo,x2,x4;
+#if LDBL_MANT_DIG == 113
double dx2;
+#endif
uint16_t ix;
GET_LDBL_EXPSIGN(ix,x);
diff --git a/lib/msun/src/e_lgammaf_r.c b/lib/msun/src/e_lgammaf_r.c
index 9084e18..48346c33 100644
--- a/lib/msun/src/e_lgammaf_r.c
+++ b/lib/msun/src/e_lgammaf_r.c
@@ -122,7 +122,7 @@ sin_pif(float x)
float
__ieee754_lgammaf_r(float x, int *signgamp)
{
- float nadj,p,p1,p2,p3,q,r,t,w,y,z;
+ float nadj,p,p1,p2,q,r,t,w,y,z;
int32_t hx;
int i,ix;
diff --git a/lib/msun/src/e_sinhl.c b/lib/msun/src/e_sinhl.c
index ce7e333..38d3df1 100644
--- a/lib/msun/src/e_sinhl.c
+++ b/lib/msun/src/e_sinhl.c
@@ -85,7 +85,10 @@ long double
sinhl(long double x)
{
long double hi,lo,x2,x4;
- double dx2,s;
+#if LDBL_MANT_DIG == 113
+ double dx2;
+#endif
+ double s;
int16_t ix,jx;
GET_LDBL_EXPSIGN(jx,x);
diff --git a/lib/msun/src/k_sincos.h b/lib/msun/src/k_sincos.h
new file mode 100644
index 0000000..6f03be2
--- /dev/null
+++ b/lib/msun/src/k_sincos.h
@@ -0,0 +1,52 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * k_sin.c and k_cos.c merged by Steven G. Kargl.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+static const double
+S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */
+S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */
+S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */
+S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */
+S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */
+S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */
+
+static const double
+C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
+C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
+C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
+C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
+C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */
+C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
+
+static inline void
+__kernel_sincos(double x, double y, int iy, double *sn, double *cs)
+{
+ double hz, r, v, w, z;
+
+ z = x * x;
+ w = z * z;
+ r = S2 + z * (S3 + z * S4) + z * w * (S5 + z * S6);
+ v = z * x;
+
+ if (iy == 0)
+ *sn = x + v * (S1 + z * r);
+ else
+ *sn = x - ((z * (y / 2 - v * r) - y) - v * S1);
+
+ r = z * (C1 + z * (C2 + z * C3)) + w * w * (C4 + z * (C5 + z * C6));
+ hz = z / 2;
+ w = 1 - hz;
+ *cs = w + (((1 - w) - hz) + (z * r - x * y));
+}
diff --git a/lib/msun/src/k_sincosf.h b/lib/msun/src/k_sincosf.h
new file mode 100644
index 0000000..073986d
--- /dev/null
+++ b/lib/msun/src/k_sincosf.h
@@ -0,0 +1,43 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * k_sinf.c and k_cosf.c merged by Steven G. Kargl.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */
+static const double
+S1 = -0x15555554cbac77.0p-55, /* -0.166666666416265235595 */
+S2 = 0x111110896efbb2.0p-59, /* 0.0083333293858894631756 */
+S3 = -0x1a00f9e2cae774.0p-65, /* -0.000198393348360966317347 */
+S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */
+
+/* |cos(x) - c(x)| < 2**-34.1 (~[-5.37e-11, 5.295e-11]). */
+static const double
+C0 = -0x1ffffffd0c5e81.0p-54, /* -0.499999997251031003120 */
+C1 = 0x155553e1053a42.0p-57, /* 0.0416666233237390631894 */
+C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */
+C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */
+
+static inline void
+__kernel_sincosdf(double x, float *sn, float *cs)
+{
+ double r, s, w, z;
+
+ z = x * x;
+ w = z * z;
+ r = S3 + z * S4;
+ s = z * x;
+ *sn = (x + s * (S1 + z * S2)) + s * w * r;
+ r = C2 + z * C3;
+ *cs = ((1 + z * C0) + w * C1) + (w * z) * r;
+}
diff --git a/lib/msun/src/k_sincosl.h b/lib/msun/src/k_sincosl.h
new file mode 100644
index 0000000..3a609bc
--- /dev/null
+++ b/lib/msun/src/k_sincosl.h
@@ -0,0 +1,134 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * k_sinl.c and k_cosl.c merged by Steven G. Kargl
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#if LDBL_MANT_DIG == 64 /* ld80 version of k_sincosl.c. */
+
+#if defined(__amd64__) || defined(__i386__)
+/* Long double constants are slow on these arches, and broken on i386. */
+static const volatile double
+C1hi = 0.041666666666666664, /* 0x15555555555555.0p-57 */
+C1lo = 2.2598839032744733e-18, /* 0x14d80000000000.0p-111 */
+S1hi = -0.16666666666666666, /* -0x15555555555555.0p-55 */
+S1lo = -9.2563760475949941e-18; /* -0x15580000000000.0p-109 */
+#define S1 ((long double)S1hi + S1lo)
+#define C1 ((long double)C1hi + C1lo)
+#else
+static const long double
+C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */
+S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */
+#endif
+
+static const double
+C2 = -0.0013888888888888874, /* -0x16c16c16c16c10.0p-62 */
+C3 = 0.000024801587301571716, /* 0x1a01a01a018e22.0p-68 */
+C4 = -0.00000027557319215507120, /* -0x127e4fb7602f22.0p-74 */
+C5 = 0.0000000020876754400407278, /* 0x11eed8caaeccf1.0p-81 */
+C6 = -1.1470297442401303e-11, /* -0x19393412bd1529.0p-89 */
+C7 = 4.7383039476436467e-14, /* 0x1aac9d9af5c43e.0p-97 */
+S2 = 0.0083333333333333332, /* 0x11111111111111.0p-59 */
+S3 = -0.00019841269841269427, /* -0x1a01a01a019f81.0p-65 */
+S4 = 0.0000027557319223597490, /* 0x171de3a55560f7.0p-71 */
+S5 = -0.000000025052108218074604, /* -0x1ae64564f16cad.0p-78 */
+S6 = 1.6059006598854211e-10, /* 0x161242b90243b5.0p-85 */
+S7 = -7.6429779983024564e-13, /* -0x1ae42ebd1b2e00.0p-93 */
+S8 = 2.6174587166648325e-15; /* 0x179372ea0b3f64.0p-101 */
+
+static inline void
+__kernel_sincosl(long double x, long double y, int iy, long double *sn,
+ long double *cs)
+{
+ long double hz, r, v, w, z;
+
+ z = x * x;
+ v = z * x;
+ /*
+ * XXX Replace Horner scheme with an algorithm suitable for CPUs
+ * with more complex pipelines.
+ */
+ r = S2 + z * (S3 + z * (S4 + z * (S5 + z * (S6 + z * (S7 + z * S8)))));
+
+ if (iy == 0)
+ *sn = x + v * (S1 + z * r);
+ else
+ *sn = x - ((z * (y / 2 - v * r) - y) - v * S1);
+
+ hz = z / 2;
+ w = 1 - hz;
+ r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 +
+ z * C7))))));
+ *cs = w + (((1 - w) - hz) + (z * r - x * y));
+}
+
+#elif LDBL_MANT_DIG == 113 /* ld128 version of k_sincosl.c. */
+
+static const long double
+C1 = 0.04166666666666666666666666666666658424671L,
+C2 = -0.001388888888888888888888888888863490893732L,
+C3 = 0.00002480158730158730158730158600795304914210L,
+C4 = -0.2755731922398589065255474947078934284324e-6L,
+C5 = 0.2087675698786809897659225313136400793948e-8L,
+C6 = -0.1147074559772972315817149986812031204775e-10L,
+C7 = 0.4779477332386808976875457937252120293400e-13L,
+S1 = -0.16666666666666666666666666666666666606732416116558L,
+S2 = 0.0083333333333333333333333333333331135404851288270047L,
+S3 = -0.00019841269841269841269841269839935785325638310428717L,
+S4 = 0.27557319223985890652557316053039946268333231205686e-5L,
+S5 = -0.25052108385441718775048214826384312253862930064745e-7L,
+S6 = 0.16059043836821614596571832194524392581082444805729e-9L,
+S7 = -0.76471637318198151807063387954939213287488216303768e-12L,
+S8 = 0.28114572543451292625024967174638477283187397621303e-14L;
+
+static const double
+C8 = -0.1561920696721507929516718307820958119868e-15,
+C9 = 0.4110317413744594971475941557607804508039e-18,
+C10 = -0.8896592467191938803288521958313920156409e-21,
+C11 = 0.1601061435794535138244346256065192782581e-23,
+S9 = -0.82206352458348947812512122163446202498005154296863e-17,
+S10 = 0.19572940011906109418080609928334380560135358385256e-19,
+S11 = -0.38680813379701966970673724299207480965452616911420e-22,
+S12 = 0.64038150078671872796678569586315881020659912139412e-25;
+
+static inline void
+__kernel_sincosl(long double x, long double y, int iy, long double *sn,
+ long double *cs)
+{
+ long double hz, r, v, w, z;
+
+ z = x * x;
+ v = z * x;
+ /*
+ * XXX Replace Horner scheme with an algorithm suitable for CPUs
+ * with more complex pipelines.
+ */
+ r = S2 + z * (S3 + z * (S4 + z * (S5 + z * (S6 + z * (S7 + z * (S8 +
+ z * (S9 + z * (S10 + z * (S11 + z * S12)))))))));
+
+ if (iy == 0)
+ *sn = x + v * (S1 + z * r);
+ else
+ *cs = x - ((z * (y / 2 - v * r) - y) - v * S1);
+
+ hz = z / 2;
+ w = 1 - hz;
+ r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * (C6 +
+ z * (C7 + z * (C8 + z * (C9 + z * (C10 + z * C11))))))))));
+
+ *cs = w + (((1 - w) - hz) + (z * r - x * y));
+}
+#else
+#error "Unsupported long double format"
+#endif
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 2214c07..a8f4554 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -500,6 +500,9 @@ long double truncl(long double);
#if __BSD_VISIBLE
long double lgammal_r(long double, int *);
+void sincos(double, double *, double *);
+void sincosf(float, float *, float *);
+void sincosl(long double, long double *, long double *);
#endif
__END_DECLS
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index afaf201..7487902 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -306,9 +306,21 @@ do { \
fpsetprec(__oprec); \
RETURNF(__retval); \
} while (0)
+#define ENTERV() \
+ fp_prec_t __oprec; \
+ \
+ if ((__oprec = fpgetprec()) != FP_PE) \
+ fpsetprec(FP_PE)
+#define RETURNV() do { \
+ if (__oprec != FP_PE) \
+ fpsetprec(__oprec); \
+ return; \
+} while (0)
#else
-#define ENTERI(x)
+#define ENTERI()
#define RETURNI(x) RETURNF(x)
+#define ENTERV()
+#define RETURNV() return
#endif
/* Default return statement if hack*_t() is not used. */
diff --git a/lib/msun/src/s_fabs.c b/lib/msun/src/s_fabs.c
index 15529e5..48aab25 100644
--- a/lib/msun/src/s_fabs.c
+++ b/lib/msun/src/s_fabs.c
@@ -10,9 +10,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* fabs(x) returns the absolute value of x.
diff --git a/lib/msun/src/s_fmax.c b/lib/msun/src/s_fmax.c
index b51b865..77e27be 100644
--- a/lib/msun/src/s_fmax.c
+++ b/lib/msun/src/s_fmax.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <float.h>
#include <math.h>
#include "fpmath.h"
@@ -51,3 +52,7 @@ fmax(double x, double y)
return (x > y ? x : y);
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(fmax, fmaxl);
+#endif
diff --git a/lib/msun/src/s_fmin.c b/lib/msun/src/s_fmin.c
index 3500c84..5545ff2 100644
--- a/lib/msun/src/s_fmin.c
+++ b/lib/msun/src/s_fmin.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <float.h>
#include <math.h>
#include "fpmath.h"
@@ -51,3 +52,7 @@ fmin(double x, double y)
return (x < y ? x : y);
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(fmin, fminl);
+#endif
diff --git a/lib/msun/src/s_logbl.c b/lib/msun/src/s_logbl.c
index 7e88e36..ee1a91f 100644
--- a/lib/msun/src/s_logbl.c
+++ b/lib/msun/src/s_logbl.c
@@ -10,9 +10,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <float.h>
#include <limits.h>
diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c
index e7efaab..b048b05 100644
--- a/lib/msun/src/s_scalbn.c
+++ b/lib/msun/src/s_scalbn.c
@@ -10,9 +10,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* scalbn (double x, int n)
@@ -21,7 +20,6 @@ static char rcsid[] = "$FreeBSD$";
* exponentiation or a multiplication.
*/
-#include <sys/cdefs.h>
#include <float.h>
#include "math.h"
@@ -51,10 +49,12 @@ scalbn (double x, int n)
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
if (k > 0) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54)
+ if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/
- else return tiny*copysign(tiny,x); /*underflow*/
+ else
+ return tiny*copysign(tiny,x); /*underflow*/
+ }
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;
diff --git a/lib/msun/src/s_scalbnf.c b/lib/msun/src/s_scalbnf.c
index 7666c74..21d001c 100644
--- a/lib/msun/src/s_scalbnf.c
+++ b/lib/msun/src/s_scalbnf.c
@@ -13,11 +13,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
-
#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
@@ -46,10 +43,12 @@ scalbnf (float x, int n)
if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */
if (k > 0) /* normal result */
{SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;}
- if (k <= -25)
+ if (k <= -25) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysignf(huge,x); /*overflow*/
- else return tiny*copysignf(tiny,x); /*underflow*/
+ else
+ return tiny*copysignf(tiny,x); /*underflow*/
+ }
k += 25; /* subnormal result */
SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23));
return x*twom25;
diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c
index fc89f8d..28b0cf9 100644
--- a/lib/msun/src/s_scalbnl.c
+++ b/lib/msun/src/s_scalbnl.c
@@ -10,9 +10,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* scalbnl (long double x, int n)
@@ -27,7 +26,6 @@ static char rcsid[] = "$FreeBSD$";
* for scalbn(), so we don't use this routine.
*/
-#include <sys/cdefs.h>
#include <float.h>
#include <math.h>
@@ -59,10 +57,12 @@ scalbnl (long double x, int n)
if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */
if (k > 0) /* normal result */
{u.bits.exp = k; return u.e;}
- if (k <= -128)
+ if (k <= -128) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/
- else return tiny*copysign(tiny,x); /*underflow*/
+ else
+ return tiny*copysign(tiny,x); /*underflow*/
+ }
k += 128; /* subnormal result */
u.bits.exp = k;
return u.e*0x1p-128;
diff --git a/lib/msun/src/s_sincos.c b/lib/msun/src/s_sincos.c
new file mode 100644
index 0000000..85e8d74
--- /dev/null
+++ b/lib/msun/src/s_sincos.c
@@ -0,0 +1,80 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * s_sin.c and s_cos.c merged by Steven G. Kargl. Descriptions of the
+ * algorithms are contained in the original files.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <float.h>
+
+#include "math.h"
+#define INLINE_REM_PIO2
+#include "math_private.h"
+#include "e_rem_pio2.c"
+#include "k_sincos.h"
+
+void
+sincos(double x, double *sn, double *cs)
+{
+ double y[2];
+ int32_t n, ix;
+
+ /* High word of x. */
+ GET_HIGH_WORD(ix, x);
+
+ /* |x| ~< pi/4 */
+ ix &= 0x7fffffff;
+ if (ix <= 0x3fe921fb) {
+ if (ix < 0x3e400000) { /* |x| < 2**-27 */
+ if ((int)x == 0) { /* Generate inexact. */
+ *sn = x;
+ *cs = 1;
+ return;
+ }
+ }
+ __kernel_sincos(x, 0, 0, sn, cs);
+ return;
+ }
+
+ /* If x = Inf or NaN, then sin(x) = NaN and cos(x) = NaN. */
+ if (ix >= 0x7ff00000) {
+ *sn = x - x;
+ *cs = x - x;
+ return;
+ }
+
+ /* Argument reduction. */
+ n = __ieee754_rem_pio2(x, y);
+
+ switch(n & 3) {
+ case 0:
+ __kernel_sincos(y[0], y[1], 1, sn, cs);
+ break;
+ case 1:
+ __kernel_sincos(y[0], y[1], 1, cs, sn);
+ *cs = -*cs;
+ break;
+ case 2:
+ __kernel_sincos(y[0], y[1], 1, sn, cs);
+ *sn = -*sn;
+ *cs = -*cs;
+ break;
+ default:
+ __kernel_sincos(y[0], y[1], 1, cs, sn);
+ *sn = -*sn;
+ }
+}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(sincos, sincosl);
+#endif
diff --git a/lib/msun/src/s_sincosf.c b/lib/msun/src/s_sincosf.c
new file mode 100644
index 0000000..755ff05
--- /dev/null
+++ b/lib/msun/src/s_sincosf.c
@@ -0,0 +1,126 @@
+/*-
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/* s_sincosf.c -- float version of s_sincos.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ * Optimized by Bruce D. Evans.
+ * Merged s_sinf.c and s_cosf.c by Steven G. Kargl.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <float.h>
+
+#include "math.h"
+#define INLINE_REM_PIO2F
+#include "math_private.h"
+#include "e_rem_pio2f.c"
+#include "k_sincosf.h"
+
+/* Small multiples of pi/2 rounded to double precision. */
+static const double
+p1pio2 = 1*M_PI_2, /* 0x3FF921FB, 0x54442D18 */
+p2pio2 = 2*M_PI_2, /* 0x400921FB, 0x54442D18 */
+p3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */
+p4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */
+
+void
+sincosf(float x, float *sn, float *cs)
+{
+ float c, s;
+ double y;
+ int32_t n, hx, ix;
+
+ GET_FLOAT_WORD(hx, x);
+ ix = hx & 0x7fffffff;
+
+ if (ix <= 0x3f490fda) { /* |x| ~<= pi/4 */
+ if (ix < 0x39800000) { /* |x| < 2**-12 */
+ if ((int)x == 0) {
+ *sn = x; /* x with inexact if x != 0 */
+ *cs = 1;
+ return;
+ }
+ }
+ __kernel_sincosdf(x, sn, cs);
+ return;
+ }
+
+ if (ix <= 0x407b53d1) { /* |x| ~<= 5*pi/4 */
+ if (ix <= 0x4016cbe3) { /* |x| ~<= 3pi/4 */
+ if (hx > 0) {
+ __kernel_sincosdf(x - p1pio2, cs, sn);
+ *cs = -*cs;
+ } else {
+ __kernel_sincosdf(x + p1pio2, cs, sn);
+ *sn = -*sn;
+ }
+ } else {
+ if (hx > 0)
+ __kernel_sincosdf(x - p2pio2, sn, cs);
+ else
+ __kernel_sincosdf(x + p2pio2, sn, cs);
+ *sn = -*sn;
+ *cs = -*cs;
+ }
+ return;
+ }
+
+ if (ix <= 0x40e231d5) { /* |x| ~<= 9*pi/4 */
+ if (ix <= 0x40afeddf) { /* |x| ~<= 7*pi/4 */
+ if (hx > 0) {
+ __kernel_sincosdf(x - p3pio2, cs, sn);
+ *sn = -*sn;
+ } else {
+ __kernel_sincosdf(x + p3pio2, cs, sn);
+ *cs = -*cs;
+ }
+ } else {
+ if (hx > 0)
+ __kernel_sincosdf(x - p4pio2, sn, cs);
+ else
+ __kernel_sincosdf(x + p4pio2, sn, cs);
+ }
+ return;
+ }
+
+ /* If x = Inf or NaN, then sin(x) = NaN and cos(x) = NaN. */
+ if (ix >= 0x7f800000) {
+ *sn = x - x;
+ *cs = x - x;
+ return;
+ }
+
+ /* Argument reduction. */
+ n = __ieee754_rem_pio2f(x, &y);
+ __kernel_sincosdf(y, &s, &c);
+
+ switch(n & 3) {
+ case 0:
+ *sn = s;
+ *cs = c;
+ break;
+ case 1:
+ *sn = c;
+ *cs = -s;
+ break;
+ case 2:
+ *sn = -s;
+ *cs = -c;
+ break;
+ default:
+ *sn = -c;
+ *cs = s;
+ }
+}
+
+
diff --git a/lib/msun/src/s_sincosl.c b/lib/msun/src/s_sincosl.c
new file mode 100644
index 0000000..aef36c2
--- /dev/null
+++ b/lib/msun/src/s_sincosl.c
@@ -0,0 +1,105 @@
+/*-
+ * Copyright (c) 2007, 2010-2013 Steven G. Kargl
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * s_sinl.c and s_cosl.c merged by Steven G. Kargl.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <float.h>
+#ifdef __i386__
+#include <ieeefp.h>
+#endif
+
+#include "math.h"
+#include "math_private.h"
+#include "k_sincosl.h"
+
+#if LDBL_MANT_DIG == 64
+#include "../ld80/e_rem_pio2l.h"
+#elif LDBL_MANT_DIG == 113
+#include "../ld128/e_rem_pio2l.h"
+#else
+#error "Unsupported long double format"
+#endif
+
+void
+sincosl(long double x, long double *sn, long double *cs)
+{
+ union IEEEl2bits z;
+ int e0, sgn;
+ long double y[2];
+
+ z.e = x;
+ sgn = z.bits.sign;
+ z.bits.sign = 0;
+
+ ENTERV();
+
+ /* Optimize the case where x is already within range. */
+ if (z.e < M_PI_4) {
+ /*
+ * If x = +-0 or x is a subnormal number, then sin(x) = x and
+ * cos(x) = 1.
+ */
+ if (z.bits.exp == 0) {
+ *sn = x;
+ *cs = 1;
+ } else
+ __kernel_sincosl(x, 0, 0, sn, cs);
+ RETURNV();
+ }
+
+ /* If x = NaN or Inf, then sin(x) and cos(x) are NaN. */
+ if (z.bits.exp == 32767) {
+ *sn = x - x;
+ *cs = x - x;
+ RETURNV();
+ }
+
+ /* Range reduction. */
+ e0 = __ieee754_rem_pio2l(x, y);
+
+ switch (e0 & 3) {
+ case 0:
+ __kernel_sincosl(y[0], y[1], 1, sn, cs);
+ break;
+ case 1:
+ __kernel_sincosl(y[0], y[1], 1, cs, sn);
+ *cs = -*cs;
+ break;
+ case 2:
+ __kernel_sincosl(y[0], y[1], 1, sn, cs);
+ *sn = -*sn;
+ *cs = -*cs;
+ break;
+ default:
+ __kernel_sincosl(y[0], y[1], 1, cs, sn);
+ *sn = -*sn;
+ }
+
+ RETURNV();
+}
diff --git a/lib/msun/src/s_tanhl.c b/lib/msun/src/s_tanhl.c
index 886158b..b753186 100644
--- a/lib/msun/src/s_tanhl.c
+++ b/lib/msun/src/s_tanhl.c
@@ -113,7 +113,9 @@ long double
tanhl(long double x)
{
long double hi,lo,s,x2,x4,z;
+#if LDBL_MANT_DIG == 113
double dx2;
+#endif
int16_t jx,ix;
GET_LDBL_EXPSIGN(jx,x);
diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c
index 18c18f8..45b2b78 100644
--- a/lib/msun/tests/ctrig_test.c
+++ b/lib/msun/tests/ctrig_test.c
@@ -443,10 +443,6 @@ ATF_TC_BODY(test_large_inputs, tc)
{
long double complex z;
-#ifdef __i386__
- atf_tc_expect_fail("test fails on i386 - bug 205446");
-#endif
-
/* tanh() uses a threshold around x=22, so check both sides. */
z = CMPLXL(21, 0.78539816339744830961566084581987572L);
testall_odd_tol(ctanh, z,
OpenPOWER on IntegriCloud