summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/bits/huge_val.h53
-rw-r--r--sysdeps/ieee754/bits/huge_valf.h51
-rw-r--r--sysdeps/ieee754/bits/nan.h52
-rw-r--r--sysdeps/ieee754/dbl-64/Makefile6
-rw-r--r--sysdeps/ieee754/dbl-64/MathLib.h2
-rw-r--r--sysdeps/ieee754/dbl-64/asincos.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/atnat.h2
-rw-r--r--sysdeps/ieee754/dbl-64/atnat2.h2
-rw-r--r--sysdeps/ieee754/dbl-64/branred.c2
-rw-r--r--sysdeps/ieee754/dbl-64/branred.h2
-rw-r--r--sysdeps/ieee754/dbl-64/dbl2mpn.c2
-rw-r--r--sysdeps/ieee754/dbl-64/dla.h6
-rw-r--r--sysdeps/ieee754/dbl-64/doasin.c2
-rw-r--r--sysdeps/ieee754/dbl-64/doasin.h2
-rw-r--r--sysdeps/ieee754/dbl-64/dosincos.c2
-rw-r--r--sysdeps/ieee754/dbl-64/dosincos.h2
-rw-r--r--sysdeps/ieee754/dbl-64/e_acosh.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_asin.c7
-rw-r--r--sysdeps/ieee754/dbl-64/e_atan2.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_atanh.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_cosh.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp.c150
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp10.c2
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_fmod.c10
-rw-r--r--sysdeps/ieee754/dbl-64/e_gamma_r.c10
-rw-r--r--sysdeps/ieee754/dbl-64/e_hypot.c13
-rw-r--r--sysdeps/ieee754/dbl-64/e_j0.c11
-rw-r--r--sysdeps/ieee754/dbl-64/e_j1.c12
-rw-r--r--sysdeps/ieee754/dbl-64/e_jn.c22
-rw-r--r--sysdeps/ieee754/dbl-64/e_lgamma_r.c5
-rw-r--r--sysdeps/ieee754/dbl-64/e_log.c129
-rw-r--r--sysdeps/ieee754/dbl-64/e_log10.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_log2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c197
-rw-r--r--sysdeps/ieee754/dbl-64/e_rem_pio2.c4
-rw-r--r--sysdeps/ieee754/dbl-64/e_remainder.c2
-rw-r--r--sysdeps/ieee754/dbl-64/e_sinh.c6
-rw-r--r--sysdeps/ieee754/dbl-64/e_sqrt.c3
-rw-r--r--sysdeps/ieee754/dbl-64/eexp.tbl172
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_product.c34
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_productf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/halfulp.c152
-rw-r--r--sysdeps/ieee754/dbl-64/k_rem_pio2.c20
-rw-r--r--sysdeps/ieee754/dbl-64/lgamma_neg.c3
-rw-r--r--sysdeps/ieee754/dbl-64/lgamma_product.c34
-rw-r--r--sysdeps/ieee754/dbl-64/mpa-arch.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.h33
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mpatan2.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpexp.c163
-rw-r--r--sysdeps/ieee754/dbl-64/mplog.c65
-rw-r--r--sysdeps/ieee754/dbl-64/mpn2dbl.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpsqrt.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mpsqrt.h2
-rw-r--r--sysdeps/ieee754/dbl-64/mptan.c2
-rw-r--r--sysdeps/ieee754/dbl-64/mydefs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/powtwo.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/root.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/s_asinh.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_atan.c10
-rw-r--r--sysdeps/ieee754/dbl-64/s_cbrt.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_ceil.c20
-rw-r--r--sysdeps/ieee754/dbl-64/s_copysign.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_erf.c19
-rw-r--r--sysdeps/ieee754/dbl-64/s_expm1.c19
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xaddf64.c (renamed from sysdeps/ieee754/bits/inf.h)23
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xdivf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xmulf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xsubf64.c30
-rw-r--r--sysdeps/ieee754/dbl-64/s_fabs.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_fadd.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_fdiv.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_finite.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_floor.c21
-rw-r--r--sysdeps/ieee754/dbl-64/s_fma.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_fmaf.c6
-rw-r--r--sysdeps/ieee754/dbl-64/s_fmul.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_fpclassify.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_frexp.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfp.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfp_main.c83
-rw-r--r--sysdeps/ieee754/dbl-64/s_fromfpx.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_fsub.c34
-rw-r--r--sysdeps/ieee754/dbl-64/s_getpayload.c36
-rw-r--r--sysdeps/ieee754/dbl-64/s_isinf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/s_isnan.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_issignaling.c9
-rw-r--r--sysdeps/ieee754/dbl-64/s_llrint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_llround.c13
-rw-r--r--sysdeps/ieee754/dbl-64/s_log1p.c14
-rw-r--r--sysdeps/ieee754/dbl-64/s_logb.c6
-rw-r--r--sysdeps/ieee754/dbl-64/s_lrint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_lround.c13
-rw-r--r--sysdeps/ieee754/dbl-64/s_modf.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_nearbyint.c12
-rw-r--r--sysdeps/ieee754/dbl-64/s_nextup.c56
-rw-r--r--sysdeps/ieee754/dbl-64/s_remquo.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_rint.c7
-rw-r--r--sysdeps/ieee754/dbl-64/s_round.c27
-rw-r--r--sysdeps/ieee754/dbl-64/s_roundeven.c105
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayload.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayload_main.c70
-rw-r--r--sysdeps/ieee754/dbl-64/s_setpayloadsig.c4
-rw-r--r--sysdeps/ieee754/dbl-64/s_signbit.c2
-rw-r--r--sysdeps/ieee754/dbl-64/s_sin.c904
-rw-r--r--sysdeps/ieee754/dbl-64/s_sincos.c118
-rw-r--r--sysdeps/ieee754/dbl-64/s_tan.c10
-rw-r--r--sysdeps/ieee754/dbl-64/s_tanh.c8
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalorder.c53
-rw-r--r--sysdeps/ieee754/dbl-64/s_totalordermag.c48
-rw-r--r--sysdeps/ieee754/dbl-64/s_trunc.c11
-rw-r--r--sysdeps/ieee754/dbl-64/s_ufromfp.c5
-rw-r--r--sysdeps/ieee754/dbl-64/s_ufromfpx.c5
-rw-r--r--sysdeps/ieee754/dbl-64/sincos32.c2
-rw-r--r--sysdeps/ieee754/dbl-64/sincos32.h4
-rw-r--r--sysdeps/ieee754/dbl-64/sincostab.c2
-rw-r--r--sysdeps/ieee754/dbl-64/slowexp.c86
-rw-r--r--sysdeps/ieee754/dbl-64/slowpow.c125
-rw-r--r--sysdeps/ieee754/dbl-64/t_exp.c2
-rw-r--r--sysdeps/ieee754/dbl-64/uasncs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/uatan.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/uexp.h5
-rw-r--r--sysdeps/ieee754/dbl-64/uexp.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/ulog.h96
-rw-r--r--sysdeps/ieee754/dbl-64/ulog.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/upow.h2
-rw-r--r--sysdeps/ieee754/dbl-64/upow.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/urem.h2
-rw-r--r--sysdeps/ieee754/dbl-64/usncs.h2
-rw-r--r--sysdeps/ieee754/dbl-64/utan.h2
-rw-r--r--sysdeps/ieee754/dbl-64/utan.tbl2
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c4
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c2
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c2
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c16
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c18
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c12
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c32
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c3
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c15
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c16
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c9
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c7
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_round.c15
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c71
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c54
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c49
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c46
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c9
-rw-r--r--sysdeps/ieee754/dbl-64/x2y2m1.c34
-rw-r--r--sysdeps/ieee754/dbl-64/x2y2m1f.c2
-rw-r--r--sysdeps/ieee754/float128/Makeconfig4
-rw-r--r--sysdeps/ieee754/float128/Makefile12
-rw-r--r--sysdeps/ieee754/float128/Versions51
-rw-r--r--sysdeps/ieee754/float128/e_acosf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_acoshf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_asinf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_atan2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_atanhf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_coshf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_exp10f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_expf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_fmodf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_gammaf128_r.c2
-rw-r--r--sysdeps/ieee754/float128/e_hypotf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_ilogbf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_j0f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_j1f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_jnf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_lgammaf128_r.c2
-rw-r--r--sysdeps/ieee754/float128/e_log10f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_log2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_logf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_powf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_rem_pio2f128.c2
-rw-r--r--sysdeps/ieee754/float128/e_remainderf128.c2
-rw-r--r--sysdeps/ieee754/float128/e_scalbf128.c1
-rw-r--r--sysdeps/ieee754/float128/e_sinhf128.c2
-rw-r--r--sysdeps/ieee754/float128/float1282mpn.c (renamed from sysdeps/ieee754/ldbl-128ibm/w_log1pl.c)11
-rw-r--r--sysdeps/ieee754/float128/float128_private.h366
-rw-r--r--sysdeps/ieee754/float128/gamma_productf128.c2
-rw-r--r--sysdeps/ieee754/float128/ieee754_float128.h140
-rw-r--r--sysdeps/ieee754/float128/k_cosf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_sinf128.c2
-rw-r--r--sysdeps/ieee754/float128/k_tanf128.c2
-rw-r--r--sysdeps/ieee754/float128/lgamma_negf128.c2
-rw-r--r--sysdeps/ieee754/float128/lgamma_productf128.c2
-rw-r--r--sysdeps/ieee754/float128/math-nan-payload-float128.h34
-rw-r--r--sysdeps/ieee754/float128/mpn2float128.c54
-rw-r--r--sysdeps/ieee754/float128/s_asinhf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_atanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_cbrtf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_ceilf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_copysignf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_cosf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_erff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_expm1f128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f32addf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32divf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32mulf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f32subf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f64addf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64divf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64mulf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64subf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64xaddf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xdivf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xmulf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_f64xsubf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fabsf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_finitef128.c2
-rw-r--r--sysdeps/ieee754/float128/s_floorf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fmaf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fpclassifyf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_frexpf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_fromfpf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_fromfpxf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_getpayloadf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_isinff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_isnanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_issignalingf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_llrintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_llroundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_log1pf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_logbf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_lrintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_lroundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_modff128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nearbyintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nextafterf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_nexttowardf128.c1
-rw-r--r--sysdeps/ieee754/float128/s_nextupf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_remquof128.c2
-rw-r--r--sysdeps/ieee754/float128/s_rintf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_roundevenf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_roundf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_scalblnf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_scalbnf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_setpayloadf128.c5
-rw-r--r--sysdeps/ieee754/float128/s_setpayloadsigf128.c5
-rw-r--r--sysdeps/ieee754/float128/s_signbitf128.c (renamed from sysdeps/ieee754/dbl-64/w_exp.c)31
-rw-r--r--sysdeps/ieee754/float128/s_significandf128.c1
-rw-r--r--sysdeps/ieee754/float128/s_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_sinf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_tanf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_tanhf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_totalorderf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_totalordermagf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_truncf128.c2
-rw-r--r--sysdeps/ieee754/float128/s_ufromfpf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_ufromfpxf128.c6
-rw-r--r--sysdeps/ieee754/float128/strfromf128.c (renamed from sysdeps/ieee754/ldbl-64-128/w_scalblnl.c)31
-rw-r--r--sysdeps/ieee754/float128/strtof128.c51
-rw-r--r--sysdeps/ieee754/float128/strtof128_l.c58
-rw-r--r--sysdeps/ieee754/float128/strtof128_nan.c26
-rw-r--r--sysdeps/ieee754/float128/t_sincosf128.c2
-rw-r--r--sysdeps/ieee754/float128/wcstof128.c27
-rw-r--r--sysdeps/ieee754/float128/wcstof128_l.c27
-rw-r--r--sysdeps/ieee754/float128/wcstof128_nan.c23
-rw-r--r--sysdeps/ieee754/float128/x2y2m1f128.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_acosf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_acoshf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_asinf.c3
-rw-r--r--sysdeps/ieee754/flt-32/e_atan2f.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_atanhf.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_coshf.c1
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f.c182
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_expf.c202
-rw-r--r--sysdeps/ieee754/flt-32/e_fmodf.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_gammaf_r.c8
-rw-r--r--sysdeps/ieee754/flt-32/e_hypotf.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_j0f.c11
-rw-r--r--sysdeps/ieee754/flt-32/e_j1f.c12
-rw-r--r--sysdeps/ieee754/flt-32/e_jnf.c10
-rw-r--r--sysdeps/ieee754/flt-32/e_lgammaf_r.c5
-rw-r--r--sysdeps/ieee754/flt-32/e_log10f.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_log2f.c157
-rw-r--r--sysdeps/ieee754/flt-32/e_log2f_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_logf.c157
-rw-r--r--sysdeps/ieee754/flt-32/e_logf_data.c44
-rw-r--r--sysdeps/ieee754/flt-32/e_powf.c450
-rw-r--r--sysdeps/ieee754/flt-32/e_powf_log2_data.c45
-rw-r--r--sysdeps/ieee754/flt-32/e_rem_pio2f.c6
-rw-r--r--sysdeps/ieee754/flt-32/e_remainderf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_sinhf.c2
-rw-r--r--sysdeps/ieee754/flt-32/e_sqrtf.c2
-rw-r--r--sysdeps/ieee754/flt-32/k_rem_pio2f.c21
-rw-r--r--sysdeps/ieee754/flt-32/k_sinf.c1
-rw-r--r--sysdeps/ieee754/flt-32/k_tanf.c1
-rw-r--r--sysdeps/ieee754/flt-32/lgamma_negf.c3
-rw-r--r--sysdeps/ieee754/flt-32/math_config.h164
-rw-r--r--sysdeps/ieee754/flt-32/math_errf.c76
-rw-r--r--sysdeps/ieee754/flt-32/mpn2flt.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_asinhf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_atanf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_cbrtf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_ceilf.c12
-rw-r--r--sysdeps/ieee754/flt-32/s_copysignf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_cosf.c171
-rw-r--r--sysdeps/ieee754/flt-32/s_erff.c11
-rw-r--r--sysdeps/ieee754/flt-32/s_expm1f.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_fabsf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_finitef.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_floorf.c14
-rw-r--r--sysdeps/ieee754/flt-32/s_fpclassifyf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_frexpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpf_main.c83
-rw-r--r--sysdeps/ieee754/flt-32/s_fromfpxf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_getpayloadf.c35
-rw-r--r--sysdeps/ieee754/flt-32/s_isnanf.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_issignalingf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_llrintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_llroundf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_log1pf.c19
-rw-r--r--sysdeps/ieee754/flt-32/s_logbf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_lrintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_lroundf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_modff.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_nearbyintf.c8
-rw-r--r--sysdeps/ieee754/flt-32/s_nextafterf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_nextupf.c48
-rw-r--r--sysdeps/ieee754/flt-32/s_remquof.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_rintf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_roundevenf.c70
-rw-r--r--sysdeps/ieee754/flt-32/s_roundf.c14
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadf_main.c54
-rw-r--r--sysdeps/ieee754/flt-32/s_setpayloadsigf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_signbitf.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_sincosf.c175
-rw-r--r--sysdeps/ieee754/flt-32/s_sincosf.h155
-rw-r--r--sysdeps/ieee754/flt-32/s_sinf.c177
-rw-r--r--sysdeps/ieee754/flt-32/s_tanf.c3
-rw-r--r--sysdeps/ieee754/flt-32/s_tanhf.c4
-rw-r--r--sysdeps/ieee754/flt-32/s_totalorderf.c48
-rw-r--r--sysdeps/ieee754/flt-32/s_totalordermagf.c46
-rw-r--r--sysdeps/ieee754/flt-32/s_truncf.c7
-rw-r--r--sysdeps/ieee754/flt-32/s_ufromfpf.c5
-rw-r--r--sysdeps/ieee754/flt-32/s_ufromfpxf.c5
-rw-r--r--sysdeps/ieee754/flt-32/t_exp2f.h351
-rw-r--r--sysdeps/ieee754/flt-32/w_exp2f.c1
-rw-r--r--sysdeps/ieee754/flt-32/w_expf.c35
-rw-r--r--sysdeps/ieee754/flt-32/w_log2f.c1
-rw-r--r--sysdeps/ieee754/flt-32/w_logf.c1
-rw-r--r--sysdeps/ieee754/flt-32/w_powf.c1
-rw-r--r--sysdeps/ieee754/ieee754.h2
-rw-r--r--sysdeps/ieee754/k_standard.c71
-rw-r--r--sysdeps/ieee754/k_standardf.c5
-rw-r--r--sysdeps/ieee754/k_standardl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/Makeconfig4
-rw-r--r--sysdeps/ieee754/ldbl-128/bits/floatn.h97
-rw-r--r--sysdeps/ieee754/ldbl-128/bits/long-double.h20
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acoshl.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_acosl.c152
-rw-r--r--sysdeps/ieee754/ldbl-128/e_asinl.c107
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atan2l.c30
-rw-r--r--sysdeps/ieee754/ldbl-128/e_atanhl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/e_coshl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128/e_exp10l.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_expl.c51
-rw-r--r--sysdeps/ieee754/ldbl-128/e_fmodl.c16
-rw-r--r--sysdeps/ieee754/ldbl-128/e_gammal_r.c125
-rw-r--r--sysdeps/ieee754/ldbl-128/e_hypotl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128/e_ilogbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j0l.c877
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j1l.c876
-rw-r--r--sysdeps/ieee754/ldbl-128/e_jnl.c77
-rw-r--r--sysdeps/ieee754/ldbl-128/e_lgammal_r.c932
-rw-r--r--sysdeps/ieee754/ldbl-128/e_log10l.c134
-rw-r--r--sysdeps/ieee754/ldbl-128/e_log2l.c128
-rw-r--r--sysdeps/ieee754/ldbl-128/e_logl.c241
-rw-r--r--sysdeps/ieee754/ldbl-128/e_powl.c120
-rw-r--r--sysdeps/ieee754/ldbl-128/e_rem_pio2l.c18
-rw-r--r--sysdeps/ieee754/ldbl-128/e_remainderl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/e_sinhl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/float128-abi.h2
-rw-r--r--sysdeps/ieee754/ldbl-128/gamma_productl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/ieee754.h2
-rw-r--r--sysdeps/ieee754/ldbl-128/k_cosl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sincosl.c71
-rw-r--r--sysdeps/ieee754/ldbl-128/k_sinl.c57
-rw-r--r--sysdeps/ieee754/ldbl-128/k_tanl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/ldbl2mpn.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_negl.c760
-rw-r--r--sysdeps/ieee754/ldbl-128/lgamma_productl.c62
-rw-r--r--sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h (renamed from sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h)7
-rw-r--r--sysdeps/ieee754/ldbl-128/math_ldbl.h52
-rw-r--r--sysdeps/ieee754/ldbl-128/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/printf_fphex.c90
-rw-r--r--sysdeps/ieee754/ldbl-128/printf_fphex_macros.h104
-rw-r--r--sysdeps/ieee754/ldbl-128/s_asinhl.c22
-rw-r--r--sysdeps/ieee754/ldbl-128/s_atanl.c206
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cbrtl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ceill.c42
-rw-r--r--sysdeps/ieee754/ldbl-128/s_copysignl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_cosl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_daddl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ddivl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_dmull.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_dsubl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_erfl.c922
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c62
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xaddf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xdivf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xmulf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xsubf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fabsl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_faddl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fdivl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_finitel.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_floorl.c44
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fma.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fmal.c60
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fmull.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fpclassifyl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128/s_frexpl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpl_main.c91
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fsubl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128/s_getpayloadl.c59
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isinfl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_isnanl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128/s_issignalingl.c9
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llrintl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llroundl.c15
-rw-r--r--sysdeps/ieee754/ldbl-128/s_log1pl.c119
-rw-r--r--sysdeps/ieee754/ldbl-128/s_logbl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c29
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lroundl.c15
-rw-r--r--sysdeps/ieee754/ldbl-128/s_modfl.c9
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nearbyintl.c22
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextafterl.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttoward.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nexttowardf.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_nextupl.c58
-rw-r--r--sysdeps/ieee754/ldbl-128/s_remquol.c19
-rw-r--r--sysdeps/ieee754/ldbl-128/s_rintl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128/s_roundevenl.c104
-rw-r--r--sysdeps/ieee754/ldbl-128/s_roundl.c52
-rw-r--r--sysdeps/ieee754/ldbl-128/s_scalblnl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_scalbnl.c12
-rw-r--r--sysdeps/ieee754/ldbl-128/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c70
-rw-r--r--sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128/s_signbitl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sincosl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_sinl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanhl.c14
-rw-r--r--sysdeps/ieee754/ldbl-128/s_tanl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalorderl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128/s_totalordermagl.c50
-rw-r--r--sysdeps/ieee754/ldbl-128/s_truncl.c11
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128/strtold_l.c32
-rw-r--r--sysdeps/ieee754/ldbl-128/t_expl.h1864
-rw-r--r--sysdeps/ieee754/ldbl-128/t_sincosl.c671
-rw-r--r--sysdeps/ieee754/ldbl-128/w_expl.c42
-rw-r--r--sysdeps/ieee754/ldbl-128/x2y2m1l.c57
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/Makefile22
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/Versions123
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c32
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c (renamed from sysdeps/ieee754/ldbl-64-128/w_log1pl.c)11
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c (renamed from sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c)11
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c20
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/Makefile6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acoshl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_atanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_exp10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_expl.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_fmodl.c25
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_hypotl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j0l.c865
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_j1l.c887
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_jnl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c993
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log10l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_log2l.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_logl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_powl.c43
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_remainderl.c8
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sinhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c10
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/gamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ieee754.h2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_cosl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sincosl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_sinl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h (renamed from sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h)7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/math_ldbl.h64
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/printf_fphex.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_asinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_atanl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c104
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ceill.c58
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_daddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ddivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_erfl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_expm1l.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fabsl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_faddl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fdivl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_floorl.c51
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmal.c243
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fmull.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_frexpl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c147
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fsubl.c27
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c35
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llrintl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_llroundl.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_log1pl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lrintl.c17
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_lroundl.c13
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_modfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c111
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c3
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_nextupl.c79
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_remquol.c6
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_rintl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c70
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_roundl.c76
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c60
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_tanhl.c1
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c63
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c65
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_truncl.c56
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/strtold_l.c7
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_expl.h970
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/t_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c230
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c84
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c30
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c73
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c2
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/w_expl.c21
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c34
-rw-r--r--sysdeps/ieee754/ldbl-64-128/e_ilogbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_asinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_atanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_cbrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_ceill.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_copysignl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_cosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_erfl.c6
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_expm1l.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fabsl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_finitel.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_floorl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fmal.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_frexpl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_isinfl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_isnanl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_llrintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_llroundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_log1pl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_logbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_lrintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_lroundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_modfl.c11
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_nextafterl.c3
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_remquol.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_rintl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_roundl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_scalblnl.c4
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_scalbnl.c4
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_sincosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_sinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_tanhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_tanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/s_truncl.c5
-rw-r--r--sysdeps/ieee754/ldbl-64-128/strtold_l.c39
-rw-r--r--sysdeps/ieee754/ldbl-64-128/w_expl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/Makefile21
-rw-r--r--sysdeps/ieee754/ldbl-96/bits/iscanonical.h54
-rw-r--r--sysdeps/ieee754/ldbl-96/bits/long-double.h20
-rw-r--r--sysdeps/ieee754/ldbl-96/e_acoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/e_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/e_atanhl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/e_coshl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/e_gammal_r.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/e_hypotl.c23
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j0l.c17
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j1l.c19
-rw-r--r--sysdeps/ieee754/ldbl-96/e_jnl.c9
-rw-r--r--sysdeps/ieee754/ldbl-96/e_lgammal_r.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/e_rem_pio2l.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/e_sinhl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_product.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_productl.c36
-rw-r--r--sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h5
-rw-r--r--sysdeps/ieee754/ldbl-96/k_cosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/k_sinl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/k_tanl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/ldbl2mpn.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_negl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_product.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/lgamma_productl.c38
-rw-r--r--sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h (renamed from sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h)7
-rw-r--r--sysdeps/ieee754/ldbl-96/math_ldbl.h40
-rw-r--r--sysdeps/ieee754/ldbl-96/mpn2ldbl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/printf_fphex.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/s_asinhl.c8
-rw-r--r--sysdeps/ieee754/ldbl-96/s_cbrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_copysignl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_cosl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_daddl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ddivl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_dmull.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_dsubl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_erfl.c10
-rw-r--r--sysdeps/ieee754/ldbl-96/s_faddl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fdivl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fma.c20
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fmal.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fmull.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_frexpl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpl_main.c85
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fsubl.c31
-rw-r--r--sysdeps/ieee754/ldbl-96/s_getpayloadl.c (renamed from sysdeps/ieee754/ldbl-96/w_expl.c)24
-rw-r--r--sysdeps/ieee754/ldbl-96/s_iscanonicall.c44
-rw-r--r--sysdeps/ieee754/ldbl-96/s_issignalingl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llrintl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llroundl.c11
-rw-r--r--sysdeps/ieee754/ldbl-96/s_lrintl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_lroundl.c11
-rw-r--r--sysdeps/ieee754/ldbl-96/s_modfl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttoward.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nexttowardf.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_nextupl.c86
-rw-r--r--sysdeps/ieee754/ldbl-96/s_remquol.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_roundevenl.c126
-rw-r--r--sysdeps/ieee754/ldbl-96/s_roundl.c25
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c69
-rw-r--r--sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c4
-rw-r--r--sysdeps/ieee754/ldbl-96/s_signbitl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/s_sincosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_sinl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_tanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-96/s_tanl.c3
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalorderl.c59
-rw-r--r--sysdeps/ieee754/ldbl-96/s_totalordermagl.c53
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ufromfpl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ufromfpxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-96/strtold_l.c17
-rw-r--r--sysdeps/ieee754/ldbl-96/t_sincosl.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c141
-rw-r--r--sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c82
-rw-r--r--sysdeps/ieee754/ldbl-96/x2y2m1.c2
-rw-r--r--sysdeps/ieee754/ldbl-96/x2y2m1l.c38
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile37
-rw-r--r--sysdeps/ieee754/ldbl-opt/Versions6
-rw-r--r--sysdeps/ieee754/ldbl-opt/bits/long-double.h24
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabs.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabsl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/carg.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cargl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimag.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimagl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conjl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creal.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creall.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/libm-alias-double.h72
-rw-r--r--sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h69
-rw-r--r--sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h3
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.c10
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.h22
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-llogb.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextup.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-pow10.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c4
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_asinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_atan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cbrt.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ceil.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexpl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10l.c40
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clogl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_copysign.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpow.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpowl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cproj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cprojl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrt.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrtl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_erf.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_expm1.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fabs.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdim.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdiml.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_floor.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmal.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmax.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmaxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fminl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_frexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexp.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexpl.c37
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_log1p.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_logb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_modf.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nearbyint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nextafter.c3
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_remquo.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_rint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_round.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbln.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbn.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significand.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significandl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sin.c14
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sincos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_trunc.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c1
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acoshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_cosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_coshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10_compat.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c17
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmod.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmodl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypot.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypotl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jn.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jnl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgamma_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgammal_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_logl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_pow.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_powl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainder_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_remainder.c)3
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c19
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalb_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_scalb.c)2
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_scalbl.c)2
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrt.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgamma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgammal.c5
-rw-r--r--sysdeps/ieee754/s_lib_version.c19
-rw-r--r--sysdeps/ieee754/s_matherr.c8
-rw-r--r--sysdeps/ieee754/soft-fp/Makefile3
-rw-r--r--sysdeps/ieee754/soft-fp/s_daddl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_ddivl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_dmull.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_dsubl.c59
-rw-r--r--sysdeps/ieee754/soft-fp/s_fadd.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_faddl.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fdiv.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fdivl.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fma.c68
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmaf.c68
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmal.c66
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmul.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fmull.c55
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsub.c56
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsubl.c55
899 files changed, 20558 insertions, 10601 deletions
diff --git a/sysdeps/ieee754/bits/huge_val.h b/sysdeps/ieee754/bits/huge_val.h
deleted file mode 100644
index 42d416f703..0000000000
--- a/sysdeps/ieee754/bits/huge_val.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* `HUGE_VAL' constant for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VAL (__builtin_huge_val())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VAL (__extension__ 0x1.0p2047)
-#elif defined __GNUC__
-
-# define HUGE_VAL \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
- { __l: 0x7ff0000000000000ULL }).__d)
-
-#else /* not GCC */
-
-# include <endian.h>
-
-typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-# endif
-
-static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
-# define HUGE_VAL (__huge_val.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/bits/huge_valf.h b/sysdeps/ieee754/bits/huge_valf.h
deleted file mode 100644
index 9d418ba320..0000000000
--- a/sysdeps/ieee754/bits/huge_valf.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity).
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
-#endif
-
-/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALF (__builtin_huge_valf())
-#elif __GNUC_PREREQ(2,96)
-# define HUGE_VALF (__extension__ 0x1.0p255f)
-#elif defined __GNUC__
-
-# define HUGE_VALF \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
- { __l: 0x7f800000UL }).__d)
-
-#else /* not GCC */
-
-typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
-# endif
-
-static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-# define HUGE_VALF (__huge_valf.__f)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h
deleted file mode 100644
index b832724d6b..0000000000
--- a/sysdeps/ieee754/bits/nan.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* `NAN' constant for IEEE 754 machines.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _MATH_H
-# error "Never use <bits/nan.h> directly; include <math.h> instead."
-#endif
-
-
-/* IEEE Not A Number. */
-
-#if __GNUC_PREREQ(3,3)
-
-# define NAN (__builtin_nanf (""))
-
-#elif defined __GNUC__
-
-# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
- { __l: 0x7fc00000UL }).__d)
-
-#else
-
-# include <endian.h>
-
-# if __BYTE_ORDER == __BIG_ENDIAN
-# define __qnan_bytes { 0x7f, 0xc0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __qnan_bytes { 0, 0, 0xc0, 0x7f }
-# endif
-
-static union { unsigned char __c[4]; float __d; } __qnan_union
- __attribute__ ((__unused__)) = { __qnan_bytes };
-# define NAN (__qnan_union.__d)
-
-#endif /* GCC. */
diff --git a/sysdeps/ieee754/dbl-64/Makefile b/sysdeps/ieee754/dbl-64/Makefile
index 5557c75b45..c965982fa5 100644
--- a/sysdeps/ieee754/dbl-64/Makefile
+++ b/sysdeps/ieee754/dbl-64/Makefile
@@ -1,6 +1,6 @@
ifeq ($(subdir),math)
# branred depends on precise IEEE double rounding
-CFLAGS-branred.c = $(config-cflags-nofma)
-CFLAGS-e_sqrt.c = $(config-cflags-nofma)
-CFLAGS-e_pow.c = $(config-cflags-nofma)
+CFLAGS-branred.c += $(config-cflags-nofma)
+CFLAGS-e_sqrt.c += $(config-cflags-nofma)
+CFLAGS-e_pow.c += $(config-cflags-nofma)
endif
diff --git a/sysdeps/ieee754/dbl-64/MathLib.h b/sysdeps/ieee754/dbl-64/MathLib.h
index 94182e45c1..671d78f72b 100644
--- a/sysdeps/ieee754/dbl-64/MathLib.h
+++ b/sysdeps/ieee754/dbl-64/MathLib.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/asincos.tbl b/sysdeps/ieee754/dbl-64/asincos.tbl
index 8da9ff3c07..bb9b7c7c07 100644
--- a/sysdeps/ieee754/dbl-64/asincos.tbl
+++ b/sysdeps/ieee754/dbl-64/asincos.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/atnat.h b/sysdeps/ieee754/dbl-64/atnat.h
index a9649c57ea..ff8671ac48 100644
--- a/sysdeps/ieee754/dbl-64/atnat.h
+++ b/sysdeps/ieee754/dbl-64/atnat.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/atnat2.h b/sysdeps/ieee754/dbl-64/atnat2.h
index d5f4ab946d..1c7d3cb760 100644
--- a/sysdeps/ieee754/dbl-64/atnat2.h
+++ b/sysdeps/ieee754/dbl-64/atnat2.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/branred.c b/sysdeps/ieee754/dbl-64/branred.c
index ca9dd90aff..b1490cce2d 100644
--- a/sysdeps/ieee754/dbl-64/branred.c
+++ b/sysdeps/ieee754/dbl-64/branred.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/branred.h b/sysdeps/ieee754/dbl-64/branred.h
index 7b6b5473b6..0c0f054e62 100644
--- a/sysdeps/ieee754/dbl-64/branred.h
+++ b/sysdeps/ieee754/dbl-64/branred.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dbl2mpn.c b/sysdeps/ieee754/dbl-64/dbl2mpn.c
index cb5a070914..8d6e8a1836 100644
--- a/sysdeps/ieee754/dbl-64/dbl2mpn.c
+++ b/sysdeps/ieee754/dbl-64/dbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/dla.h b/sysdeps/ieee754/dbl-64/dla.h
index d21c47a68f..5196759ca7 100644
--- a/sysdeps/ieee754/dbl-64/dla.h
+++ b/sysdeps/ieee754/dbl-64/dla.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -57,6 +57,10 @@
z=(x)-(y); zz=(fabs(x)>fabs(y)) ? (((x)-(z))-(y)) : ((x)-((y)+(z)));
+#ifdef __FP_FAST_FMA
+# define DLA_FMS(x, y, z) __builtin_fma (x, y, -(z))
+#endif
+
/* Exact multiplication of two single-length floating point numbers, */
/* Veltkamp. The macro produces a double-length number (z,zz) that */
/* satisfies z+zz = x*y exactly. p,hx,tx,hy,ty are temporary */
diff --git a/sysdeps/ieee754/dbl-64/doasin.c b/sysdeps/ieee754/dbl-64/doasin.c
index 903b5484ba..9355333780 100644
--- a/sysdeps/ieee754/dbl-64/doasin.c
+++ b/sysdeps/ieee754/dbl-64/doasin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/doasin.h b/sysdeps/ieee754/dbl-64/doasin.h
index 044d597f9c..240c7ec67c 100644
--- a/sysdeps/ieee754/dbl-64/doasin.h
+++ b/sysdeps/ieee754/dbl-64/doasin.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dosincos.c b/sysdeps/ieee754/dbl-64/dosincos.c
index 931975e6c3..689b453f8d 100644
--- a/sysdeps/ieee754/dbl-64/dosincos.c
+++ b/sysdeps/ieee754/dbl-64/dosincos.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/dosincos.h b/sysdeps/ieee754/dbl-64/dosincos.h
index 02772592e8..23858029e9 100644
--- a/sysdeps/ieee754/dbl-64/dosincos.h
+++ b/sysdeps/ieee754/dbl-64/dosincos.h
@@ -2,7 +2,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/e_acosh.c b/sysdeps/ieee754/dbl-64/e_acosh.c
index c1f3590f75..fe0c375f00 100644
--- a/sysdeps/ieee754/dbl-64/e_acosh.c
+++ b/sysdeps/ieee754/dbl-64/e_acosh.c
@@ -36,7 +36,7 @@ __ieee754_acosh (double x)
{
double t;
int32_t hx;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
if (hx < 0x3ff00000) /* x < 1 */
{
@@ -58,12 +58,12 @@ __ieee754_acosh (double x)
else if (hx > 0x40000000) /* 2**28 > x > 2 */
{
t = x * x;
- return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
+ return __ieee754_log (2.0 * x - one / (x + sqrt (t - one)));
}
else /* 1<x<2 */
{
t = x - one;
- return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
+ return __log1p (t + sqrt (2.0 * t + t * t));
}
}
strong_alias (__ieee754_acosh, __acosh_finite)
diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c
index d8c012d1d3..6bf56945a6 100644
--- a/sysdeps/ieee754/dbl-64/e_asin.c
+++ b/sysdeps/ieee754/dbl-64/e_asin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,6 +42,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#ifndef SECTION
# define SECTION
@@ -323,7 +324,7 @@ __ieee754_asin(double x){
/*---------------------------- |x|>=1 -------------------------------*/
else if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?hp0.x:-hp0.x;
else
- if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
+ if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x + x;
else {
u.i[HIGH_HALF]=0x7ff00000;
v.i[HIGH_HALF]=0x7ff00000;
@@ -633,7 +634,7 @@ __ieee754_acos(double x)
else
if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?0:2.0*hp0.x;
else
- if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
+ if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x + x;
else {
u.i[HIGH_HALF]=0x7ff00000;
v.i[HIGH_HALF]=0x7ff00000;
diff --git a/sysdeps/ieee754/dbl-64/e_atan2.c b/sysdeps/ieee754/dbl-64/e_atan2.c
index 22e8fb8fef..7295067507 100644
--- a/sysdeps/ieee754/dbl-64/e_atan2.c
+++ b/sysdeps/ieee754/dbl-64/e_atan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,6 +44,7 @@
#include <fenv.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <stap-probe.h>
@@ -91,7 +92,7 @@ __ieee754_atan2 (double y, double x)
if ((ux & 0x7ff00000) == 0x7ff00000)
{
if (((ux & 0x000fffff) | dx) != 0x00000000)
- return x + x;
+ return x + y;
}
num.d = y;
uy = num.i[HIGH_HALF];
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c
index 395118e92a..da4da8270c 100644
--- a/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -38,7 +38,9 @@
#include <float.h>
#include <inttypes.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double huge = 1e300;
diff --git a/sysdeps/ieee754/dbl-64/e_cosh.c b/sysdeps/ieee754/dbl-64/e_cosh.c
index 52a5d5007d..ae2180aa89 100644
--- a/sysdeps/ieee754/dbl-64/e_cosh.c
+++ b/sysdeps/ieee754/dbl-64/e_cosh.c
@@ -32,6 +32,7 @@
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double one = 1.0, half = 0.5, huge = 1.0e300;
@@ -41,7 +42,7 @@ __ieee754_cosh (double x)
{
double t, w;
int32_t ix;
- u_int32_t lx;
+ uint32_t lx;
/* High word of |x|. */
GET_HIGH_WORD (ix, x);
@@ -71,7 +72,7 @@ __ieee754_cosh (double x)
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD (lx, x);
- if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (u_int32_t) 0x8fb9f87d)))
+ if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (uint32_t) 0x8fb9f87d)))
{
w = __ieee754_exp (half * fabs (x));
t = half * w;
diff --git a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c
index ad1bc84625..ddd2bcb1c2 100644
--- a/sysdeps/ieee754/dbl-64/e_exp.c
+++ b/sysdeps/ieee754/dbl-64/e_exp.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -23,10 +23,9 @@
/* exp1 */
/* */
/* FILES NEEDED:dla.h endian.h mpa.h mydefs.h uexp.h */
-/* mpa.c mpexp.x slowexp.c */
/* */
/* An ultimate exp routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of e^x */
+/* it computes an almost correctly rounded (to nearest) value of e^x */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -38,25 +37,25 @@
#include "mydefs.h"
#include "MathLib.h"
#include "uexp.tbl"
+#include <math-barriers.h>
#include <math_private.h>
#include <fenv.h>
#include <float.h>
+#include "eexp.tbl"
#ifndef SECTION
# define SECTION
#endif
-double __slowexp (double);
-
-/* An ultimate exp routine. Given an IEEE double machine number x it computes
- the correctly rounded (to nearest) value of e^x. */
double
SECTION
__ieee754_exp (double x)
{
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
+ double z;
mynumber junk1, junk2, binexp = {{0, 0}};
int4 i, j, m, n, ex;
+ int4 k;
double retval;
{
@@ -66,7 +65,42 @@ __ieee754_exp (double x)
m = junk1.i[HIGH_HALF];
n = m & hugeint;
- if (n > smallint && n < bigint)
+ if (n < 0x3ff0a2b2) /* |x| < 1.03972053527832 */
+ {
+ if (n < 0x3f862e42) /* |x| < 3/2 ln 2 */
+ {
+ if (n < 0x3ed00000) /* |x| < 1/64 ln 2 */
+ {
+ if (n < 0x3e300000) /* |x| < 2^18 */
+ {
+ retval = one + junk1.x;
+ goto ret;
+ }
+ retval = one + junk1.x * (one + half * junk1.x);
+ goto ret;
+ }
+ t = junk1.x * junk1.x;
+ retval = junk1.x + (t * (half + junk1.x * t2) +
+ (t * t) * (t3 + junk1.x * t4 + t * t5));
+ retval = one + retval;
+ goto ret;
+ }
+
+ /* Find the multiple of 2^-6 nearest x. */
+ k = n >> 20;
+ j = (0x00100000 | (n & 0x000fffff)) >> (0x40c - k);
+ j = (j - 1) & ~1;
+ if (m < 0)
+ j += 134;
+ z = junk1.x - TBL2[j];
+ t = z * z;
+ retval = z + (t * (half + (z * t2))
+ + (t * t) * (t3 + z * t4 + t * t5));
+ retval = TBL2[j + 1] + TBL2[j + 1] * retval;
+ goto ret;
+ }
+
+ if (n < bigint) /* && |x| >= 1.03972053527832 */
{
y = x * log2e.x + three51.x;
bexp = y - three51.x; /* multiply the result by 2**bexp */
@@ -93,22 +127,9 @@ __ieee754_exp (double x)
rem = (bet + bet * eps) + al * eps;
res = al + rem;
- cor = (al - res) + rem;
- if (res == (res + cor * err_0))
- {
- retval = res * binexp.x;
- goto ret;
- }
- else
- {
- retval = __slowexp (x);
- goto ret;
- } /*if error is over bound */
- }
-
- if (n <= smallint)
- {
- retval = 1.0;
+ /* Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x;
goto ret;
}
@@ -166,38 +187,22 @@ __ieee754_exp (double x)
if (ex >= -1022)
{
binexp.i[HIGH_HALF] = (1023 + ex) << 20;
- if (res == (res + cor * err_0))
- {
- retval = res * binexp.x;
- goto ret;
- }
- else
- {
- retval = __slowexp (x);
- goto check_uflow_ret;
- } /*if error is over bound */
+ /* Does not underflow: res >= 1.0, binexp >= 0x1p-1022
+ Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x;
+ goto ret;
}
ex = -(1022 + ex);
binexp.i[HIGH_HALF] = (1023 - ex) << 20;
res *= binexp.x;
cor *= binexp.x;
- eps = 1.0000000001 + err_0 * binexp.x;
t = 1.0 + res;
y = ((1.0 - t) + res) + cor;
res = t + y;
- cor = (t - res) + y;
- if (res == (res + eps * cor))
- {
- binexp.i[HIGH_HALF] = 0x00100000;
- retval = (res - 1.0) * binexp.x;
- goto check_uflow_ret;
- }
- else
- {
- retval = __slowexp (x);
- goto check_uflow_ret;
- } /* if error is over bound */
- check_uflow_ret:
+ /* Maximum ULP error is 0.5000035. */
+ binexp.i[HIGH_HALF] = 0x00100000;
+ retval = (res - 1.0) * binexp.x;
if (retval < DBL_MIN)
{
double force_underflow = tiny * tiny;
@@ -210,10 +215,9 @@ __ieee754_exp (double x)
else
{
binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
- if (res == (res + cor * err_0))
- retval = res * binexp.x * t256.x;
- else
- retval = __slowexp (x);
+ /* Maximum relative error is 7.8e-22 (70.1 bits).
+ Maximum ULP error is 0.500007. */
+ retval = res * binexp.x * t256.x;
if (isinf (retval))
goto ret_huge;
else
@@ -233,13 +237,10 @@ ret:
strong_alias (__ieee754_exp, __exp_finite)
#endif
-/* Compute e^(x+xx). The routine also receives bound of error of previous
- calculation. If after computing exp the error exceeds the allowed bounds,
- the routine returns a non-positive number. Otherwise it returns the
- computed result, which is always positive. */
+/* Compute e^(x+xx). */
double
SECTION
-__exp1 (double x, double xx, double error)
+__exp1 (double x, double xx)
{
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
mynumber junk1, junk2, binexp = {{0, 0}};
@@ -249,6 +250,7 @@ __exp1 (double x, double xx, double error)
m = junk1.i[HIGH_HALF];
n = m & hugeint; /* no sign */
+ /* fabs (x) > 5.551112e-17 and fabs (x) < 7.080010e+02. */
if (n > smallint && n < bigint)
{
y = x * log2e.x + three51.x;
@@ -276,11 +278,9 @@ __exp1 (double x, double xx, double error)
rem = (bet + bet * eps) + al * eps;
res = al + rem;
- cor = (al - res) + rem;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x;
- else
- return -10.0;
+ /* Maximum relative error before rounding is 8.8e-22 (69.9 bits).
+ Maximum ULP error is 0.500008. */
+ return res * binexp.x;
}
if (n <= smallint)
@@ -318,6 +318,7 @@ __exp1 (double x, double xx, double error)
cor = (al - res) + rem;
if (m >> 31)
{
+ /* x < 0. */
ex = junk1.i[LOW_HALF];
if (res < 1.0)
{
@@ -328,34 +329,25 @@ __exp1 (double x, double xx, double error)
if (ex >= -1022)
{
binexp.i[HIGH_HALF] = (1023 + ex) << 20;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x;
- else
- return -10.0;
+ /* Maximum ULP error is 0.500008. */
+ return res * binexp.x;
}
+ /* Denormal case - ex < -1022. */
ex = -(1022 + ex);
binexp.i[HIGH_HALF] = (1023 - ex) << 20;
res *= binexp.x;
cor *= binexp.x;
- eps = 1.00000000001 + (error + err_1) * binexp.x;
t = 1.0 + res;
y = ((1.0 - t) + res) + cor;
res = t + y;
- cor = (t - res) + y;
- if (res == (res + eps * cor))
- {
- binexp.i[HIGH_HALF] = 0x00100000;
- return (res - 1.0) * binexp.x;
- }
- else
- return -10.0;
+ binexp.i[HIGH_HALF] = 0x00100000;
+ /* Maximum ULP error is 0.500004. */
+ return (res - 1.0) * binexp.x;
}
else
{
binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
- if (res == (res + cor * (1.0 + error + err_1)))
- return res * binexp.x * t256.x;
- else
- return -10.0;
+ /* Maximum ULP error is 0.500008. */
+ return res * binexp.x * t256.x;
}
}
diff --git a/sysdeps/ieee754/dbl-64/e_exp10.c b/sysdeps/ieee754/dbl-64/e_exp10.c
index e3b39f7e31..0721143a69 100644
--- a/sysdeps/ieee754/dbl-64/e_exp10.c
+++ b/sysdeps/ieee754/dbl-64/e_exp10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
index 7402bd7d89..c45bb44744 100644
--- a/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -1,5 +1,5 @@
/* Double-precision floating point 2^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -29,7 +29,9 @@
#include <math.h>
#include <fenv.h>
#include <inttypes.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
#include "t_exp2.h"
diff --git a/sysdeps/ieee754/dbl-64/e_fmod.c b/sysdeps/ieee754/dbl-64/e_fmod.c
index e82b302200..1a8c14dc2a 100644
--- a/sysdeps/ieee754/dbl-64/e_fmod.c
+++ b/sysdeps/ieee754/dbl-64/e_fmod.c
@@ -24,7 +24,7 @@ double
__ieee754_fmod (double x, double y)
{
int32_t n, hx, hy, hz, ix, iy, sx, i;
- u_int32_t lx, ly, lz;
+ uint32_t lx, ly, lz;
EXTRACT_WORDS (hx, lx, x);
EXTRACT_WORDS (hy, ly, y);
@@ -41,7 +41,7 @@ __ieee754_fmod (double x, double y)
if ((hx < hy) || (lx < ly))
return x; /* |x|<|y| return x */
if (lx == ly)
- return Zero[(u_int32_t) sx >> 31]; /* |x|=|y| return x*0*/
+ return Zero[(uint32_t) sx >> 31]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
@@ -125,7 +125,7 @@ __ieee754_fmod (double x, double y)
else
{
if ((hz | lz) == 0) /* return sign(x)*0 */
- return Zero[(u_int32_t) sx >> 31];
+ return Zero[(uint32_t) sx >> 31];
hx = hz + hz + (lz >> 31); lx = lz + lz;
}
}
@@ -138,7 +138,7 @@ __ieee754_fmod (double x, double y)
/* convert back to floating value and restore the sign */
if ((hx | lx) == 0) /* return sign(x)*0 */
- return Zero[(u_int32_t) sx >> 31];
+ return Zero[(uint32_t) sx >> 31];
while (hx < 0x00100000) /* normalize x */
{
hx = hx + hx + (lx >> 31); lx = lx + lx;
@@ -154,7 +154,7 @@ __ieee754_fmod (double x, double y)
n = -1022 - iy;
if (n <= 20)
{
- lx = (lx >> n) | ((u_int32_t) hx << (32 - n));
+ lx = (lx >> n) | ((uint32_t) hx << (32 - n));
hx >>= n;
}
else if (n <= 31)
diff --git a/sysdeps/ieee754/dbl-64/e_gamma_r.c b/sysdeps/ieee754/dbl-64/e_gamma_r.c
index 2d156850d5..2744549cbd 100644
--- a/sysdeps/ieee754/dbl-64/e_gamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_gamma_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,7 +18,9 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -98,7 +100,7 @@ gamma_positive (double x, int *exp2_adj)
double ret = (__ieee754_pow (x_adj_mant, x_adj)
* __ieee754_exp2 (x_adj_log2 * x_adj_frac)
* __ieee754_exp (-x_adj)
- * __ieee754_sqrt (2 * M_PI / x_adj)
+ * sqrt (2 * M_PI / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_log (x_adj);
double bsum = gamma_coeff[NCOEFF - 1];
@@ -114,7 +116,7 @@ double
__ieee754_gamma_r (double x, int *signgamp)
{
int32_t hx;
- u_int32_t lx;
+ uint32_t lx;
double ret;
EXTRACT_WORDS (hx, lx, x);
@@ -126,7 +128,7 @@ __ieee754_gamma_r (double x, int *signgamp)
return 1.0 / x;
}
if (__builtin_expect (hx < 0, 0)
- && (u_int32_t) hx < 0xfff00000 && __rint (x) == x)
+ && (uint32_t) hx < 0xfff00000 && __rint (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c
index f142c450a2..a2c33cc4ed 100644
--- a/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
double
__ieee754_hypot (double x, double y)
@@ -74,8 +75,10 @@ __ieee754_hypot (double x, double y)
{
if (ha >= 0x7ff00000) /* Inf or NaN */
{
- u_int32_t low;
+ uint32_t low;
w = a + b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LOW_WORD (low, a);
if (((ha & 0xfffff) | low) == 0)
w = a;
@@ -93,7 +96,7 @@ __ieee754_hypot (double x, double y)
{
if (hb <= 0x000fffff) /* subnormal b or 0 */
{
- u_int32_t low;
+ uint32_t low;
GET_LOW_WORD (low, b);
if ((hb | low) == 0)
return a;
@@ -130,7 +133,7 @@ __ieee754_hypot (double x, double y)
t1 = 0;
SET_HIGH_WORD (t1, ha);
t2 = a - t1;
- w = __ieee754_sqrt (t1 * t1 - (b * (-b) - t2 * (a + t1)));
+ w = sqrt (t1 * t1 - (b * (-b) - t2 * (a + t1)));
}
else
{
@@ -141,11 +144,11 @@ __ieee754_hypot (double x, double y)
t1 = 0;
SET_HIGH_WORD (t1, ha + 0x00100000);
t2 = a - t1;
- w = __ieee754_sqrt (t1 * y1 - (w * (-w) - (t1 * y2 + t2 * b)));
+ w = sqrt (t1 * y1 - (w * (-w) - (t1 * y2 + t2 * b)));
}
if (k != 0)
{
- u_int32_t high;
+ uint32_t high;
t1 = 1.0;
GET_HIGH_WORD (high, t1);
SET_HIGH_WORD (t1, high + (k << 20));
diff --git a/sysdeps/ieee754/dbl-64/e_j0.c b/sysdeps/ieee754/dbl-64/e_j0.c
index 9f25aa855e..7f5919910d 100644
--- a/sysdeps/ieee754/dbl-64/e_j0.c
+++ b/sysdeps/ieee754/dbl-64/e_j0.c
@@ -59,6 +59,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static double pzero (double), qzero (double);
@@ -109,11 +110,11 @@ __ieee754_j0 (double x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if (ix > 0x48000000)
- z = (invsqrtpi * cc) / __ieee754_sqrt (x);
+ z = (invsqrtpi * cc) / sqrt (x);
else
{
u = pzero (x); v = qzero (x);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * cc - v * ss) / sqrt (x);
}
return z;
}
@@ -169,7 +170,7 @@ __ieee754_y0 (double x)
if (ix >= 0x7ff00000)
return one / (x + x * x);
if ((ix | lx) == 0)
- return -HUGE_VAL + x; /* -inf and overflow exception. */
+ return -1 / zero; /* -inf and divide by zero exception. */
if (hx < 0)
return zero / (zero * x);
if (ix >= 0x40000000) /* |x| >= 2.0 */
@@ -200,11 +201,11 @@ __ieee754_y0 (double x)
ss = z / cc;
}
if (ix > 0x48000000)
- z = (invsqrtpi * ss) / __ieee754_sqrt (x);
+ z = (invsqrtpi * ss) / sqrt (x);
else
{
u = pzero (x); v = qzero (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrt (x);
}
return z;
}
diff --git a/sysdeps/ieee754/dbl-64/e_j1.c b/sysdeps/ieee754/dbl-64/e_j1.c
index 4827fbf3d3..734f3ca64a 100644
--- a/sysdeps/ieee754/dbl-64/e_j1.c
+++ b/sysdeps/ieee754/dbl-64/e_j1.c
@@ -61,7 +61,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static double pone (double), qone (double);
@@ -112,11 +114,11 @@ __ieee754_j1 (double x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if (ix > 0x48000000)
- z = (invsqrtpi * cc) / __ieee754_sqrt (y);
+ z = (invsqrtpi * cc) / sqrt (y);
else
{
u = pone (y); v = qone (y);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrt (y);
+ z = invsqrtpi * (u * cc - v * ss) / sqrt (y);
}
if (hx < 0)
return -z;
@@ -174,7 +176,7 @@ __ieee754_y1 (double x)
if (__glibc_unlikely (ix >= 0x7ff00000))
return one / (x + x * x);
if (__glibc_unlikely ((ix | lx) == 0))
- return -HUGE_VAL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
/* -inf and overflow exception. */;
if (__glibc_unlikely (hx < 0))
return zero / (zero * x);
@@ -203,11 +205,11 @@ __ieee754_y1 (double x)
* to compute the worse one.
*/
if (ix > 0x48000000)
- z = (invsqrtpi * ss) / __ieee754_sqrt (x);
+ z = (invsqrtpi * ss) / sqrt (x);
else
{
u = pone (x); v = qone (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrt (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrt (x);
}
return z;
}
diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
index 3fecf82f10..9181b22bb8 100644
--- a/sysdeps/ieee754/dbl-64/e_jn.c
+++ b/sysdeps/ieee754/dbl-64/e_jn.c
@@ -39,7 +39,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double
invsqrtpi = 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
@@ -61,7 +63,7 @@ __ieee754_jn (int n, double x)
EXTRACT_WORDS (hx, lx, x);
ix = 0x7fffffff & hx;
/* if J(n,NaN) is NaN */
- if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
+ if (__glibc_unlikely ((ix | ((uint32_t) (lx | -lx)) >> 31) > 0x7ff00000))
return x + x;
if (n < 0)
{
@@ -107,7 +109,7 @@ __ieee754_jn (int n, double x)
case 2: temp = -c - s; break;
case 3: temp = c - s; break;
}
- b = invsqrtpi * temp / __ieee754_sqrt (x);
+ b = invsqrtpi * temp / sqrt (x);
}
else
{
@@ -266,13 +268,8 @@ __ieee754_yn (int n, double x)
EXTRACT_WORDS (hx, lx, x);
ix = 0x7fffffff & hx;
/* if Y(n,NaN) is NaN */
- if (__glibc_unlikely ((ix | ((u_int32_t) (lx | -lx)) >> 31) > 0x7ff00000))
+ if (__glibc_unlikely ((ix | ((uint32_t) (lx | -lx)) >> 31) > 0x7ff00000))
return x + x;
- if (__glibc_unlikely ((ix | lx) == 0))
- return -HUGE_VAL + x;
- /* -inf and overflow exception. */;
- if (__glibc_unlikely (hx < 0))
- return zero / (zero * x);
sign = 1;
if (n < 0)
{
@@ -281,6 +278,11 @@ __ieee754_yn (int n, double x)
}
if (n == 0)
return (__ieee754_y0 (x));
+ if (__glibc_unlikely ((ix | lx) == 0))
+ return -sign / zero;
+ /* -inf and overflow exception. */;
+ if (__glibc_unlikely (hx < 0))
+ return zero / (zero * x);
{
SET_RESTORE_ROUND (FE_TONEAREST);
if (n == 1)
@@ -314,11 +316,11 @@ __ieee754_yn (int n, double x)
case 2: temp = -s + c; break;
case 3: temp = s + c; break;
}
- b = invsqrtpi * temp / __ieee754_sqrt (x);
+ b = invsqrtpi * temp / sqrt (x);
}
else
{
- u_int32_t high;
+ uint32_t high;
a = __ieee754_y0 (x);
b = __ieee754_y1 (x);
/* quit if b is -inf */
diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
index 15154c0f43..17717d915f 100644
--- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c
+++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c
@@ -77,9 +77,10 @@
*
*/
-#include <libc-internal.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const double
two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
@@ -225,7 +226,7 @@ __ieee754_lgamma_r(double x, int *signgamp)
if(hx<0) {
if(__builtin_expect(ix>=0x43300000, 0))
/* |x|>=2**52, must be -integer */
- return x/zero;
+ return fabs (x)/zero;
if (x < -2.0 && x > -28.0)
return __lgamma_neg (x, signgamp);
t = sin_pi(x);
diff --git a/sysdeps/ieee754/dbl-64/e_log.c b/sysdeps/ieee754/dbl-64/e_log.c
index 9917dc236f..2483dd8551 100644
--- a/sysdeps/ieee754/dbl-64/e_log.c
+++ b/sysdeps/ieee754/dbl-64/e_log.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -23,11 +23,10 @@
/* FUNCTION:ulog */
/* */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h ulog.h */
-/* mpexp.c mplog.c mpa.c */
/* ulog.tbl */
/* */
/* An ultimate log routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of log(x). */
+/* it computes the rounded (to nearest) value of log(x). */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -40,34 +39,26 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
-#include <stap-probe.h>
#ifndef SECTION
# define SECTION
#endif
-void __mplog (mp_no *, mp_no *, int);
-
/*********************************************************************/
-/* An ultimate log routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of log(x). */
+/* An ultimate log routine. Given an IEEE double machine number x */
+/* it computes the rounded (to nearest) value of log(x). */
/*********************************************************************/
double
SECTION
__ieee754_log (double x)
{
-#define M 4
- static const int pr[M] = { 8, 10, 18, 32 };
- int i, j, n, ux, dx, p;
+ int i, j, n, ux, dx;
double dbl_n, u, p0, q, r0, w, nln2a, luai, lubi, lvaj, lvbj,
- sij, ssij, ttij, A, B, B0, y, y1, y2, polI, polII, sa, sb,
- t1, t2, t7, t8, t, ra, rb, ww,
- a0, aa0, s1, s2, ss2, s3, ss3, a1, aa1, a, aa, b, bb, c;
+ sij, ssij, ttij, A, B, B0, polI, polII, t8, a, aa, b, bb, c;
#ifndef DLA_FMS
- double t3, t4, t5, t6;
+ double t1, t2, t3, t4, t5;
#endif
number num;
- mp_no mpx, mpy, mpy1, mpy2, mperr;
#include "ulog.tbl"
#include "ulog.h"
@@ -101,7 +92,7 @@ __ieee754_log (double x)
if (w == 0.0)
return 0.0;
- /*--- Stage I, the case abs(x-1) < 0.03 */
+ /*--- The case abs(x-1) < 0.03 */
t8 = MHALF * w;
EMULV (t8, w, a, aa, t1, t2, t3, t4, t5);
@@ -118,50 +109,12 @@ __ieee754_log (double x)
polII *= w * w * w;
c = (aa + bb) + polII;
- /* End stage I, case abs(x-1) < 0.03 */
- if ((y = b + (c + b * E2)) == b + (c - b * E2))
- return y;
-
- /*--- Stage II, the case abs(x-1) < 0.03 */
-
- a = d19.d + w * d20.d;
- a = d18.d + w * a;
- a = d17.d + w * a;
- a = d16.d + w * a;
- a = d15.d + w * a;
- a = d14.d + w * a;
- a = d13.d + w * a;
- a = d12.d + w * a;
- a = d11.d + w * a;
-
- EMULV (w, a, s2, ss2, t1, t2, t3, t4, t5);
- ADD2 (d10.d, dd10.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d9.d, dd9.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d8.d, dd8.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d7.d, dd7.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d6.d, dd6.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d5.d, dd5.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d4.d, dd4.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d3.d, dd3.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (d2.d, dd2.d, s2, ss2, s3, ss3, t1, t2);
- MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- MUL2 (w, 0, s2, ss2, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (w, 0, s3, ss3, b, bb, t1, t2);
+ /* Here b contains the high part of the result, and c the low part.
+ Maximum error is b * 2.334e-19, so accuracy is >61 bits.
+ Therefore max ULP error of b + c is ~0.502. */
+ return b + c;
- /* End stage II, case abs(x-1) < 0.03 */
- if ((y = b + (bb + b * E4)) == b + (bb - b * E4))
- return y;
- goto stage_n;
-
- /*--- Stage I, the case abs(x-1) > 0.03 */
+ /*--- The case abs(x-1) > 0.03 */
case_03:
/* Find n,u such that x = u*2**n, 1/sqrt(2) < u < sqrt(2) */
@@ -203,58 +156,10 @@ case_03:
B0 = (((lubi + lvbj) + ssij) + ttij) + dbl_n * LN2B;
B = polI + B0;
- /* End stage I, case abs(x-1) >= 0.03 */
- if ((y = A + (B + E1)) == A + (B - E1))
- return y;
-
-
- /*--- Stage II, the case abs(x-1) > 0.03 */
-
- /* Improve the accuracy of r0 */
- EMULV (p0, r0, sa, sb, t1, t2, t3, t4, t5);
- t = r0 * ((1 - sa) - sb);
- EADD (r0, t, ra, rb);
-
- /* Compute w */
- MUL2 (q, 0, ra, rb, w, ww, t1, t2, t3, t4, t5, t6, t7, t8);
-
- EADD (A, B0, a0, aa0);
-
- /* Evaluate polynomial III */
- s1 = (c3.d + (c4.d + c5.d * w) * w) * w;
- EADD (c2.d, s1, s2, ss2);
- MUL2 (s2, ss2, w, ww, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8);
- MUL2 (s3, ss3, w, ww, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8);
- ADD2 (s2, ss2, w, ww, s3, ss3, t1, t2);
- ADD2 (s3, ss3, a0, aa0, a1, aa1, t1, t2);
-
- /* End stage II, case abs(x-1) >= 0.03 */
- if ((y = a1 + (aa1 + E3)) == a1 + (aa1 - E3))
- return y;
-
-
- /* Final stages. Use multi-precision arithmetic. */
-stage_n:
-
- for (i = 0; i < M; i++)
- {
- p = pr[i];
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __mplog (&mpx, &mpy, p);
- __dbl_mp (e[i].d, &mperr, p);
- __add (&mpy, &mperr, &mpy1, p);
- __sub (&mpy, &mperr, &mpy2, p);
- __mp_dbl (&mpy1, &y1, p);
- __mp_dbl (&mpy2, &y2, p);
- if (y1 == y2)
- {
- LIBC_PROBE (slowlog, 3, &p, &x, &y1);
- return y1;
- }
- }
- LIBC_PROBE (slowlog_inexact, 3, &p, &x, &y1);
- return y1;
+ /* Here A contains the high part of the result, and B the low part.
+ Maximum abs error is 6.095e-21 and min log (x) is 0.0295 since x > 1.03.
+ Therefore max ULP error of A + B is ~0.502. */
+ return A + B;
}
#ifndef __ieee754_log
diff --git a/sysdeps/ieee754/dbl-64/e_log10.c b/sysdeps/ieee754/dbl-64/e_log10.c
index df59d9dce4..677cbc4df8 100644
--- a/sysdeps/ieee754/dbl-64/e_log10.c
+++ b/sysdeps/ieee754/dbl-64/e_log10.c
@@ -57,7 +57,7 @@ __ieee754_log10 (double x)
{
double y, z;
int32_t i, k, hx;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
@@ -65,7 +65,7 @@ __ieee754_log10 (double x)
if (hx < 0x00100000)
{ /* x < 2**-1022 */
if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
@@ -75,7 +75,7 @@ __ieee754_log10 (double x)
if (__glibc_unlikely (hx >= 0x7ff00000))
return x + x;
k += (hx >> 20) - 1023;
- i = ((u_int32_t) k & 0x80000000) >> 31;
+ i = ((uint32_t) k & 0x80000000) >> 31;
hx = (hx & 0x000fffff) | ((0x3ff - i) << 20);
y = (double) (k + i);
if (FIX_INT_FP_CONVERT_ZERO && y == 0.0)
diff --git a/sysdeps/ieee754/dbl-64/e_log2.c b/sysdeps/ieee754/dbl-64/e_log2.c
index bc6a34192a..e4a6aff9a3 100644
--- a/sysdeps/ieee754/dbl-64/e_log2.c
+++ b/sysdeps/ieee754/dbl-64/e_log2.c
@@ -75,7 +75,7 @@ __ieee754_log2 (double x)
{
double hfsq, f, s, z, R, w, t1, t2, dk;
int32_t k, hx, i, j;
- u_int32_t lx;
+ uint32_t lx;
EXTRACT_WORDS (hx, lx, x);
@@ -83,7 +83,7 @@ __ieee754_log2 (double x)
if (hx < 0x00100000)
{ /* x < 2**-1022 */
if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 663fa392c2..96d5b23ccc 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -20,13 +20,9 @@
/* MODULE_NAME: upow.c */
/* */
/* FUNCTIONS: upow */
-/* power1 */
-/* my_log2 */
/* log1 */
/* checkint */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h */
-/* halfulp.c mpexp.c mplog.c slowexp.c slowpow.c mpa.c */
-/* uexp.c upow.c */
/* root.tbl uexp.tbl upow.tbl */
/* An ultimate power routine. Given two IEEE double machine numbers y,x */
/* it computes the correctly rounded (to nearest) value of x^y. */
@@ -42,6 +38,7 @@
#include "MathLib.h"
#include "upow.tbl"
#include <math_private.h>
+#include <math-underflow.h>
#include <fenv.h>
#ifndef SECTION
@@ -50,11 +47,8 @@
static const double huge = 1.0e300, tiny = 1.0e-300;
-double __exp1 (double x, double xx, double error);
-static double log1 (double x, double *delta, double *error);
-static double my_log2 (double x, double *delta, double *error);
-double __slowpow (double x, double y, double z);
-static double power1 (double x, double y);
+double __exp1 (double x, double xx);
+static double log1 (double x, double *delta);
static int checkint (double x);
/* An ultimate power routine. Given two IEEE double machine numbers y, x it
@@ -63,7 +57,7 @@ double
SECTION
__ieee754_pow (double x, double y)
{
- double z, a, aa, error, t, a1, a2, y1, y2;
+ double z, a, aa, t, a1, a2, y1, y2;
mynumber u, v;
int k;
int4 qx, qy;
@@ -73,8 +67,9 @@ __ieee754_pow (double x, double y)
{ /* of y */
qx = u.i[HIGH_HALF] & 0x7fffffff;
/* Is x a NaN? */
- if (((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
- return x;
+ if ((((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
+ && (y != 0 || issignaling (x)))
+ return x + x;
if (y == 1.0)
return x;
if (y == 2.0)
@@ -99,7 +94,7 @@ __ieee754_pow (double x, double y)
not matter if |y| <= 2**-64. */
if (fabs (y) < 0x1p-64)
y = y < 0 ? -0x1p-64 : 0x1p-64;
- z = log1 (x, &aa, &error); /* x^y =e^(y log (X)) */
+ z = log1 (x, &aa); /* x^y =e^(y log (X)) */
t = y * CN;
y1 = t - (t - y);
y2 = y - y1;
@@ -110,9 +105,16 @@ __ieee754_pow (double x, double y)
aa = y2 * a1 + y * a2;
a1 = a + aa;
a2 = (a - a1) + aa;
- error = error * fabs (y);
- t = __exp1 (a1, a2, 1.9e16 * error); /* return -10 or 0 if wasn't computed exactly */
- retval = (t > 0) ? t : power1 (x, y);
+
+ /* Maximum relative error RElog of log1 is 1.0e-21 (69.7 bits).
+ Maximum relative error REexp of __exp1 is 8.8e-22 (69.9 bits).
+ We actually compute exp ((1 + RElog) * log (x) * y) * (1 + REexp).
+ Since RElog/REexp are tiny and log (x) * y is at most log (DBL_MAX),
+ this is equivalent to pow (x, y) * (1 + 710 * RElog + REexp).
+ So the relative error is 710 * 1.0e-21 + 8.8e-22 = 7.1e-19
+ (60.2 bits). The worst-case ULP error is 0.5064. */
+
+ retval = __exp1 (a1, a2);
}
if (isinf (retval))
@@ -128,7 +130,7 @@ __ieee754_pow (double x, double y)
{
if (((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] != 0)
|| (v.i[HIGH_HALF] & 0x7fffffff) > 0x7ff00000) /* NaN */
- return y;
+ return y + y;
if (fabs (y) > 1.0e20)
return (y > 0) ? 0 : 1.0 / 0.0;
k = checkint (y);
@@ -142,9 +144,9 @@ __ieee754_pow (double x, double y)
qy = v.i[HIGH_HALF] & 0x7fffffff; /* no sign */
if (qx >= 0x7ff00000 && (qx > 0x7ff00000 || u.i[LOW_HALF] != 0)) /* NaN */
- return x;
+ return x + y;
if (qy >= 0x7ff00000 && (qy > 0x7ff00000 || v.i[LOW_HALF] != 0)) /* NaN */
- return x == 1.0 ? 1.0 : y;
+ return x == 1.0 && !issignaling (y) ? 1.0 : y + y;
/* if x<0 */
if (u.i[HIGH_HALF] < 0)
@@ -217,33 +219,11 @@ __ieee754_pow (double x, double y)
strong_alias (__ieee754_pow, __pow_finite)
#endif
-/* Compute x^y using more accurate but more slow log routine. */
-static double
-SECTION
-power1 (double x, double y)
-{
- double z, a, aa, error, t, a1, a2, y1, y2;
- z = my_log2 (x, &aa, &error);
- t = y * CN;
- y1 = t - (t - y);
- y2 = y - y1;
- t = z * CN;
- a1 = t - (t - z);
- a2 = z - a1;
- a = y * z;
- aa = ((y1 * a1 - a) + y1 * a2 + y2 * a1) + y2 * a2 + aa * y;
- a1 = a + aa;
- a2 = (a - a1) + aa;
- error = error * fabs (y);
- t = __exp1 (a1, a2, 1.9e16 * error);
- return (t >= 0) ? t : __slowpow (x, y, z);
-}
-
/* Compute log(x) (x is left argument). The result is the returned double + the
- parameter DELTA. The result is bounded by ERROR. */
+ parameter DELTA. */
static double
SECTION
-log1 (double x, double *delta, double *error)
+log1 (double x, double *delta)
{
unsigned int i, j;
int m;
@@ -259,9 +239,7 @@ log1 (double x, double *delta, double *error)
u.x = x;
m = u.i[HIGH_HALF];
- *error = 0;
- *delta = 0;
- if (m < 0x00100000) /* 1<x<2^-1007 */
+ if (m < 0x00100000) /* Handle denormal x. */
{
x = x * t52.x;
add = -52.0;
@@ -283,7 +261,7 @@ log1 (double x, double *delta, double *error)
v.x = u.x + bigu.x;
uu = v.x - bigu.x;
i = (v.i[LOW_HALF] & 0x000003ff) << 2;
- if (two52.i[LOW_HALF] == 1023) /* nx = 0 */
+ if (two52.i[LOW_HALF] == 1023) /* Exponent of x is 0. */
{
if (i > 1192 && i < 1208) /* |x-1| < 1.5*2**-10 */
{
@@ -295,8 +273,8 @@ log1 (double x, double *delta, double *error)
* (r7 + t * r8)))))
- 0.5 * t2 * (t + t1));
res = e1 + e2;
- *error = 1.0e-21 * fabs (t);
*delta = (e1 - res) + e2;
+ /* Max relative error is 1.464844e-24, so accurate to 79.1 bits. */
return res;
} /* |x-1| < 1.5*2**-10 */
else
@@ -315,12 +293,12 @@ log1 (double x, double *delta, double *error)
t2 = ((((t - t1) + e) + (ui.x[i + 3] + vj.x[j + 2])) + e2 + e * e
* (p2 + e * (p3 + e * p4)));
res = t1 + t2;
- *error = 1.0e-24;
*delta = (t1 - res) + t2;
+ /* Max relative error is 1.0e-24, so accurate to 79.7 bits. */
return res;
}
- } /* nx = 0 */
- else /* nx != 0 */
+ }
+ else /* Exponent of x != 0. */
{
eps = u.x - uu;
nx = (two52.x - two52e.x) + add;
@@ -333,113 +311,13 @@ log1 (double x, double *delta, double *error)
t2 = ((((t - t1) + e) + nx * ln2b.x + ui.x[i + 3] + e2) + e * e
* (q2 + e * (q3 + e * (q4 + e * (q5 + e * q6)))));
res = t1 + t2;
- *error = 1.0e-21;
- *delta = (t1 - res) + t2;
- return res;
- } /* nx != 0 */
-}
-
-/* Slower but more accurate routine of log. The returned result is double +
- DELTA. The result is bounded by ERROR. */
-static double
-SECTION
-my_log2 (double x, double *delta, double *error)
-{
- unsigned int i, j;
- int m;
- double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
- double ou1, ou2, lu1, lu2, ov, lv1, lv2, a, a1, a2;
- double y, yy, z, zz, j1, j2, j7, j8;
-#ifndef DLA_FMS
- double j3, j4, j5, j6;
-#endif
- mynumber u, v;
-#ifdef BIG_ENDI
- mynumber /**/ two52 = {{0x43300000, 0x00000000}}; /* 2**52 */
-#else
-# ifdef LITTLE_ENDI
- mynumber /**/ two52 = {{0x00000000, 0x43300000}}; /* 2**52 */
-# endif
-#endif
-
- u.x = x;
- m = u.i[HIGH_HALF];
- *error = 0;
- *delta = 0;
- add = 0;
- if (m < 0x00100000)
- { /* x < 2^-1022 */
- x = x * t52.x;
- add = -52.0;
- u.x = x;
- m = u.i[HIGH_HALF];
- }
-
- if ((m & 0x000fffff) < 0x0006a09e)
- {
- u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3ff00000;
- two52.i[LOW_HALF] = (m >> 20);
- }
- else
- {
- u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3fe00000;
- two52.i[LOW_HALF] = (m >> 20) + 1;
- }
-
- v.x = u.x + bigu.x;
- uu = v.x - bigu.x;
- i = (v.i[LOW_HALF] & 0x000003ff) << 2;
- /*------------------------------------- |x-1| < 2**-11------------------------------- */
- if ((two52.i[LOW_HALF] == 1023) && (i == 1200))
- {
- t = x - 1.0;
- EMULV (t, s3, y, yy, j1, j2, j3, j4, j5);
- ADD2 (-0.5, 0, y, yy, z, zz, j1, j2);
- MUL2 (t, 0, z, zz, y, yy, j1, j2, j3, j4, j5, j6, j7, j8);
- MUL2 (t, 0, y, yy, z, zz, j1, j2, j3, j4, j5, j6, j7, j8);
-
- e1 = t + z;
- e2 = ((((t - e1) + z) + zz) + t * t * t
- * (ss3 + t * (s4 + t * (s5 + t * (s6 + t * (s7 + t * s8))))));
- res = e1 + e2;
- *error = 1.0e-25 * fabs (t);
- *delta = (e1 - res) + e2;
- return res;
- }
- /*----------------------------- |x-1| > 2**-11 -------------------------- */
- else
- { /*Computing log(x) according to log table */
- nx = (two52.x - two52e.x) + add;
- ou1 = ui.x[i];
- ou2 = ui.x[i + 1];
- lu1 = ui.x[i + 2];
- lu2 = ui.x[i + 3];
- v.x = u.x * (ou1 + ou2) + bigv.x;
- vv = v.x - bigv.x;
- j = v.i[LOW_HALF] & 0x0007ffff;
- j = j + j + j;
- eps = u.x - uu * vv;
- ov = vj.x[j];
- lv1 = vj.x[j + 1];
- lv2 = vj.x[j + 2];
- a = (ou1 + ou2) * (1.0 + ov);
- a1 = (a + 1.0e10) - 1.0e10;
- a2 = a * (1.0 - a1 * uu * vv);
- e1 = eps * a1;
- e2 = eps * a2;
- e = e1 + e2;
- e2 = (e1 - e) + e2;
- t = nx * ln2a.x + lu1 + lv1;
- t1 = t + e;
- t2 = ((((t - t1) + e) + (lu2 + lv2 + nx * ln2b.x + e2)) + e * e
- * (p2 + e * (p3 + e * p4)));
- res = t1 + t2;
- *error = 1.0e-27;
*delta = (t1 - res) + t2;
+ /* Max relative error is 1.0e-21, so accurate to 69.7 bits. */
return res;
}
}
+
/* This function receives a double x and checks if it is an integer. If not,
it returns 0, else it returns 1 if even or -1 if odd. */
static int
@@ -451,7 +329,8 @@ checkint (double x)
int4 i[2];
double x;
} u;
- int k, m, n;
+ int k;
+ unsigned int m, n;
u.x = x;
m = u.i[HIGH_HALF] & 0x7fffffff; /* no sign */
if (m >= 0x7ff00000)
@@ -466,15 +345,15 @@ checkint (double x)
return (n & 1) ? -1 : 1; /* odd or even */
if (k > 20)
{
- if (n << (k - 20))
+ if (n << (k - 20) != 0)
return 0; /* if not integer */
- return (n << (k - 21)) ? -1 : 1;
+ return (n << (k - 21) != 0) ? -1 : 1;
}
if (n)
return 0; /*if not integer */
if (k == 20)
return (m & 1) ? -1 : 1;
- if (m << (k + 12))
+ if (m << (k + 12) != 0)
return 0;
- return (m << (k + 11)) ? -1 : 1;
+ return (m << (k + 11) != 0) ? -1 : 1;
}
diff --git a/sysdeps/ieee754/dbl-64/e_rem_pio2.c b/sysdeps/ieee754/dbl-64/e_rem_pio2.c
index 2f55ca294b..81a3d073d4 100644
--- a/sysdeps/ieee754/dbl-64/e_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/e_rem_pio2.c
@@ -74,7 +74,7 @@ __ieee754_rem_pio2 (double x, double *y)
double z, w, t, r, fn;
double tx[3];
int32_t e0, i, j, nx, n, ix, hx;
- u_int32_t low;
+ uint32_t low;
GET_HIGH_WORD (hx, x); /* high word of x */
ix = hx & 0x7fffffff;
@@ -130,7 +130,7 @@ __ieee754_rem_pio2 (double x, double *y)
}
else
{
- u_int32_t high;
+ uint32_t high;
j = ix >> 20;
y[0] = r - w;
GET_HIGH_WORD (high, y[0]);
diff --git a/sysdeps/ieee754/dbl-64/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c
index a445e74b5c..2e7f0ac1f4 100644
--- a/sysdeps/ieee754/dbl-64/e_remainder.c
+++ b/sysdeps/ieee754/dbl-64/e_remainder.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/e_sinh.c b/sysdeps/ieee754/dbl-64/e_sinh.c
index 8479bdd9b8..c4e34211ac 100644
--- a/sysdeps/ieee754/dbl-64/e_sinh.c
+++ b/sysdeps/ieee754/dbl-64/e_sinh.c
@@ -34,7 +34,9 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const double one = 1.0, shuge = 1.0e307;
@@ -43,7 +45,7 @@ __ieee754_sinh (double x)
{
double t, w, h;
int32_t ix, jx;
- u_int32_t lx;
+ uint32_t lx;
/* High word of |x|. */
GET_HIGH_WORD (jx, x);
@@ -77,7 +79,7 @@ __ieee754_sinh (double x)
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD (lx, x);
- if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (u_int32_t) 0x8fb9f87d)))
+ if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (uint32_t) 0x8fb9f87d)))
{
w = __ieee754_exp (0.5 * fabs (x));
t = h * w;
diff --git a/sysdeps/ieee754/dbl-64/e_sqrt.c b/sysdeps/ieee754/dbl-64/e_sqrt.c
index 8304a2bb63..f70623e17b 100644
--- a/sysdeps/ieee754/dbl-64/e_sqrt.c
+++ b/sysdeps/ieee754/dbl-64/e_sqrt.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -37,6 +37,7 @@
#include <dla.h>
#include "MathLib.h"
#include "root.tbl"
+#include <math-barriers.h>
#include <math_private.h>
/*********************************************************************/
diff --git a/sysdeps/ieee754/dbl-64/eexp.tbl b/sysdeps/ieee754/dbl-64/eexp.tbl
new file mode 100644
index 0000000000..4ee6040638
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/eexp.tbl
@@ -0,0 +1,172 @@
+/* EXP function tables - for use in computing double precision exponential
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* For i = 0, ..., 66,
+ TBL2[2*i] is a double precision number near (i+1)*2^-6, and
+ TBL2[2*i+1] = exp(TBL2[2*i]) to within a relative error less
+ than 2^-60.
+
+ For i = 67, ..., 133,
+ TBL2[2*i] is a double precision number near -(i+1)*2^-6, and
+ TBL2[2*i+1] = exp(TBL2[2*i]) to within a relative error less
+ than 2^-60. */
+
+static const double TBL2[268] = {
+ 0x1.ffffffffffc82p-7, 0x1.04080ab55de32p+0,
+ 0x1.fffffffffffdbp-6, 0x1.08205601127ecp+0,
+ 0x1.80000000000a0p-5, 0x1.0c49236829e91p+0,
+ 0x1.fffffffffff79p-5, 0x1.1082b577d34e9p+0,
+ 0x1.3fffffffffffcp-4, 0x1.14cd4fc989cd6p+0,
+ 0x1.8000000000060p-4, 0x1.192937074e0d4p+0,
+ 0x1.c000000000061p-4, 0x1.1d96b0eff0e80p+0,
+ 0x1.fffffffffffd6p-4, 0x1.2216045b6f5cap+0,
+ 0x1.1ffffffffff58p-3, 0x1.26a7793f6014cp+0,
+ 0x1.3ffffffffff75p-3, 0x1.2b4b58b372c65p+0,
+ 0x1.5ffffffffff00p-3, 0x1.3001ecf601ad1p+0,
+ 0x1.8000000000020p-3, 0x1.34cb8170b583ap+0,
+ 0x1.9ffffffffa629p-3, 0x1.39a862bd3b344p+0,
+ 0x1.c00000000000fp-3, 0x1.3e98deaa11dcep+0,
+ 0x1.e00000000007fp-3, 0x1.439d443f5f16dp+0,
+ 0x1.0000000000072p-2, 0x1.48b5e3c3e81abp+0,
+ 0x1.0fffffffffecap-2, 0x1.4de30ec211dfbp+0,
+ 0x1.1ffffffffff8fp-2, 0x1.5325180cfacd2p+0,
+ 0x1.300000000003bp-2, 0x1.587c53c5a7b04p+0,
+ 0x1.4000000000034p-2, 0x1.5de9176046007p+0,
+ 0x1.4ffffffffff89p-2, 0x1.636bb9a98322fp+0,
+ 0x1.5ffffffffffe7p-2, 0x1.690492cbf942ap+0,
+ 0x1.6ffffffffff78p-2, 0x1.6eb3fc55b1e45p+0,
+ 0x1.7ffffffffff65p-2, 0x1.747a513dbef32p+0,
+ 0x1.8ffffffffffd5p-2, 0x1.7a57ede9ea22ep+0,
+ 0x1.9ffffffffff6ep-2, 0x1.804d30347b50fp+0,
+ 0x1.affffffffffc3p-2, 0x1.865a7772164aep+0,
+ 0x1.c000000000053p-2, 0x1.8c802477b0030p+0,
+ 0x1.d00000000004dp-2, 0x1.92be99a09bf1ep+0,
+ 0x1.e000000000096p-2, 0x1.99163ad4b1e08p+0,
+ 0x1.efffffffffefap-2, 0x1.9f876d8e8c4fcp+0,
+ 0x1.fffffffffffd0p-2, 0x1.a61298e1e0688p+0,
+ 0x1.0800000000002p-1, 0x1.acb82581eee56p+0,
+ 0x1.100000000001fp-1, 0x1.b3787dc80f979p+0,
+ 0x1.17ffffffffff8p-1, 0x1.ba540dba56e4fp+0,
+ 0x1.1fffffffffffap-1, 0x1.c14b431256441p+0,
+ 0x1.27fffffffffc4p-1, 0x1.c85e8d43f7c9bp+0,
+ 0x1.2fffffffffffdp-1, 0x1.cf8e5d84758a6p+0,
+ 0x1.380000000001fp-1, 0x1.d6db26d16cd84p+0,
+ 0x1.3ffffffffffd8p-1, 0x1.de455df80e39bp+0,
+ 0x1.4800000000052p-1, 0x1.e5cd799c6a59cp+0,
+ 0x1.4ffffffffffc8p-1, 0x1.ed73f240dc10cp+0,
+ 0x1.5800000000013p-1, 0x1.f539424d90f71p+0,
+ 0x1.5ffffffffffbcp-1, 0x1.fd1de6182f885p+0,
+ 0x1.680000000002dp-1, 0x1.02912df5ce741p+1,
+ 0x1.7000000000040p-1, 0x1.06a39207f0a2ap+1,
+ 0x1.780000000004fp-1, 0x1.0ac660691652ap+1,
+ 0x1.7ffffffffff6fp-1, 0x1.0ef9db467dcabp+1,
+ 0x1.87fffffffffe5p-1, 0x1.133e45d82e943p+1,
+ 0x1.9000000000035p-1, 0x1.1793e4652cc6dp+1,
+ 0x1.97fffffffffb3p-1, 0x1.1bfafc47bda48p+1,
+ 0x1.a000000000000p-1, 0x1.2073d3f1bd518p+1,
+ 0x1.a80000000004ap-1, 0x1.24feb2f105ce2p+1,
+ 0x1.affffffffffedp-1, 0x1.299be1f3e7f11p+1,
+ 0x1.b7ffffffffffbp-1, 0x1.2e4baacdb6611p+1,
+ 0x1.c00000000001dp-1, 0x1.330e587b62b39p+1,
+ 0x1.c800000000079p-1, 0x1.37e437282d538p+1,
+ 0x1.cffffffffff51p-1, 0x1.3ccd943268248p+1,
+ 0x1.d7fffffffff74p-1, 0x1.41cabe304cadcp+1,
+ 0x1.e000000000011p-1, 0x1.46dc04f4e5343p+1,
+ 0x1.e80000000001ep-1, 0x1.4c01b9950a124p+1,
+ 0x1.effffffffff9ep-1, 0x1.513c2e6c73196p+1,
+ 0x1.f7fffffffffedp-1, 0x1.568bb722dd586p+1,
+ 0x1.0000000000034p+0, 0x1.5bf0a8b1457b0p+1,
+ 0x1.03fffffffffe2p+0, 0x1.616b5967376dfp+1,
+ 0x1.07fffffffff4bp+0, 0x1.66fc20f0337a9p+1,
+ 0x1.0bffffffffffdp+0, 0x1.6ca35859290f5p+1,
+ -0x1.fffffffffffe4p-7, 0x1.f80feabfeefa5p-1,
+ -0x1.ffffffffffb0bp-6, 0x1.f03f56a88b5fep-1,
+ -0x1.7ffffffffffa7p-5, 0x1.e88dc6afecfc5p-1,
+ -0x1.ffffffffffea8p-5, 0x1.e0fabfbc702b8p-1,
+ -0x1.3ffffffffffb3p-4, 0x1.d985c89d041acp-1,
+ -0x1.7ffffffffffe3p-4, 0x1.d22e6a0197c06p-1,
+ -0x1.bffffffffff9ap-4, 0x1.caf42e73a4c89p-1,
+ -0x1.fffffffffff98p-4, 0x1.c3d6a24ed822dp-1,
+ -0x1.1ffffffffffe9p-3, 0x1.bcd553b9d7b67p-1,
+ -0x1.3ffffffffffe0p-3, 0x1.b5efd29f24c2dp-1,
+ -0x1.5fffffffff553p-3, 0x1.af25b0a61a9f4p-1,
+ -0x1.7ffffffffff8bp-3, 0x1.a876812c08794p-1,
+ -0x1.9fffffffffe51p-3, 0x1.a1e1d93d68828p-1,
+ -0x1.bffffffffff6ep-3, 0x1.9b674f8f2f3f5p-1,
+ -0x1.dffffffffff7fp-3, 0x1.95067c7837a0cp-1,
+ -0x1.fffffffffff7ap-3, 0x1.8ebef9eac8225p-1,
+ -0x1.0fffffffffffep-2, 0x1.8890636e31f55p-1,
+ -0x1.1ffffffffff41p-2, 0x1.827a56188975ep-1,
+ -0x1.2ffffffffffbap-2, 0x1.7c7c708877656p-1,
+ -0x1.3fffffffffff8p-2, 0x1.769652df22f81p-1,
+ -0x1.4ffffffffff90p-2, 0x1.70c79eba33c2fp-1,
+ -0x1.5ffffffffffdbp-2, 0x1.6b0ff72deb8aap-1,
+ -0x1.6ffffffffff9ap-2, 0x1.656f00bf5798ep-1,
+ -0x1.7ffffffffff9fp-2, 0x1.5fe4615e98eb0p-1,
+ -0x1.8ffffffffffeep-2, 0x1.5a6fc061433cep-1,
+ -0x1.9fffffffffc4ap-2, 0x1.5510c67cd26cdp-1,
+ -0x1.affffffffff30p-2, 0x1.4fc71dc13566bp-1,
+ -0x1.bfffffffffff0p-2, 0x1.4a9271936fd0ep-1,
+ -0x1.cfffffffffff3p-2, 0x1.45726ea84fb8cp-1,
+ -0x1.dfffffffffff3p-2, 0x1.4066c2ff3912bp-1,
+ -0x1.effffffffff80p-2, 0x1.3b6f1ddd05ab9p-1,
+ -0x1.fffffffffffdfp-2, 0x1.368b2fc6f9614p-1,
+ -0x1.0800000000000p-1, 0x1.31baaa7dca843p-1,
+ -0x1.0ffffffffffa4p-1, 0x1.2cfd40f8bdce4p-1,
+ -0x1.17fffffffff0ap-1, 0x1.2852a760d5ce7p-1,
+ -0x1.2000000000000p-1, 0x1.23ba930c1568bp-1,
+ -0x1.27fffffffffbbp-1, 0x1.1f34ba78d568dp-1,
+ -0x1.2fffffffffe32p-1, 0x1.1ac0d5492c1dbp-1,
+ -0x1.37ffffffff042p-1, 0x1.165e9c3e67ef2p-1,
+ -0x1.3ffffffffff77p-1, 0x1.120dc93499431p-1,
+ -0x1.47fffffffff6bp-1, 0x1.0dce171e34ecep-1,
+ -0x1.4fffffffffff1p-1, 0x1.099f41ffbe588p-1,
+ -0x1.57ffffffffe02p-1, 0x1.058106eb8a7aep-1,
+ -0x1.5ffffffffffe5p-1, 0x1.017323fd9002ep-1,
+ -0x1.67fffffffffb0p-1, 0x1.faeab0ae9386cp-2,
+ -0x1.6ffffffffffb2p-1, 0x1.f30ec837503d7p-2,
+ -0x1.77fffffffff7fp-1, 0x1.eb5210d627133p-2,
+ -0x1.7ffffffffffe8p-1, 0x1.e3b40ebefcd95p-2,
+ -0x1.87fffffffffc8p-1, 0x1.dc3448110dae2p-2,
+ -0x1.8fffffffffb30p-1, 0x1.d4d244cf4ef06p-2,
+ -0x1.97fffffffffefp-1, 0x1.cd8d8ed8ee395p-2,
+ -0x1.9ffffffffffa7p-1, 0x1.c665b1e1f1e5cp-2,
+ -0x1.a7fffffffffdcp-1, 0x1.bf5a3b6bf18d6p-2,
+ -0x1.affffffffff95p-1, 0x1.b86ababeef93bp-2,
+ -0x1.b7fffffffffcbp-1, 0x1.b196c0e24d256p-2,
+ -0x1.bffffffffff32p-1, 0x1.aadde095dadf7p-2,
+ -0x1.c7fffffffff6ap-1, 0x1.a43fae4b047c9p-2,
+ -0x1.cffffffffffb6p-1, 0x1.9dbbc01e182a4p-2,
+ -0x1.d7fffffffffcap-1, 0x1.9751adcfa81ecp-2,
+ -0x1.dffffffffffcdp-1, 0x1.910110be0699ep-2,
+ -0x1.e7ffffffffffbp-1, 0x1.8ac983dedbc69p-2,
+ -0x1.effffffffff88p-1, 0x1.84aaa3b8d51a9p-2,
+ -0x1.f7fffffffffbbp-1, 0x1.7ea40e5d6d92ep-2,
+ -0x1.fffffffffffdbp-1, 0x1.78b56362cef53p-2,
+ -0x1.03fffffffff00p+0, 0x1.72de43ddcb1f2p-2,
+ -0x1.07ffffffffe6fp+0, 0x1.6d1e525bed085p-2,
+ -0x1.0bfffffffffd6p+0, 0x1.677532dda1c57p-2};
+
+static const double
+ half = 0.5,
+ one = 1.0,
+/* t2-t5 terms used for polynomial computation. */
+ t2 = 0x1.5555555555555p-3, /* 1.6666666666666665741e-1 */
+ t3 = 0x1.5555555555555p-5, /* 4.1666666666666664354e-2 */
+ t4 = 0x1.1111111111111p-7, /* 8.3333333333333332177e-3 */
+ t5 = 0x1.6c16c16c16c17p-10; /* 1.3888888888888889419e-3 */
diff --git a/sysdeps/ieee754/dbl-64/gamma_product.c b/sysdeps/ieee754/dbl-64/gamma_product.c
index 7ae144aeb3..3300b5139c 100644
--- a/sysdeps/ieee754/dbl-64/gamma_product.c
+++ b/sysdeps/ieee754/dbl-64/gamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_split.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
diff --git a/sysdeps/ieee754/dbl-64/gamma_productf.c b/sysdeps/ieee754/dbl-64/gamma_productf.c
index 58b4e761fe..011c6ff06e 100644
--- a/sysdeps/ieee754/dbl-64/gamma_productf.c
+++ b/sysdeps/ieee754/dbl-64/gamma_productf.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
diff --git a/sysdeps/ieee754/dbl-64/halfulp.c b/sysdeps/ieee754/dbl-64/halfulp.c
deleted file mode 100644
index 5e3e731754..0000000000
--- a/sysdeps/ieee754/dbl-64/halfulp.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/************************************************************************/
-/* */
-/* MODULE_NAME:halfulp.c */
-/* */
-/* FUNCTIONS:halfulp */
-/* FILES NEEDED: mydefs.h dla.h endian.h */
-/* uroot.c */
-/* */
-/*Routine halfulp(double x, double y) computes x^y where result does */
-/*not need rounding. If the result is closer to 0 than can be */
-/*represented it returns 0. */
-/* In the following cases the function does not compute anything */
-/*and returns a negative number: */
-/*1. if the result needs rounding, */
-/*2. if y is outside the interval [0, 2^20-1], */
-/*3. if x can be represented by x=2**n for some integer n. */
-/************************************************************************/
-
-#include "endian.h"
-#include "mydefs.h"
-#include <dla.h>
-#include <math_private.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-static const int4 tab54[32] = {
- 262143, 11585, 1782, 511, 210, 107, 63, 42,
- 30, 22, 17, 14, 12, 10, 9, 7,
- 7, 6, 5, 5, 5, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3
-};
-
-
-double
-SECTION
-__halfulp (double x, double y)
-{
- mynumber v;
- double z, u, uu;
-#ifndef DLA_FMS
- double j1, j2, j3, j4, j5;
-#endif
- int4 k, l, m, n;
- if (y <= 0) /*if power is negative or zero */
- {
- v.x = y;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
- v.x = x;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
- if ((v.i[HIGH_HALF] & 0x000fffff) != 0)
- return -10; /* if x =2 ^ n */
- k = ((v.i[HIGH_HALF] & 0x7fffffff) >> 20) - 1023; /* find this n */
- z = (double) k;
- return (z * y == -1075.0) ? 0 : -10.0;
- }
- /* if y > 0 */
- v.x = y;
- if (v.i[LOW_HALF] != 0)
- return -10.0;
-
- v.x = x;
- /* case where x = 2**n for some integer n */
- if (((v.i[HIGH_HALF] & 0x000fffff) | v.i[LOW_HALF]) == 0)
- {
- k = (v.i[HIGH_HALF] >> 20) - 1023;
- return (((double) k) * y == -1075.0) ? 0 : -10.0;
- }
-
- v.x = y;
- k = v.i[HIGH_HALF];
- m = k << 12;
- l = 0;
- while (m)
- {
- m = m << 1; l++;
- }
- n = (k & 0x000fffff) | 0x00100000;
- n = n >> (20 - l); /* n is the odd integer of y */
- k = ((k >> 20) - 1023) - l; /* y = n*2**k */
- if (k > 5)
- return -10.0;
- if (k > 0)
- for (; k > 0; k--)
- n *= 2;
- if (n > 34)
- return -10.0;
- k = -k;
- if (k > 5)
- return -10.0;
-
- /* now treat x */
- while (k > 0)
- {
- z = __ieee754_sqrt (x);
- EMULV (z, z, u, uu, j1, j2, j3, j4, j5);
- if (((u - x) + uu) != 0)
- break;
- x = z;
- k--;
- }
- if (k)
- return -10.0;
-
- /* it is impossible that n == 2, so the mantissa of x must be short */
-
- v.x = x;
- if (v.i[LOW_HALF])
- return -10.0;
- k = v.i[HIGH_HALF];
- m = k << 12;
- l = 0;
- while (m)
- {
- m = m << 1; l++;
- }
- m = (k & 0x000fffff) | 0x00100000;
- m = m >> (20 - l); /* m is the odd integer of x */
-
- /* now check whether the length of m**n is at most 54 bits */
-
- if (m > tab54[n - 3])
- return -10.0;
-
- /* yes, it is - now compute x**n by simple multiplications */
-
- u = x;
- for (k = 1; k < n; k++)
- u = u * x;
- return u;
-}
diff --git a/sysdeps/ieee754/dbl-64/k_rem_pio2.c b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
index e58c9e854c..d8403dc345 100644
--- a/sysdeps/ieee754/dbl-64/k_rem_pio2.c
+++ b/sysdeps/ieee754/dbl-64/k_rem_pio2.c
@@ -131,7 +131,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const int init_jk[] = {2,3,4,6}; /* initial value for jk */
@@ -251,8 +253,17 @@ recompute:
j |= iq[i];
if (j == 0) /* need recomputation */
{
+ /* On s390x gcc 6.1 -O3 produces the warning "array subscript is below
+ array bounds [-Werror=array-bounds]". Only __ieee754_rem_pio2l
+ calls __kernel_rem_pio2 for normal numbers and |x| > pi/4 in case
+ of ldbl-96 and |x| > 3pi/4 in case of ldbl-128[ibm].
+ Thus x can't be zero and ipio2 is not zero, too. Thus not all iq[]
+ values can't be zero. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
for (k = 1; iq[jk - k] == 0; k++)
; /* k = no. of terms needed */
+ DIAG_POP_NEEDS_COMMENT;
for (i = jz + 1; i <= jz + k; i++) /* add q[jz+1] to q[jz+k] */
{
@@ -319,7 +330,16 @@ recompute:
for (i = jz; i >= 0; i--)
fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih == 0) ? fv : -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on i686, warns
+ that fq[0] may be used uninitialized. This is not possible
+ because jz is always nonnegative when the above loop
+ initializing fq is executed, because the result is never zero
+ to full precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0] - fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i = 1; i <= jz; i++)
fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih == 0) ? fv : -fv;
diff --git a/sysdeps/ieee754/dbl-64/lgamma_neg.c b/sysdeps/ieee754/dbl-64/lgamma_neg.c
index fbf992203c..5bb2f10c71 100644
--- a/sysdeps/ieee754/dbl-64/lgamma_neg.c
+++ b/sysdeps/ieee754/dbl-64/lgamma_neg.c
@@ -1,5 +1,5 @@
/* lgamma expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const double lgamma_zeros[][2] =
diff --git a/sysdeps/ieee754/dbl-64/lgamma_product.c b/sysdeps/ieee754/dbl-64/lgamma_product.c
index d956575bc7..b37ecee73f 100644
--- a/sysdeps/ieee754/dbl-64/lgamma_product.c
+++ b/sysdeps/ieee754/dbl-64/lgamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_split.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
diff --git a/sysdeps/ieee754/dbl-64/mpa-arch.h b/sysdeps/ieee754/dbl-64/mpa-arch.h
index ea33a14219..d1a2bf8ac4 100644
--- a/sysdeps/ieee754/dbl-64/mpa-arch.h
+++ b/sysdeps/ieee754/dbl-64/mpa-arch.h
@@ -1,5 +1,5 @@
/* Overridable constants and operations.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpa.c b/sysdeps/ieee754/dbl-64/mpa.c
index 4b21d1d2e6..f59ec6a9d8 100644
--- a/sysdeps/ieee754/dbl-64/mpa.c
+++ b/sysdeps/ieee754/dbl-64/mpa.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpa.h b/sysdeps/ieee754/dbl-64/mpa.h
index b8ca297eb7..1e188de4d1 100644
--- a/sysdeps/ieee754/dbl-64/mpa.h
+++ b/sysdeps/ieee754/dbl-64/mpa.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -119,36 +119,5 @@ void __dvd (const mp_no *, const mp_no *, mp_no *, int);
extern void __mpatan (mp_no *, mp_no *, int);
extern void __mpatan2 (mp_no *, mp_no *, mp_no *, int);
extern void __mpsqrt (mp_no *, mp_no *, int);
-extern void __mpexp (mp_no *, mp_no *, int);
extern void __c32 (mp_no *, mp_no *, mp_no *, int);
extern int __mpranred (double, mp_no *, int);
-
-/* Given a power POW, build a multiprecision number 2^POW. */
-static inline void
-__pow_mp (int pow, mp_no *y, int p)
-{
- int i, rem;
-
- /* The exponent is E such that E is a factor of 2^24. The remainder (of the
- form 2^x) goes entirely into the first digit of the mantissa as it is
- always less than 2^24. */
- EY = pow / 24;
- rem = pow - EY * 24;
- EY++;
-
- /* If the remainder is negative, it means that POW was negative since
- |EY * 24| <= |pow|. Adjust so that REM is positive and still less than
- 24 because of which, the mantissa digit is less than 2^24. */
- if (rem < 0)
- {
- EY--;
- rem += 24;
- }
- /* The sign of any 2^x is always positive. */
- Y[0] = 1;
- Y[1] = 1 << rem;
-
- /* Everything else is 0. */
- for (i = 2; i <= p; i++)
- Y[i] = 0;
-}
diff --git a/sysdeps/ieee754/dbl-64/mpatan.c b/sysdeps/ieee754/dbl-64/mpatan.c
index dbd49b2bee..656dc763aa 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.c
+++ b/sysdeps/ieee754/dbl-64/mpatan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpatan.h b/sysdeps/ieee754/dbl-64/mpatan.h
index 36c02602ac..2e34ce8a4d 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.h
+++ b/sysdeps/ieee754/dbl-64/mpatan.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpatan2.c b/sysdeps/ieee754/dbl-64/mpatan2.c
index e7de6bc158..6eda7d39eb 100644
--- a/sysdeps/ieee754/dbl-64/mpatan2.c
+++ b/sysdeps/ieee754/dbl-64/mpatan2.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
deleted file mode 100644
index f17baf2139..0000000000
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/*************************************************************************/
-/* MODULE_NAME:mpexp.c */
-/* */
-/* FUNCTIONS: mpexp */
-/* */
-/* FILES NEEDED: mpa.h endian.h mpexp.h */
-/* mpa.c */
-/* */
-/* Multi-Precision exponential function subroutine */
-/* ( for p >= 4, 2**(-55) <= abs(x) <= 1024 ). */
-/*************************************************************************/
-
-#include "endian.h"
-#include "mpa.h"
-#include <assert.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-/* Multi-Precision exponential function subroutine (for p >= 4,
- 2**(-55) <= abs(x) <= 1024). */
-void
-SECTION
-__mpexp (mp_no *x, mp_no *y, int p)
-{
- int i, j, k, m, m1, m2, n;
- mantissa_t b;
- static const int np[33] =
- {
- 0, 0, 0, 0, 3, 3, 4, 4, 5, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8
- };
-
- static const int m1p[33] =
- {
- 0, 0, 0, 0,
- 17, 23, 23, 28,
- 27, 38, 42, 39,
- 43, 47, 43, 47,
- 50, 54, 57, 60,
- 64, 67, 71, 74,
- 68, 71, 74, 77,
- 70, 73, 76, 78,
- 81
- };
- static const int m1np[7][18] =
- {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 36, 48, 60, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 24, 32, 40, 48, 56, 64, 72, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 17, 23, 29, 35, 41, 47, 53, 59, 65, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 23, 28, 33, 38, 42, 47, 52, 57, 62, 66, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 39, 43, 47, 51, 55, 59, 63},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 47, 50, 54}
- };
- mp_no mps, mpk, mpt1, mpt2;
-
- /* Choose m,n and compute a=2**(-m). */
- n = np[p];
- m1 = m1p[p];
- b = X[1];
- m2 = 24 * EX;
- for (; b < HALFRAD; m2--)
- b *= 2;
- if (b == HALFRAD)
- {
- for (i = 2; i <= p; i++)
- {
- if (X[i] != 0)
- break;
- }
- if (i == p + 1)
- m2--;
- }
-
- m = m1 + m2;
- if (__glibc_unlikely (m <= 0))
- {
- /* The m1np array which is used to determine if we can reduce the
- polynomial expansion iterations, has only 18 elements. Besides,
- numbers smaller than those required by p >= 18 should not come here
- at all since the fast phase of exp returns 1.0 for anything less
- than 2^-55. */
- assert (p < 18);
- m = 0;
- for (i = n - 1; i > 0; i--, n--)
- if (m1np[i][p] + m2 > 0)
- break;
- }
-
- /* Compute s=x*2**(-m). Put result in mps. This is the range-reduced input
- that we will use to compute e^s. For the final result, simply raise it
- to 2^m. */
- __pow_mp (-m, &mpt1, p);
- __mul (x, &mpt1, &mps, p);
-
- /* Compute the Taylor series for e^s:
-
- 1 + x/1! + x^2/2! + x^3/3! ...
-
- for N iterations. We compute this as:
-
- e^x = 1 + (x * n!/1! + x^2 * n!/2! + x^3 * n!/3!) / n!
- = 1 + (x * (n!/1! + x * (n!/2! + x * (n!/3! + x ...)))) / n!
-
- k! is computed on the fly as KF and at the end of the polynomial loop, KF
- is n!, which can be used directly. */
- __cpy (&mps, &mpt2, p);
-
- double kf = 1.0;
-
- /* Evaluate the rest. The result will be in mpt2. */
- for (k = n - 1; k > 0; k--)
- {
- /* n! / k! = n * (n - 1) ... * (n - k + 1) */
- kf *= k + 1;
-
- __dbl_mp (kf, &mpk, p);
- __add (&mpt2, &mpk, &mpt1, p);
- __mul (&mps, &mpt1, &mpt2, p);
- }
- __dbl_mp (kf, &mpk, p);
- __dvd (&mpt2, &mpk, &mpt1, p);
- __add (&__mpone, &mpt1, &mpt2, p);
-
- /* Raise polynomial value to the power of 2**m. Put result in y. */
- for (k = 0, j = 0; k < m;)
- {
- __sqr (&mpt2, &mpt1, p);
- k++;
- if (k == m)
- {
- j = 1;
- break;
- }
- __sqr (&mpt1, &mpt2, p);
- k++;
- }
- if (j)
- __cpy (&mpt1, y, p);
- else
- __cpy (&mpt2, y, p);
- return;
-}
diff --git a/sysdeps/ieee754/dbl-64/mplog.c b/sysdeps/ieee754/dbl-64/mplog.c
deleted file mode 100644
index b297153b10..0000000000
--- a/sysdeps/ieee754/dbl-64/mplog.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/************************************************************************/
-/* */
-/* MODULE_NAME:mplog.c */
-/* */
-/* FUNCTIONS: mplog */
-/* */
-/* FILES NEEDED: endian.h mpa.h mplog.h */
-/* mpexp.c */
-/* */
-/* Multi-Precision logarithm function subroutine (for precision p >= 4, */
-/* 2**(-1024) < x < 2**1024) and x is outside of the interval */
-/* [1-2**(-54),1+2**(-54)]. Upon entry, x should be set to the */
-/* multi-precision value of the input and y should be set into a multi- */
-/* precision value of an approximation of log(x) with relative error */
-/* bound of at most 2**(-52). The routine improves the accuracy of y. */
-/* */
-/************************************************************************/
-#include "endian.h"
-#include "mpa.h"
-
-void
-__mplog (mp_no *x, mp_no *y, int p)
-{
- int i, m;
- static const int mp[33] =
- {
- 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
- };
- mp_no mpt1, mpt2;
-
- /* Choose m. */
- m = mp[p];
-
- /* Perform m newton iterations to solve for y: exp(y) - x = 0. The
- iterations formula is: y(n + 1) = y(n) + (x * exp(-y(n)) - 1). */
- __cpy (y, &mpt1, p);
- for (i = 0; i < m; i++)
- {
- mpt1.d[0] = -mpt1.d[0];
- __mpexp (&mpt1, &mpt2, p);
- __mul (x, &mpt2, &mpt1, p);
- __sub (&mpt1, &__mpone, &mpt2, p);
- __add (y, &mpt2, &mpt1, p);
- __cpy (&mpt1, y, p);
- }
-}
diff --git a/sysdeps/ieee754/dbl-64/mpn2dbl.c b/sysdeps/ieee754/dbl-64/mpn2dbl.c
index 1050ec3b0e..693448fc8d 100644
--- a/sysdeps/ieee754/dbl-64/mpn2dbl.c
+++ b/sysdeps/ieee754/dbl-64/mpn2dbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/dbl-64/mpsqrt.c b/sysdeps/ieee754/dbl-64/mpsqrt.c
index a77d3938a9..3ce4b9cda7 100644
--- a/sysdeps/ieee754/dbl-64/mpsqrt.c
+++ b/sysdeps/ieee754/dbl-64/mpsqrt.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mpsqrt.h b/sysdeps/ieee754/dbl-64/mpsqrt.h
index 0f1cf58fb2..05a907bedf 100644
--- a/sysdeps/ieee754/dbl-64/mpsqrt.h
+++ b/sysdeps/ieee754/dbl-64/mpsqrt.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mptan.c b/sysdeps/ieee754/dbl-64/mptan.c
index 280c4909d6..26dbd5f601 100644
--- a/sysdeps/ieee754/dbl-64/mptan.c
+++ b/sysdeps/ieee754/dbl-64/mptan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/mydefs.h b/sysdeps/ieee754/dbl-64/mydefs.h
index b1d67d4445..3e15d5bdd6 100644
--- a/sysdeps/ieee754/dbl-64/mydefs.h
+++ b/sysdeps/ieee754/dbl-64/mydefs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/powtwo.tbl b/sysdeps/ieee754/dbl-64/powtwo.tbl
index 2d828f6022..518fd6cd4b 100644
--- a/sysdeps/ieee754/dbl-64/powtwo.tbl
+++ b/sysdeps/ieee754/dbl-64/powtwo.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/root.tbl b/sysdeps/ieee754/dbl-64/root.tbl
index 61c859248c..a458e25ee2 100644
--- a/sysdeps/ieee754/dbl-64/root.tbl
+++ b/sysdeps/ieee754/dbl-64/root.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c
index 9193301b5e..192ff8594d 100644
--- a/sysdeps/ieee754/dbl-64/s_asinh.c
+++ b/sysdeps/ieee754/dbl-64/s_asinh.c
@@ -24,6 +24,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
static const double
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
@@ -54,19 +56,15 @@ __asinh (double x)
double xa = fabs (x);
if (ix > 0x40000000) /* 2**28 > |x| > 2.0 */
{
- w = __ieee754_log (2.0 * xa + one / (__ieee754_sqrt (xa * xa + one) +
+ w = __ieee754_log (2.0 * xa + one / (sqrt (xa * xa + one) +
xa));
}
else /* 2.0 > |x| > 2**-28 */
{
double t = xa * xa;
- w = __log1p (xa + t / (one + __ieee754_sqrt (one + t)));
+ w = __log1p (xa + t / (one + sqrt (one + t)));
}
}
return __copysign (w, x);
}
-weak_alias (__asinh, asinh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__asinh, __asinhl)
-weak_alias (__asinh, asinhl)
-#endif
+libm_alias_double (__asinh, asinh)
diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c
index 780c3ff17a..38db092d04 100644
--- a/sysdeps/ieee754/dbl-64/s_atan.c
+++ b/sysdeps/ieee754/dbl-64/s_atan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -43,8 +43,10 @@
#include "atnat.h"
#include <fenv.h>
#include <float.h>
+#include <libm-alias-double.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <stap-probe.h>
void __mpatan (mp_no *, mp_no *, int); /* see definition in mpatan.c */
@@ -61,7 +63,7 @@ __signArctan (double x, double y)
/* An ultimate atan() routine. Given an IEEE double machine number x, */
/* routine computes the correctly rounded (to nearest) value of atan(x). */
double
-atan (double x)
+__atan (double x)
{
double cor, s1, ss1, s2, ss2, t1, t2, t3, t7, t8, t9, t10, u, u2, u3,
v, vv, w, ww, y, yy, z, zz;
@@ -323,6 +325,6 @@ atanMp (double x, const int pr[])
return y1; /*if impossible to do exact computing */
}
-#ifdef NO_LONG_DOUBLE
-weak_alias (atan, atanl)
+#ifndef __atan
+libm_alias_double (__atan, atan)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_cbrt.c b/sysdeps/ieee754/dbl-64/s_cbrt.c
index 647f30bc71..6cd55dc0d6 100644
--- a/sysdeps/ieee754/dbl-64/s_cbrt.c
+++ b/sysdeps/ieee754/dbl-64/s_cbrt.c
@@ -1,5 +1,5 @@
/* Compute cubic root of double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -69,8 +70,4 @@ __cbrt (double x)
return __ldexp (x > 0.0 ? ym : -ym, xe / 3);
}
-weak_alias (__cbrt, cbrt)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__cbrt, __cbrtl)
-weak_alias (__cbrt, cbrtl)
-#endif
+libm_alias_double (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/dbl-64/s_ceil.c b/sysdeps/ieee754/dbl-64/s_ceil.c
index b2154b407d..5a7434c737 100644
--- a/sysdeps/ieee754/dbl-64/s_ceil.c
+++ b/sysdeps/ieee754/dbl-64/s_ceil.c
@@ -15,27 +15,23 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__ceil (double x)
{
int32_t i0, i1, j0;
- u_int32_t i, j;
+ uint32_t i, j;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (j0 < 20)
{
- if (j0 < 0) /* raise inexact if x != 0 */
+ if (j0 < 0)
{
- math_force_eval (huge + x);
/* return 0*sign(x) if |x|<1 */
if (i0 < 0)
{
@@ -51,7 +47,6 @@ __ceil (double x)
i = (0x000fffff) >> j0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 > 0)
i0 += (0x00100000) >> j0;
i0 &= (~i); i1 = 0;
@@ -66,10 +61,9 @@ __ceil (double x)
}
else
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 > 0)
{
if (j0 == 20)
@@ -88,9 +82,5 @@ __ceil (double x)
return x;
}
#ifndef __ceil
-weak_alias (__ceil, ceil)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-# endif
+libm_alias_double (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_copysign.c b/sysdeps/ieee754/dbl-64/s_copysign.c
index 9caf24e8f2..ab81d732ab 100644
--- a/sysdeps/ieee754/dbl-64/s_copysign.c
+++ b/sysdeps/ieee754/dbl-64/s_copysign.c
@@ -22,18 +22,15 @@ static char rcsid[] = "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
__copysign (double x, double y)
{
- u_int32_t hx, hy;
+ uint32_t hx, hy;
GET_HIGH_WORD (hx, x);
GET_HIGH_WORD (hy, y);
SET_HIGH_WORD (x, (hx & 0x7fffffff) | (hy & 0x80000000));
return x;
}
-weak_alias (__copysign, copysign)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__copysign, __copysignl)
-weak_alias (__copysign, copysignl)
-#endif
+libm_alias_double (__copysign, copysign)
diff --git a/sysdeps/ieee754/dbl-64/s_erf.c b/sysdeps/ieee754/dbl-64/s_erf.c
index b4975a8af8..5f820604f8 100644
--- a/sysdeps/ieee754/dbl-64/s_erf.c
+++ b/sysdeps/ieee754/dbl-64/s_erf.c
@@ -115,7 +115,10 @@ static char rcsid[] = "$NetBSD: s_erf.c,v 1.8 1995/05/10 20:47:05 jtc Exp $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fix-int-fp-convert-zero.h>
static const double
@@ -201,7 +204,7 @@ __erf (double x)
ix = hx & 0x7fffffff;
if (ix >= 0x7ff00000) /* erf(nan)=nan */
{
- i = ((u_int32_t) hx >> 31) << 1;
+ i = ((uint32_t) hx >> 31) << 1;
return (double) (1 - i) + one / x; /* erf(+-inf)=+-1 */
}
@@ -294,11 +297,7 @@ __erf (double x)
else
return r / x - one;
}
-weak_alias (__erf, erf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erf, __erfl)
-weak_alias (__erf, erfl)
-#endif
+libm_alias_double (__erf, erf)
double
__erfc (double x)
@@ -309,7 +308,7 @@ __erfc (double x)
ix = hx & 0x7fffffff;
if (ix >= 0x7ff00000) /* erfc(nan)=nan */
{ /* erfc(+-inf)=0,2 */
- double ret = (double) (((u_int32_t) hx >> 31) << 1) + one / x;
+ double ret = (double) (((uint32_t) hx >> 31) << 1) + one / x;
if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0)
return 0.0;
return ret;
@@ -421,8 +420,4 @@ __erfc (double x)
return two - tiny;
}
}
-weak_alias (__erfc, erfc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__erfc, __erfcl)
-weak_alias (__erfc, erfcl)
-#endif
+libm_alias_double (__erfc, erfc)
diff --git a/sysdeps/ieee754/dbl-64/s_expm1.c b/sysdeps/ieee754/dbl-64/s_expm1.c
index 54d771007a..8f1c95bd04 100644
--- a/sysdeps/ieee754/dbl-64/s_expm1.c
+++ b/sysdeps/ieee754/dbl-64/s_expm1.c
@@ -111,7 +111,10 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#define one Q[0]
static const double
huge = 1.0e+300,
@@ -132,7 +135,7 @@ __expm1 (double x)
{
double y, hi, lo, c, t, e, hxs, hfx, r1, h2, h4, R1, R2, R3;
int32_t k, xsb;
- u_int32_t hx;
+ uint32_t hx;
GET_HIGH_WORD (hx, x);
xsb = hx & 0x80000000; /* sign bit of x */
@@ -149,7 +152,7 @@ __expm1 (double x)
{
if (hx >= 0x7ff00000)
{
- u_int32_t low;
+ uint32_t low;
GET_LOW_WORD (low, x);
if (((hx & 0xfffff) | low) != 0)
return x + x; /* NaN */
@@ -228,7 +231,7 @@ __expm1 (double x)
}
if (k <= -2 || k > 56) /* suffice to return exp(x)-1 */
{
- u_int32_t high;
+ uint32_t high;
y = one - (e - x);
GET_HIGH_WORD (high, y);
SET_HIGH_WORD (y, high + (k << 20)); /* add k to y's exponent */
@@ -237,7 +240,7 @@ __expm1 (double x)
t = one;
if (k < 20)
{
- u_int32_t high;
+ uint32_t high;
SET_HIGH_WORD (t, 0x3ff00000 - (0x200000 >> k)); /* t=1-2^-k */
y = t - (e - x);
GET_HIGH_WORD (high, y);
@@ -245,7 +248,7 @@ __expm1 (double x)
}
else
{
- u_int32_t high;
+ uint32_t high;
SET_HIGH_WORD (t, ((0x3ff - k) << 20)); /* 2^-k */
y = x - (e + t);
y += one;
@@ -255,8 +258,4 @@ __expm1 (double x)
}
return y;
}
-weak_alias (__expm1, expm1)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__expm1, __expm1l)
-weak_alias (__expm1, expm1l)
-#endif
+libm_alias_double (__expm1, expm1)
diff --git a/sysdeps/ieee754/bits/inf.h b/sysdeps/ieee754/dbl-64/s_f32xaddf64.c
index 179bf48a87..6e20a9e939 100644
--- a/sysdeps/ieee754/bits/inf.h
+++ b/sysdeps/ieee754/dbl-64/s_f32xaddf64.c
@@ -1,5 +1,5 @@
-/* `INFINITY' constant for IEEE 754 machines.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+/* Add _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,14 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _MATH_H
-# error "Never use <bits/inf.h> directly; include <math.h> instead."
-#endif
+#define daddl __hide_daddl
+#include <math.h>
+#undef daddl
-/* IEEE positive infinity. */
+#include <math-narrow.h>
-#if __GNUC_PREREQ(3,3)
-# define INFINITY (__builtin_inff())
-#else
-# define INFINITY HUGE_VALF
-#endif
+_Float32x
+__f32xaddf64 (_Float64 x, _Float64 y)
+{
+ NARROW_ADD_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (add)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xdivf64.c b/sysdeps/ieee754/dbl-64/s_f32xdivf64.c
new file mode 100644
index 0000000000..24dc25dc0c
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xdivf64.c
@@ -0,0 +1,30 @@
+/* Divide _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define ddivl __hide_ddivl
+#include <math.h>
+#undef ddivl
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xdivf64 (_Float64 x, _Float64 y)
+{
+ NARROW_DIV_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (div)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xmulf64.c b/sysdeps/ieee754/dbl-64/s_f32xmulf64.c
new file mode 100644
index 0000000000..f899c84567
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xmulf64.c
@@ -0,0 +1,30 @@
+/* Multiply _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dmull __hide_dmull
+#include <math.h>
+#undef dmull
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xmulf64 (_Float64 x, _Float64 y)
+{
+ NARROW_MUL_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (mul)
diff --git a/sysdeps/ieee754/dbl-64/s_f32xsubf64.c b/sysdeps/ieee754/dbl-64/s_f32xsubf64.c
new file mode 100644
index 0000000000..568f43a880
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_f32xsubf64.c
@@ -0,0 +1,30 @@
+/* Subtract _Float64 values, converting the result to _Float32x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dsubl __hide_dsubl
+#include <math.h>
+#undef dsubl
+
+#include <math-narrow.h>
+
+_Float32x
+__f32xsubf64 (_Float64 x, _Float64 y)
+{
+ NARROW_SUB_TRIVIAL (x, y, _Float32x);
+}
+libm_alias_float32x_float64 (sub)
diff --git a/sysdeps/ieee754/dbl-64/s_fabs.c b/sysdeps/ieee754/dbl-64/s_fabs.c
index 73c09a269e..8232183324 100644
--- a/sysdeps/ieee754/dbl-64/s_fabs.c
+++ b/sysdeps/ieee754/dbl-64/s_fabs.c
@@ -19,14 +19,11 @@ static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
*/
#include <math.h>
+#include <libm-alias-double.h>
double
__fabs (double x)
{
return __builtin_fabs (x);
}
-weak_alias (__fabs, fabs)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fabs, __fabsl)
-weak_alias (__fabs, fabsl)
-#endif
+libm_alias_double (__fabs, fabs)
diff --git a/sysdeps/ieee754/dbl-64/s_fadd.c b/sysdeps/ieee754/dbl-64/s_fadd.c
new file mode 100644
index 0000000000..5ecb435497
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fadd.c
@@ -0,0 +1,34 @@
+/* Add double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32addf64 __hide_f32addf64
+#define f32addf32x __hide_f32addf32x
+#define faddl __hide_faddl
+#include <math.h>
+#undef f32addf64
+#undef f32addf32x
+#undef faddl
+
+#include <math-narrow.h>
+
+float
+__fadd (double x, double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (add)
diff --git a/sysdeps/ieee754/dbl-64/s_fdiv.c b/sysdeps/ieee754/dbl-64/s_fdiv.c
new file mode 100644
index 0000000000..cdd2649df0
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fdiv.c
@@ -0,0 +1,34 @@
+/* Divide double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32divf64 __hide_f32divf64
+#define f32divf32x __hide_f32divf32x
+#define fdivl __hide_fdivl
+#include <math.h>
+#undef f32divf64
+#undef f32divf32x
+#undef fdivl
+
+#include <math-narrow.h>
+
+float
+__fdiv (double x, double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (div)
diff --git a/sysdeps/ieee754/dbl-64/s_finite.c b/sysdeps/ieee754/dbl-64/s_finite.c
index 69141db75d..da1519b1d0 100644
--- a/sysdeps/ieee754/dbl-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/s_finite.c
@@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_finite.c,v 1.8 1995/05/10 20:47:17 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#undef __finite
@@ -33,12 +34,12 @@ int FINITE(double x)
{
int32_t hx;
GET_HIGH_WORD (hx, x);
- return (int) ((u_int32_t) ((hx & 0x7ff00000) - 0x7ff00000) >> 31);
+ return (int) ((uint32_t) ((hx & 0x7ff00000) - 0x7ff00000) >> 31);
}
hidden_def (__finite)
weak_alias (__finite, finite)
#ifdef NO_LONG_DOUBLE
-# ifdef LDBL_CLASSIFY_COMPAT
+# if LDBL_CLASSIFY_COMPAT
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
# endif
diff --git a/sysdeps/ieee754/dbl-64/s_floor.c b/sysdeps/ieee754/dbl-64/s_floor.c
index bd6afa72e8..f27c6f3ad2 100644
--- a/sysdeps/ieee754/dbl-64/s_floor.c
+++ b/sysdeps/ieee754/dbl-64/s_floor.c
@@ -15,27 +15,24 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__floor (double x)
{
int32_t i0, i1, j0;
- u_int32_t i, j;
+ uint32_t i, j;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (j0 < 20)
{
- if (j0 < 0) /* raise inexact if x != 0 */
+ if (j0 < 0)
{
- math_force_eval (huge + x); /* return 0*sign(x) if |x|<1 */
+ /* return 0*sign(x) if |x|<1 */
if (i0 >= 0)
{
i0 = i1 = 0;
@@ -50,7 +47,6 @@ __floor (double x)
i = (0x000fffff) >> j0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
i0 += (0x00100000) >> j0;
i0 &= (~i); i1 = 0;
@@ -65,10 +61,9 @@ __floor (double x)
}
else
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
- math_force_eval (huge + x); /* raise inexact flag */
if (i0 < 0)
{
if (j0 == 20)
@@ -87,9 +82,5 @@ __floor (double x)
return x;
}
#ifndef __floor
-weak_alias (__floor, floor)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-# endif
+libm_alias_double (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fma.c b/sysdeps/ieee754/dbl-64/s_fma.c
index a3492434e4..57c7b5dfc2 100644
--- a/sysdeps/ieee754/dbl-64/s_fma.c
+++ b/sysdeps/ieee754/dbl-64/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
@@ -292,10 +294,5 @@ __fma (double x, double y, double z)
}
}
#ifndef __fma
-weak_alias (__fma, fma)
-#endif
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__fma, __fmal)
-weak_alias (__fmal, fmal)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fmaf.c b/sysdeps/ieee754/dbl-64/s_fmaf.c
index 582c205572..5c8b22ac16 100644
--- a/sysdeps/ieee754/dbl-64/s_fmaf.c
+++ b/sysdeps/ieee754/dbl-64/s_fmaf.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -20,7 +20,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
/* This implementation relies on double being more than twice as
precise as float and uses rounding to odd in order to avoid problems
@@ -60,5 +62,5 @@ __fmaf (float x, float y, float z)
return (float) u.d;
}
#ifndef __fmaf
-weak_alias (__fmaf, fmaf)
+libm_alias_float (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_fmul.c b/sysdeps/ieee754/dbl-64/s_fmul.c
new file mode 100644
index 0000000000..ad9ab7e94d
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fmul.c
@@ -0,0 +1,34 @@
+/* Multiply double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32mulf64 __hide_f32mulf64
+#define f32mulf32x __hide_f32mulf32x
+#define fmull __hide_fmull
+#include <math.h>
+#undef f32mulf64
+#undef f32mulf32x
+#undef fmull
+
+#include <math-narrow.h>
+
+float
+__fmul (double x, double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (mul)
diff --git a/sysdeps/ieee754/dbl-64/s_fpclassify.c b/sysdeps/ieee754/dbl-64/s_fpclassify.c
index 176e29fccb..1c2d1938f9 100644
--- a/sysdeps/ieee754/dbl-64/s_fpclassify.c
+++ b/sysdeps/ieee754/dbl-64/s_fpclassify.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +25,7 @@
int
__fpclassify (double x)
{
- u_int32_t hx, lx;
+ uint32_t hx, lx;
int retval = FP_NORMAL;
EXTRACT_WORDS (hx, lx, x);
diff --git a/sysdeps/ieee754/dbl-64/s_frexp.c b/sysdeps/ieee754/dbl-64/s_frexp.c
index 1b8d8500ba..c96a869665 100644
--- a/sysdeps/ieee754/dbl-64/s_frexp.c
+++ b/sysdeps/ieee754/dbl-64/s_frexp.c
@@ -26,6 +26,7 @@ static char rcsid[] = "$NetBSD: s_frexp.c,v 1.9 1995/05/10 20:47:24 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
@@ -38,7 +39,7 @@ __frexp (double x, int *eptr)
ix = 0x7fffffff & hx;
*eptr = 0;
if (ix >= 0x7ff00000 || ((ix | lx) == 0))
- return x; /* 0,inf,nan */
+ return x + x; /* 0,inf,nan */
if (ix < 0x00100000) /* subnormal */
{
x *= two54;
@@ -51,8 +52,4 @@ __frexp (double x, int *eptr)
SET_HIGH_WORD (x, hx);
return x;
}
-weak_alias (__frexp, frexp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__frexp, __frexpl)
-weak_alias (__frexp, frexpl)
-#endif
+libm_alias_double (__frexp, frexp)
diff --git a/sysdeps/ieee754/dbl-64/s_fromfp.c b/sysdeps/ieee754/dbl-64/s_fromfp.c
new file mode 100644
index 0000000000..30572b2a9b
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfp.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfp
+#include <s_fromfp_main.c>
+libm_alias_double (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/dbl-64/s_fromfp_main.c b/sysdeps/ieee754/dbl-64/s_fromfp_main.c
new file mode 100644
index 0000000000..dfb70b434e
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfp_main.c
@@ -0,0 +1,83 @@
+/* Round to integer type. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (double x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, x);
+ bool negative = (ix & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ ix &= 0x7fffffffffffffffULL;
+ if (ix == 0)
+ return 0;
+ int exponent = ix >> (MANT_DIG - 1);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ ix &= ((1ULL << (MANT_DIG - 1)) - 1);
+ ix |= 1ULL << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ uret <<= exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/dbl-64/s_fromfpx.c b/sysdeps/ieee754/dbl-64/s_fromfpx.c
new file mode 100644
index 0000000000..b7a0d59a05
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fromfpx.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpx
+#include <s_fromfp_main.c>
+libm_alias_double (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/dbl-64/s_fsub.c b/sysdeps/ieee754/dbl-64/s_fsub.c
new file mode 100644
index 0000000000..c3b911e801
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_fsub.c
@@ -0,0 +1,34 @@
+/* Subtract double values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32subf64 __hide_f32subf64
+#define f32subf32x __hide_f32subf32x
+#define fsubl __hide_fsubl
+#include <math.h>
+#undef f32subf64
+#undef f32subf32x
+#undef fsubl
+
+#include <math-narrow.h>
+
+float
+__fsub (double x, double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee754_double, , mantissa1);
+}
+libm_alias_float_double (sub)
diff --git a/sysdeps/ieee754/dbl-64/s_getpayload.c b/sysdeps/ieee754/dbl-64/s_getpayload.c
new file mode 100644
index 0000000000..7b995e94ee
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_getpayload.c
@@ -0,0 +1,36 @@
+/* Get NaN payload. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__getpayload (const double *x)
+{
+ uint32_t hx, lx;
+ EXTRACT_WORDS (hx, lx, *x);
+ hx &= 0x7ffff;
+ uint64_t ix = ((uint64_t) hx << 32) | lx;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0f;
+ return (double) ix;
+}
+libm_alias_double (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/dbl-64/s_isinf.c b/sysdeps/ieee754/dbl-64/s_isinf.c
index c0ad54538a..93eb65c147 100644
--- a/sysdeps/ieee754/dbl-64/s_isinf.c
+++ b/sysdeps/ieee754/dbl-64/s_isinf.c
@@ -15,6 +15,7 @@ static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
int
@@ -29,7 +30,7 @@ __isinf (double x)
hidden_def (__isinf)
weak_alias (__isinf, isinf)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
# endif
weak_alias (__isinf, isinfl)
diff --git a/sysdeps/ieee754/dbl-64/s_isnan.c b/sysdeps/ieee754/dbl-64/s_isnan.c
index 2174d988d8..82723eeb8a 100644
--- a/sysdeps/ieee754/dbl-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/s_isnan.c
@@ -21,6 +21,7 @@ static char rcsid[] = "$NetBSD: s_isnan.c,v 1.8 1995/05/10 20:47:36 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#undef __isnan
@@ -30,14 +31,14 @@ __isnan (double x)
int32_t hx, lx;
EXTRACT_WORDS (hx, lx, x);
hx &= 0x7fffffff;
- hx |= (u_int32_t) (lx | (-lx)) >> 31;
+ hx |= (uint32_t) (lx | (-lx)) >> 31;
hx = 0x7ff00000 - hx;
- return (int) (((u_int32_t) hx) >> 31);
+ return (int) (((uint32_t) hx) >> 31);
}
hidden_def (__isnan)
weak_alias (__isnan, isnan)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
# endif
weak_alias (__isnan, isnanl)
diff --git a/sysdeps/ieee754/dbl-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/s_issignaling.c
index 4b93d6ae60..05aa3f2fdd 100644
--- a/sysdeps/ieee754/dbl-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/s_issignaling.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,19 +18,20 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignaling (double x)
{
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
- u_int32_t hxi;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint32_t hxi;
GET_HIGH_WORD (hxi, x);
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
return (hxi & 0x7ff80000) == 0x7ff80000;
#else
- u_int32_t hxi, lxi;
+ uint32_t hxi, lxi;
EXTRACT_WORDS (hxi, lxi, x);
/* To keep the following comparison simple, toggle the quiet/signaling bit,
so that it is set for sNaNs. This is inverse to IEEE 754-2008 (as well as
diff --git a/sysdeps/ieee754/dbl-64/s_llrint.c b/sysdeps/ieee754/dbl-64/s_llrint.c
index ff40ee626d..8159706f90 100644
--- a/sysdeps/ieee754/dbl-64/s_llrint.c
+++ b/sysdeps/ieee754/dbl-64/s_llrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
static const double two52[2] =
@@ -36,7 +38,7 @@ long long int
__llrint (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long long int result;
double w;
double t;
@@ -96,8 +98,4 @@ __llrint (double x)
return sx ? -result : result;
}
-weak_alias (__llrint, llrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
+libm_alias_double (__llrint, llrint)
diff --git a/sysdeps/ieee754/dbl-64/s_llround.c b/sysdeps/ieee754/dbl-64/s_llround.c
index 1d6a5205f1..1067d19859 100644
--- a/sysdeps/ieee754/dbl-64/s_llround.c
+++ b/sysdeps/ieee754/dbl-64/s_llround.c
@@ -1,5 +1,5 @@
/* Round double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long long int
__llround (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long long int result;
int sign;
@@ -56,7 +57,7 @@ __llround (double x)
result = (((long long int) i0 << 32) | i1) << (j0 - 52);
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 20));
if (j < i1)
++i0;
@@ -84,8 +85,4 @@ __llround (double x)
return sign * result;
}
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
+libm_alias_double (__llround, llround)
diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c
index 340f6377f7..e6476a8260 100644
--- a/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -80,7 +80,10 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
static const double
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
@@ -191,5 +194,14 @@ __log1p (double x)
if (k == 0)
return f - (hfsq - s * (hfsq + R));
else
- return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ {
+ /* With GCC 7 when compiling with -Os the compiler warns that c
+ might be used uninitialized. This can't be true because k
+ must be 0 for c to be uninitialized and we handled that
+ computation earlier without using c. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+ return k * ln2_hi - ((hfsq - (s * (hfsq + R) + (k * ln2_lo + c))) - f);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
diff --git a/sysdeps/ieee754/dbl-64/s_logb.c b/sysdeps/ieee754/dbl-64/s_logb.c
index 3a26b18f78..a6de1f6e49 100644
--- a/sysdeps/ieee754/dbl-64/s_logb.c
+++ b/sysdeps/ieee754/dbl-64/s_logb.c
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-int-fp-convert-zero.h>
double
@@ -46,7 +47,6 @@ __logb (double x)
return 0.0;
return (double) (rix - 1023);
}
-weak_alias (__logb, logb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl) weak_alias (__logb, logbl)
+#ifndef __logb
+libm_alias_double (__logb, logb)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_lrint.c b/sysdeps/ieee754/dbl-64/s_lrint.c
index 4e7cbef97b..0e64ae1260 100644
--- a/sysdeps/ieee754/dbl-64/s_lrint.c
+++ b/sysdeps/ieee754/dbl-64/s_lrint.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
static const double two52[2] =
@@ -36,7 +38,7 @@ long int
__lrint (double x)
{
int32_t j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
double w;
double t;
long int result;
@@ -120,8 +122,4 @@ __lrint (double x)
return sx ? -result : result;
}
-weak_alias (__lrint, lrint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lrint, __lrintl)
-weak_alias (__lrint, lrintl)
-#endif
+libm_alias_double (__lrint, lrint)
diff --git a/sysdeps/ieee754/dbl-64/s_lround.c b/sysdeps/ieee754/dbl-64/s_lround.c
index aa1275ddc3..70f624eea1 100644
--- a/sysdeps/ieee754/dbl-64/s_lround.c
+++ b/sysdeps/ieee754/dbl-64/s_lround.c
@@ -1,5 +1,5 @@
/* Round double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long int
__lround (double x)
{
int32_t j0;
- u_int32_t i1, i0;
+ uint32_t i1, i0;
long int result;
int sign;
@@ -56,7 +57,7 @@ __lround (double x)
result = ((long int) i0 << (j0 - 20)) | ((long int) i1 << (j0 - 52));
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 20));
if (j < i1)
++i0;
@@ -106,8 +107,4 @@ __lround (double x)
return sign * result;
}
-weak_alias (__lround, lround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-weak_alias (__lround, lroundl)
-#endif
+libm_alias_double (__lround, lround)
diff --git a/sysdeps/ieee754/dbl-64/s_modf.c b/sysdeps/ieee754/dbl-64/s_modf.c
index 0a1e13008f..722511c64a 100644
--- a/sysdeps/ieee754/dbl-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/s_modf.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double one = 1.0;
@@ -28,7 +29,7 @@ double
__modf (double x, double *iptr)
{
int32_t i0, i1, j0;
- u_int32_t i;
+ uint32_t i;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; /* exponent of x */
if (j0 < 20) /* integer part in high x */
@@ -65,7 +66,7 @@ __modf (double x, double *iptr)
}
else /* fraction part in low x */
{
- i = ((u_int32_t) (0xffffffff)) >> (j0 - 20);
+ i = ((uint32_t) (0xffffffff)) >> (j0 - 20);
if ((i1 & i) == 0) /* x is integral */
{
*iptr = x;
@@ -79,8 +80,6 @@ __modf (double x, double *iptr)
}
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c
index dec0c5d6ee..903121d456 100644
--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -26,7 +26,9 @@ static char rcsid[] = "$NetBSD: s_rint.c,v 1.8 1995/05/10 20:48:04 jtc Exp $";
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2] = {
@@ -48,7 +50,7 @@ __nearbyint (double x)
if (j0 < 0)
{
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
@@ -65,14 +67,10 @@ __nearbyint (double x)
return x; /* x is integral */
}
libc_feholdexcept (&env);
- w = TWO52[sx] + x;
+ w = TWO52[sx] + math_opt_barrier (x);
t = w - TWO52[sx];
math_force_eval (t);
libc_fesetenv (&env);
return t;
}
-weak_alias (__nearbyint, nearbyint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nearbyint, __nearbyintl)
-weak_alias (__nearbyint, nearbyintl)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/dbl-64/s_nextup.c b/sysdeps/ieee754/dbl-64/s_nextup.c
new file mode 100644
index 0000000000..d37a2b6657
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_nextup.c
@@ -0,0 +1,56 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+
+/* Return the least floating-point number greater than X. */
+double
+__nextup (double x)
+{
+ int32_t hx, ix;
+ uint32_t lx;
+
+ EXTRACT_WORDS (hx, lx, x);
+ ix = hx & 0x7fffffff;
+
+ if (((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0)) /* x is nan. */
+ return x + x;
+ if ((ix | lx) == 0)
+ return DBL_TRUE_MIN;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx += 1;
+ if (lx == 0)
+ hx += 1;
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ hx -= 1;
+ lx -= 1;
+ }
+ INSERT_WORDS (x, hx, lx);
+ return x;
+}
+
+libm_alias_double (__nextup, nextup)
diff --git a/sysdeps/ieee754/dbl-64/s_remquo.c b/sysdeps/ieee754/dbl-64/s_remquo.c
index 16215e1e29..9a3fbe0ec8 100644
--- a/sysdeps/ieee754/dbl-64/s_remquo.c
+++ b/sysdeps/ieee754/dbl-64/s_remquo.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double zero = 0.0;
@@ -29,7 +30,7 @@ double
__remquo (double x, double y, int *quo)
{
int32_t hx, hy;
- u_int32_t sx, lx, ly;
+ uint32_t sx, lx, ly;
int cquo, qs;
EXTRACT_WORDS (hx, lx, x);
@@ -108,8 +109,4 @@ __remquo (double x, double y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquo, remquo)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__remquo, __remquol)
-weak_alias (__remquo, remquol)
-#endif
+libm_alias_double (__remquo, remquo)
diff --git a/sysdeps/ieee754/dbl-64/s_rint.c b/sysdeps/ieee754/dbl-64/s_rint.c
index a9c0d27842..cb0f5ca298 100644
--- a/sysdeps/ieee754/dbl-64/s_rint.c
+++ b/sysdeps/ieee754/dbl-64/s_rint.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2] = {
@@ -59,9 +60,5 @@ __rint (double x)
return w - TWO52[sx];
}
#ifndef __rint
-weak_alias (__rint, rint)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-# endif
+libm_alias_double (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_round.c b/sysdeps/ieee754/dbl-64/s_round.c
index aeed6faf0e..fa9e83196e 100644
--- a/sysdeps/ieee754/dbl-64/s_round.c
+++ b/sysdeps/ieee754/dbl-64/s_round.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,16 +20,14 @@
#include <math.h>
#include <math_private.h>
-
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__round (double x)
{
int32_t i0, j0;
- u_int32_t i1;
+ uint32_t i1;
EXTRACT_WORDS (i0, i1, x);
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
@@ -37,8 +35,6 @@ __round (double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= 0x80000000;
if (j0 == -1)
i0 |= 0x3ff00000;
@@ -46,13 +42,11 @@ __round (double x)
}
else
{
- u_int32_t i = 0x000fffff >> j0;
+ uint32_t i = 0x000fffff >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += 0x00080000 >> j0;
i0 &= ~i;
i1 = 0;
@@ -68,15 +62,12 @@ __round (double x)
}
else
{
- u_int32_t i = 0xffffffff >> (j0 - 20);
+ uint32_t i = 0xffffffff >> (j0 - 20);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
-
- /* Raise inexact if x != 0. */
- u_int32_t j = i1 + (1 << (51 - j0));
+ uint32_t j = i1 + (1 << (51 - j0));
if (j < i1)
i0 += 1;
i1 = j;
@@ -86,8 +77,4 @@ __round (double x)
INSERT_WORDS (x, i0, i1);
return x;
}
-weak_alias (__round, round)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/ieee754/dbl-64/s_roundeven.c b/sysdeps/ieee754/dbl-64/s_roundeven.c
new file mode 100644
index 0000000000..1438e81d45
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_roundeven.c
@@ -0,0 +1,105 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+#define MAX_EXP (2 * BIAS + 1)
+
+double
+__roundeven (double x)
+{
+ uint32_t hx, lx, uhx;
+ EXTRACT_WORDS (hx, lx, x);
+ uhx = hx & 0x7fffffff;
+ int exponent = uhx >> (MANT_DIG - 1 - 32);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 32)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ lx += half_bit;
+ hx += lx < half_bit;
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 33)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffff)) != 0)
+ {
+ lx += 0x80000000;
+ hx += lx < 0x80000000;
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1 (when the unbiased exponent is 0, the bit with
+ exponent 0 is implicit, but as the bias is odd it is OK to
+ take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 33) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ hx += half_bit;
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (uhx > 0x3fe00000 || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ hx = (hx & 0x80000000) | 0x3ff00000;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ hx &= 0x80000000;
+ lx = 0;
+ }
+ INSERT_WORDS (x, hx, lx);
+ return x;
+}
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/dbl-64/s_setpayload.c b/sysdeps/ieee754/dbl-64/s_setpayload.c
new file mode 100644
index 0000000000..0f536956f4
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayload.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayload
+#include <s_setpayload_main.c>
+libm_alias_double (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/dbl-64/s_setpayload_main.c b/sysdeps/ieee754/dbl-64/s_setpayload_main.c
new file mode 100644
index 0000000000..0e87c2a587
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayload_main.c
@@ -0,0 +1,70 @@
+/* Set NaN payload. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (double *x, double payload)
+{
+ uint32_t hx, lx;
+ EXTRACT_WORDS (hx, lx, payload);
+ int exponent = hx >> (EXPLICIT_MANT_DIG - 32);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0 && lx == 0)))
+ {
+ INSERT_WORDS (*x, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 32
+ ? (lx & ((1U << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0))
+ {
+ INSERT_WORDS (*x, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ hx &= (1U << (EXPLICIT_MANT_DIG - 32)) - 1;
+ hx |= 1U << (EXPLICIT_MANT_DIG - 32);
+ if (shift >= 32)
+ {
+ lx = hx >> (shift - 32);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (32 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x7ff00000 | (SET_HIGH_BIT ? 0x80000 : 0);
+ INSERT_WORDS (*x, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/dbl-64/s_setpayloadsig.c b/sysdeps/ieee754/dbl-64/s_setpayloadsig.c
new file mode 100644
index 0000000000..96ea34b070
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_setpayloadsig.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsig
+#include <s_setpayload_main.c>
+libm_alias_double (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/dbl-64/s_signbit.c b/sysdeps/ieee754/dbl-64/s_signbit.c
index f4ef4d238f..71500b0a2d 100644
--- a/sysdeps/ieee754/dbl-64/s_signbit.c
+++ b/sysdeps/ieee754/dbl-64/s_signbit.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index ca2532fb63..b369ac9f5b 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,22 +22,11 @@
/* */
/* FUNCTIONS: usin */
/* ucos */
-/* slow */
-/* slow1 */
-/* slow2 */
-/* sloww */
-/* sloww1 */
-/* sloww2 */
-/* bsloww */
-/* bsloww1 */
-/* bsloww2 */
-/* cslow2 */
/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h usncs.h */
-/* branred.c sincos32.c dosincos.c mpa.c */
-/* sincos.tbl */
+/* branred.c sincos.tbl */
/* */
-/* An ultimate sin and routine. Given an IEEE double machine number x */
-/* it computes the correctly rounded (to nearest) value of sin(x) or cos(x) */
+/* An ultimate sin and cos routine. Given an IEEE double machine number x */
+/* it computes sin(x) or cos(x) with ~0.55 ULP. */
/* Assumption: Machine arithmetic operations are performed in */
/* round to nearest mode of IEEE 754 standard. */
/* */
@@ -52,6 +41,8 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fenv.h>
/* Helper macros to compute sin of the input values. */
@@ -65,35 +56,11 @@
a - a^3/3! + a^5/5! - a^7/7! + a^9/9! + (1 - a^2) * da / 2
The constants s1, s2, s3, etc. are pre-computed values of 1/3!, 1/5! and so
- on. The result is returned to LHS and correction in COR. */
-#define TAYLOR_SIN(xx, a, da, cor) \
+ on. The result is returned to LHS. */
+#define TAYLOR_SIN(xx, a, da) \
({ \
double t = ((POLYNOMIAL (xx) * (a) - 0.5 * (da)) * (xx) + (da)); \
double res = (a) + t; \
- (cor) = ((a) - res) + t; \
- res; \
-})
-
-/* This is again a variation of the Taylor series expansion with the term
- x^3/3! expanded into the following for better accuracy:
-
- bb * x ^ 3 + 3 * aa * x * x1 * x2 + aa * x1 ^ 3 + aa * x2 ^ 3
-
- The correction term is dx and bb + aa = -1/3!
- */
-#define TAYLOR_SLOW(x0, dx, cor) \
-({ \
- static const double th2_36 = 206158430208.0; /* 1.5*2**37 */ \
- double xx = (x0) * (x0); \
- double x1 = ((x0) + th2_36) - th2_36; \
- double y = aa * x1 * x1 * x1; \
- double r = (x0) + y; \
- double x2 = ((x0) - x1) + (dx); \
- double t = (((POLYNOMIAL2 (xx) + bb) * xx + 3.0 * aa * x1 * x2) \
- * (x0) + aa * x2 * x2 * x2 + (dx)); \
- t = (((x0) - r) + y) + t; \
- double res = r + t; \
- (cor) = (r - res) + t; \
res; \
})
@@ -123,156 +90,69 @@ static const double
cs4 = -4.16666666666664434524222570944589E-02,
cs6 = 1.38888874007937613028114285595617E-03;
-static const double t22 = 0x1.8p22;
-
-void __dubsin (double x, double dx, double w[]);
-void __docos (double x, double dx, double w[]);
-double __mpsin (double x, double dx, bool reduce_range);
-double __mpcos (double x, double dx, bool reduce_range);
-static double slow (double x);
-static double slow1 (double x);
-static double slow2 (double x);
-static double sloww (double x, double dx, double orig, int n);
-static double sloww1 (double x, double dx, double orig, int m, int n);
-static double sloww2 (double x, double dx, double orig, int n);
-static double bsloww (double x, double dx, double orig, int n);
-static double bsloww1 (double x, double dx, double orig, int n);
-static double bsloww2 (double x, double dx, double orig, int n);
int __branred (double x, double *a, double *aa);
-static double cslow2 (double x);
-/* Given a number partitioned into U and X such that U is an index into the
- sin/cos table, this macro computes the cosine of the number by combining
- the sin and cos of X (as computed by a variation of the Taylor series) with
- the values looked up from the sin/cos table to get the result in RES and a
- correction value in COR. */
-static double
-do_cos (mynumber u, double x, double *corp)
+/* Given a number partitioned into X and DX, this function computes the cosine
+ of the number by combining the sin and cos of X (as computed by a variation
+ of the Taylor series) with the values looked up from the sin/cos table to
+ get the result. */
+static inline double
+__always_inline
+do_cos (double x, double dx)
{
- double xx, s, sn, ssn, c, cs, ccs, res, cor;
+ mynumber u;
+
+ if (x < 0)
+ dx = -dx;
+
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big) + dx;
+
+ double xx, s, sn, ssn, c, cs, ccs, cor;
xx = x * x;
s = x + x * xx * (sn3 + xx * sn5);
c = xx * (cs2 + xx * (cs4 + xx * cs6));
SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
cor = (ccs - s * ssn - cs * c) - sn * s;
- res = cs + cor;
- cor = (cs - res) + cor;
- *corp = cor;
- return res;
+ return cs + cor;
}
-/* A more precise variant of DO_COS where the number is partitioned into U, X
- and DX. EPS is the adjustment to the correction COR. */
-static double
-do_cos_slow (mynumber u, double x, double dx, double eps, double *corp)
+/* Given a number partitioned into X and DX, this function computes the sine of
+ the number by combining the sin and cos of X (as computed by a variation of
+ the Taylor series) with the values looked up from the sin/cos table to get
+ the result. */
+static inline double
+__always_inline
+do_sin (double x, double dx)
{
- double xx, y, x1, x2, e1, e2, res, cor;
- double s, sn, ssn, c, cs, ccs;
- xx = x * x;
- s = x * xx * (sn3 + xx * sn5);
- c = x * dx + xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- x1 = (x + t22) - t22;
- x2 = (x - x1) + dx;
- e1 = (sn + t22) - t22;
- e2 = (sn - e1) + ssn;
- cor = (ccs - cs * c - e1 * x2 - e2 * x) - sn * s;
- y = cs - e1 * x1;
- cor = cor + ((cs - y) - e1 * x1);
- res = y + cor;
- cor = (y - res) + cor;
- if (cor > 0)
- cor = 1.0005 * cor + eps;
- else
- cor = 1.0005 * cor - eps;
- *corp = cor;
- return res;
-}
+ double xold = x;
+ /* Max ULP is 0.501 if |x| < 0.126, otherwise ULP is 0.518. */
+ if (fabs (x) < 0.126)
+ return TAYLOR_SIN (x * x, x, dx);
-/* Given a number partitioned into U and X and DX such that U is an index into
- the sin/cos table, this macro computes the sine of the number by combining
- the sin and cos of X (as computed by a variation of the Taylor series) with
- the values looked up from the sin/cos table to get the result in RES and a
- correction value in COR. */
-static double
-do_sin (mynumber u, double x, double dx, double *corp)
-{
- double xx, s, sn, ssn, c, cs, ccs, cor, res;
+ mynumber u;
+
+ if (x <= 0)
+ dx = -dx;
+ u.x = big + fabs (x);
+ x = fabs (x) - (u.x - big);
+
+ double xx, s, sn, ssn, c, cs, ccs, cor;
xx = x * x;
s = x + (dx + x * xx * (sn3 + xx * sn5));
c = x * dx + xx * (cs2 + xx * (cs4 + xx * cs6));
SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
cor = (ssn + s * ccs - sn * c) + cs * s;
- res = sn + cor;
- cor = (sn - res) + cor;
- *corp = cor;
- return res;
-}
-
-/* A more precise variant of res = do_sin where the number is partitioned into U, X
- and DX. EPS is the adjustment to the correction COR. */
-static double
-do_sin_slow (mynumber u, double x, double dx, double eps, double *corp)
-{
- double xx, y, x1, x2, c1, c2, res, cor;
- double s, sn, ssn, c, cs, ccs;
- xx = x * x;
- s = x * xx * (sn3 + xx * sn5);
- c = xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- x1 = (x + t22) - t22;
- x2 = (x - x1) + dx;
- c1 = (cs + t22) - t22;
- c2 = (cs - c1) + ccs;
- cor = (ssn + s * ccs + cs * s + c2 * x + c1 * x2 - sn * x * dx) - sn * c;
- y = sn + c1 * x1;
- cor = cor + ((sn - y) + c1 * x1);
- res = y + cor;
- cor = (y - res) + cor;
- if (cor > 0)
- cor = 1.0005 * cor + eps;
- else
- cor = 1.0005 * cor - eps;
- *corp = cor;
- return res;
-}
-
-/* Reduce range of X and compute sin of a + da. K is the amount by which to
- rotate the quadrants. This allows us to use the same routine to compute cos
- by simply rotating the quadrants by 1. */
-static inline double
-__always_inline
-reduce_and_compute (double x, unsigned int k)
-{
- double retval = 0, a, da;
- unsigned int n = __branred (x, &a, &da);
- k = (n + k) % 4;
- switch (k)
- {
- case 0:
- if (a * a < 0.01588)
- retval = bsloww (a, da, x, n);
- else
- retval = bsloww1 (a, da, x, n);
- break;
- case 2:
- if (a * a < 0.01588)
- retval = bsloww (-a, -da, x, n);
- else
- retval = bsloww1 (-a, -da, x, n);
- break;
-
- case 1:
- case 3:
- retval = bsloww2 (a, da, x, n);
- break;
- }
- return retval;
+ return __copysign (sn + cor, xold);
}
+/* Reduce range of x to within PI/2 with abs (x) < 105414350. The high part
+ is written to *a, the low part to *da. Range reduction is accurate to 136
+ bits so that when x is large and *a very close to zero, all 53 bits of *a
+ are correct. */
static inline int4
__always_inline
-reduce_sincos_1 (double x, double *a, double *da)
+reduce_sincos (double x, double *a, double *da)
{
mynumber v;
@@ -281,198 +161,54 @@ reduce_sincos_1 (double x, double *a, double *da)
v.x = t;
double y = (x - xn * mp1) - xn * mp2;
int4 n = v.i[LOW_HALF] & 3;
- double db = xn * mp3;
- double b = y - db;
- db = (y - b) - db;
-
- *a = b;
- *da = db;
-
- return n;
-}
-
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
-static double
-__always_inline
-do_sincos_1 (double a, double da, double x, int4 n, int4 k)
-{
- double xx, retval, res, cor, y;
- mynumber u;
- int m;
- double eps = fabs (x) * 1.2e-30;
-
- int k1 = (n + k) & 3;
- switch (k1)
- { /* quarter of unit circle */
- case 2:
- a = -a;
- da = -da;
- case 0:
- xx = a * a;
- if (xx < 0.01588)
- {
- /* Taylor series. */
- res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
- retval = (res == res + cor) ? res : sloww (a, da, x, k);
- }
- else
- {
- if (a > 0)
- m = 1;
- else
- {
- m = 0;
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big);
- res = do_sin (u, y, da, &cor);
- cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
- retval = ((res == res + cor) ? ((m) ? res : -res)
- : sloww1 (a, da, x, m, k));
- }
- break;
-
- case 1:
- case 3:
- if (a < 0)
- {
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big) + da;
- res = do_cos (u, y, &cor);
- cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
- retval = ((res == res + cor) ? ((k1 & 2) ? -res : res)
- : sloww2 (a, da, x, n));
- break;
- }
-
- return retval;
-}
-static inline int4
-__always_inline
-reduce_sincos_2 (double x, double *a, double *da)
-{
- mynumber v;
+ double b, db, t1, t2;
+ t1 = xn * pp3;
+ t2 = y - t1;
+ db = (y - t2) - t1;
- double t = (x * hpinv + toint);
- double xn = t - toint;
- v.x = t;
- double xn1 = (xn + 8.0e22) - 8.0e22;
- double xn2 = xn - xn1;
- double y = ((((x - xn1 * mp1) - xn1 * mp2) - xn2 * mp1) - xn2 * mp2);
- int4 n = v.i[LOW_HALF] & 3;
- double db = xn1 * pp3;
- t = y - db;
- db = (y - t) - db;
- db = (db - xn2 * pp3) - xn * pp4;
- double b = t + db;
- db = (t - b) + db;
+ t1 = xn * pp4;
+ b = t2 - t1;
+ db += (t2 - b) - t1;
*a = b;
*da = db;
-
return n;
}
-/* Compute sin (A + DA). cos can be computed by shifting the quadrant N
- clockwise. */
+/* Compute sin or cos (A + DA) for the given quadrant N. */
static double
__always_inline
-do_sincos_2 (double a, double da, double x, int4 n, int4 k)
+do_sincos (double a, double da, int4 n)
{
- double res, retval, cor, xx;
- mynumber u;
-
- double eps = 1.0e-24;
-
- k = (n + k) & 3;
-
- switch (k)
- {
- case 2:
- a = -a;
- da = -da;
- /* Fall through. */
- case 0:
- xx = a * a;
- if (xx < 0.01588)
- {
- /* Taylor series. */
- res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
- retval = (res == res + cor) ? res : bsloww (a, da, x, n);
- }
- else
- {
- double t, db, y;
- int m;
- if (a > 0)
- {
- m = 1;
- t = a;
- db = da;
- }
- else
- {
- m = 0;
- t = -a;
- db = -da;
- }
- u.x = big + t;
- y = t - (u.x - big);
- res = do_sin (u, y, db, &cor);
- cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
- retval = ((res == res + cor) ? ((m) ? res : -res)
- : bsloww1 (a, da, x, n));
- }
- break;
+ double retval;
- case 1:
- case 3:
- if (a < 0)
- {
- a = -a;
- da = -da;
- }
- u.x = big + a;
- double y = a - (u.x - big) + da;
- res = do_cos (u, y, &cor);
- cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
- retval = ((res == res + cor) ? ((n & 2) ? -res : res)
- : bsloww2 (a, da, x, n));
- break;
- }
+ if (n & 1)
+ /* Max ULP is 0.513. */
+ retval = do_cos (a, da);
+ else
+ /* Max ULP is 0.501 if xx < 0.01588, otherwise ULP is 0.518. */
+ retval = do_sin (a, da);
- return retval;
+ return (n & 2) ? -retval : retval;
}
+
/*******************************************************************/
/* An ultimate sin routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of sin(x) */
/*******************************************************************/
-#ifdef IN_SINCOS
-static double
-#else
+#ifndef IN_SINCOS
double
SECTION
-#endif
__sin (double x)
{
- double xx, res, t, cor, y, s, c, sn, ssn, cs, ccs;
+ double t, a, da;
mynumber u;
- int4 k, m;
+ int4 k, m, n;
double retval = 0;
-#ifndef IN_SINCOS
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
-#endif
u.x = x;
m = u.i[HIGH_HALF];
@@ -482,77 +218,34 @@ __sin (double x)
math_check_force_underflow (x);
retval = x;
}
- /*---------------------------- 2^-26 < |x|< 0.25 ----------------------*/
- else if (k < 0x3fd00000)
- {
- xx = x * x;
- /* Taylor series. */
- t = POLYNOMIAL (xx) * (xx * x);
- res = x + t;
- cor = (x - res) + t;
- retval = (res == res + 1.07 * cor) ? res : slow (x);
- } /* else if (k < 0x3fd00000) */
-/*---------------------------- 0.25<|x|< 0.855469---------------------- */
+/*--------------------------- 2^-26<|x|< 0.855469---------------------- */
else if (k < 0x3feb6000)
{
- u.x = (m > 0) ? big + x : big - x;
- y = (m > 0) ? x - (u.x - big) : x + (u.x - big);
- xx = y * y;
- s = y + y * xx * (sn3 + xx * sn5);
- c = xx * (cs2 + xx * (cs4 + xx * cs6));
- SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
- if (m <= 0)
- {
- sn = -sn;
- ssn = -ssn;
- }
- cor = (ssn + s * ccs - sn * c) + cs * s;
- res = sn + cor;
- cor = (sn - res) + cor;
- retval = (res == res + 1.096 * cor) ? res : slow1 (x);
+ /* Max ULP is 0.548. */
+ retval = do_sin (x, 0);
} /* else if (k < 0x3feb6000) */
/*----------------------- 0.855469 <|x|<2.426265 ----------------------*/
else if (k < 0x400368fd)
{
-
- y = (m > 0) ? hp0 - x : hp0 + x;
- if (y >= 0)
- {
- u.x = big + y;
- y = (y - (u.x - big)) + hp1;
- }
- else
- {
- u.x = big - y;
- y = (-hp1) - (y + (u.x - big));
- }
- res = do_cos (u, y, &cor);
- retval = (res == res + 1.020 * cor) ? ((m > 0) ? res : -res) : slow2 (x);
+ t = hp0 - fabs (x);
+ /* Max ULP is 0.51. */
+ retval = __copysign (do_cos (t, hp1), x);
} /* else if (k < 0x400368fd) */
-#ifndef IN_SINCOS
/*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
else if (k < 0x419921FB)
{
- double a, da;
- int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 0);
+ n = reduce_sincos (x, &a, &da);
+ retval = do_sincos (a, da, n);
} /* else if (k < 0x419921FB ) */
-/*---------------------105414350 <|x|< 281474976710656 --------------------*/
- else if (k < 0x42F00000)
- {
- double a, da;
-
- int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 0);
- } /* else if (k < 0x42F00000 ) */
-
-/* -----------------281474976710656 <|x| <2^1024----------------------------*/
+/* --------------------105414350 <|x| <2^1024------------------------------*/
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 0);
-
+ {
+ n = __branred (x, &a, &da);
+ retval = do_sincos (a, da, n);
+ }
/*--------------------- |x| > 2^1024 ----------------------------------*/
else
{
@@ -560,7 +253,6 @@ __sin (double x)
__set_errno (EDOM);
retval = x / x;
}
-#endif
return retval;
}
@@ -571,23 +263,17 @@ __sin (double x)
/* it computes the correctly rounded (to nearest) value of cos(x) */
/*******************************************************************/
-#ifdef IN_SINCOS
-static double
-#else
double
SECTION
-#endif
__cos (double x)
{
- double y, xx, res, cor, a, da;
+ double y, a, da;
mynumber u;
- int4 k, m;
+ int4 k, m, n;
double retval = 0;
-#ifndef IN_SINCOS
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
-#endif
u.x = x;
m = u.i[HIGH_HALF];
@@ -599,11 +285,8 @@ __cos (double x)
else if (k < 0x3feb6000)
{ /* 2^-27 < |x| < 0.855469 */
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_cos (u, y, &cor);
- retval = (res == res + 1.020 * cor) ? res : cslow2 (x);
+ /* Max ULP is 0.51. */
+ retval = do_cos (x, 0);
} /* else if (k < 0x3feb6000) */
else if (k < 0x400368fd)
@@ -611,55 +294,23 @@ __cos (double x)
y = hp0 - fabs (x);
a = y + hp1;
da = (y - a) + hp1;
- xx = a * a;
- if (xx < 0.01588)
- {
- res = TAYLOR_SIN (xx, a, da, cor);
- cor = (cor > 0) ? 1.02 * cor + 1.0e-31 : 1.02 * cor - 1.0e-31;
- retval = (res == res + cor) ? res : sloww (a, da, x, 1);
- }
- else
- {
- if (a > 0)
- {
- m = 1;
- }
- else
- {
- m = 0;
- a = -a;
- da = -da;
- }
- u.x = big + a;
- y = a - (u.x - big);
- res = do_sin (u, y, da, &cor);
- cor = (cor > 0) ? 1.035 * cor + 1.0e-31 : 1.035 * cor - 1.0e-31;
- retval = ((res == res + cor) ? ((m) ? res : -res)
- : sloww1 (a, da, x, m, 1));
- }
-
+ /* Max ULP is 0.501 if xx < 0.01588 or 0.518 otherwise.
+ Range reduction uses 106 bits here which is sufficient. */
+ retval = do_sin (a, da);
} /* else if (k < 0x400368fd) */
-
-#ifndef IN_SINCOS
else if (k < 0x419921FB)
{ /* 2.426265<|x|< 105414350 */
- double a, da;
- int4 n = reduce_sincos_1 (x, &a, &da);
- retval = do_sincos_1 (a, da, x, n, 1);
+ n = reduce_sincos (x, &a, &da);
+ retval = do_sincos (a, da, n + 1);
} /* else if (k < 0x419921FB ) */
- else if (k < 0x42F00000)
- {
- double a, da;
-
- int4 n = reduce_sincos_2 (x, &a, &da);
- retval = do_sincos_2 (a, da, x, n, 1);
- } /* else if (k < 0x42F00000 ) */
-
- /* 281474976710656 <|x| <2^1024 */
+ /* 105414350 <|x| <2^1024 */
else if (k < 0x7ff00000)
- retval = reduce_and_compute (x, 1);
+ {
+ n = __branred (x, &a, &da);
+ retval = do_sincos (a, da, n + 1);
+ }
else
{
@@ -667,366 +318,15 @@ __cos (double x)
__set_errno (EDOM);
retval = x / x; /* |x| > 2^1024 */
}
-#endif
return retval;
}
-/************************************************************************/
-/* Routine compute sin(x) for 2^-26 < |x|< 0.25 by Taylor with more */
-/* precision and if still doesn't accurate enough by mpsin or dubsin */
-/************************************************************************/
-
-static double
-SECTION
-slow (double x)
-{
- double res, cor, w[2];
- res = TAYLOR_SLOW (x, 0, cor);
- if (res == res + 1.0007 * cor)
- return res;
-
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000001 * w[1])
- return (x > 0) ? w[0] : -w[0];
-
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-}
-
-/*******************************************************************************/
-/* Routine compute sin(x) for 0.25<|x|< 0.855469 by __sincostab.tbl and Taylor */
-/* and if result still doesn't accurate enough by mpsin or dubsin */
-/*******************************************************************************/
-
-static double
-SECTION
-slow1 (double x)
-{
- mynumber u;
- double w[2], y, cor, res;
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_sin_slow (u, y, 0, 0, &cor);
- if (res == res + cor)
- return (x > 0) ? res : -res;
-
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
-
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-}
-
-/**************************************************************************/
-/* Routine compute sin(x) for 0.855469 <|x|<2.426265 by __sincostab.tbl */
-/* and if result still doesn't accurate enough by mpsin or dubsin */
-/**************************************************************************/
-static double
-SECTION
-slow2 (double x)
-{
- mynumber u;
- double w[2], y, y1, y2, cor, res, del;
-
- y = fabs (x);
- y = hp0 - y;
- if (y >= 0)
- {
- u.x = big + y;
- y = y - (u.x - big);
- del = hp1;
- }
- else
- {
- u.x = big - y;
- y = -(y + (u.x - big));
- del = -hp1;
- }
- res = do_cos_slow (u, y, del, 0, &cor);
- if (res == res + cor)
- return (x > 0) ? res : -res;
-
- y = fabs (x) - hp0;
- y1 = y - hp1;
- y2 = (y - y1) - hp1;
- __docos (y1, y2, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
-
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x is small enough*/
-/* to use Taylor series around zero and (x+dx) */
-/* in first or third quarter of unit circle.Routine receive also */
-/* (right argument) the original value of x for computing error of */
-/* result.And if result not accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww (double x, double dx, double orig, int k)
-{
- double y, t, res, cor, w[2], a, da, xn;
- mynumber v;
- int4 n;
- res = TAYLOR_SLOW (x, dx, cor);
-
- if (cor > 0)
- cor = 1.0005 * cor + fabs (orig) * 3.1e-30;
- else
- cor = 1.0005 * cor - fabs (orig) * 3.1e-30;
-
- if (res == res + cor)
- return res;
-
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- t = (orig * hpinv + toint);
- xn = t - toint;
- v.x = t;
- y = (orig - xn * mp1) - xn * mp2;
- n = (v.i[LOW_HALF] + k) & 3;
- da = xn * pp3;
- t = y - da;
- da = (y - t) - da;
- y = xn * pp4;
- a = t - y;
- da = ((t - a) - y) + da;
-
- if (n == 2 || n == 1)
- {
- a = -a;
- da = -da;
- }
- (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
-
- if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x in first or */
-/* third quarter of unit circle.Routine receive also (right argument) the */
-/* original value of x for computing error of result.And if result not */
-/* accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww1 (double x, double dx, double orig, int m, int k)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- u.x = big + x;
- y = x - (u.x - big);
- res = do_sin_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
-
- if (res == res + cor)
- return (m > 0) ? res : -res;
-
- __dubsin (x, dx, w);
-
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
-
- if (w[0] == w[0] + cor)
- return (m > 0) ? w[0] : -w[0];
-
- return (k == 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) (Double-Length number) where x in second or */
-/* fourth quarter of unit circle.Routine receive also the original value */
-/* and quarter(n= 1or 3)of x for computing error of result.And if result not*/
-/* accurate enough routine calls mpsin1 or dubsin */
-/***************************************************************************/
-
-static double
-SECTION
-sloww2 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- u.x = big + x;
- y = x - (u.x - big);
- res = do_cos_slow (u, y, dx, 3.1e-30 * fabs (orig), &cor);
-
- if (res == res + cor)
- return (n & 2) ? -res : res;
-
- __docos (x, dx, w);
-
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
-
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
-
- return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(x+dx) (Double-Length number) where x */
-/* is small enough to use Taylor series around zero and (x+dx) */
-/* in first or third quarter of unit circle.Routine receive also */
-/* (right argument) the original value of x for computing error of */
-/* result.And if result not accurate enough routine calls other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww (double x, double dx, double orig, int n)
-{
- double res, cor, w[2];
-
- res = TAYLOR_SLOW (x, dx, cor);
- cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
- if (res == res + cor)
- return res;
-
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + 1.1e-24;
- else
- cor = 1.000000001 * w[1] - 1.1e-24;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(x+dx) (Double-Length number) where x */
-/* in first or third quarter of unit circle.Routine receive also */
-/* (right argument) the original value of x for computing error of result.*/
-/* And if result not accurate enough routine calls other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww1 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- dx = (x > 0) ? dx : -dx;
- res = do_sin_slow (u, y, dx, 1.1e-24, &cor);
- if (res == res + cor)
- return (x > 0) ? res : -res;
-
- __dubsin (fabs (x), dx, w);
-
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
-
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
-
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
-}
-
-/***************************************************************************/
-/* Routine compute sin(x+dx) or cos(x+dx) (Double-Length number) where x */
-/* in second or fourth quarter of unit circle.Routine receive also the */
-/* original value and quarter(n= 1or 3)of x for computing error of result. */
-/* And if result not accurate enough routine calls other routines */
-/***************************************************************************/
-
-static double
-SECTION
-bsloww2 (double x, double dx, double orig, int n)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- dx = (x > 0) ? dx : -dx;
- res = do_cos_slow (u, y, dx, 1.1e-24, &cor);
- if (res == res + cor)
- return (n & 2) ? -res : res;
-
- __docos (fabs (x), dx, w);
-
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
-
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
-
- return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
-}
-
-/************************************************************************/
-/* Routine compute cos(x) for 2^-27 < |x|< 0.25 by Taylor with more */
-/* precision and if still doesn't accurate enough by mpcos or docos */
-/************************************************************************/
-
-static double
-SECTION
-cslow2 (double x)
-{
- mynumber u;
- double w[2], y, cor, res;
-
- y = fabs (x);
- u.x = big + y;
- y = y - (u.x - big);
- res = do_cos_slow (u, y, 0, 0, &cor);
- if (res == res + cor)
- return res;
-
- y = fabs (x);
- __docos (y, 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return w[0];
-
- return __mpcos (x, 0, false);
-}
-
#ifndef __cos
-weak_alias (__cos, cos)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__cos, __cosl)
-weak_alias (__cos, cosl)
-# endif
+libm_alias_double (__cos, cos)
#endif
#ifndef __sin
-weak_alias (__sin, sin)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__sin, __sinl)
-weak_alias (__sin, sinl)
-# endif
+libm_alias_double (__sin, sin)
+#endif
+
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index c389226b04..1d8d44befe 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,43 +21,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
-#define __sin __sin_local
-#define __cos __cos_local
-#define IN_SINCOS 1
+#define IN_SINCOS
#include "s_sin.c"
-/* Consolidated version of reduce_and_compute in s_sin.c that does range
- reduction only once and computes sin and cos together. */
-static inline void
-__always_inline
-reduce_and_compute_sincos (double x, double *sinx, double *cosx)
-{
- double a, da;
- unsigned int n = __branred (x, &a, &da);
-
- n = n & 3;
-
- if (n == 1 || n == 2)
- {
- a = -a;
- da = -da;
- }
-
- if (n & 1)
- {
- double *temp = cosx;
- cosx = sinx;
- sinx = temp;
- }
-
- if (a * a < 0.01588)
- *sinx = bsloww (a, da, x, n);
- else
- *sinx = bsloww1 (a, da, x, n);
- *cosx = bsloww2 (a, da, x, n);
-}
-
void
__sincos (double x, double *sinx, double *cosx)
{
@@ -67,37 +36,62 @@ __sincos (double x, double *sinx, double *cosx)
SET_RESTORE_ROUND_53BIT (FE_TONEAREST);
u.x = x;
- k = 0x7fffffff & u.i[HIGH_HALF];
+ k = u.i[HIGH_HALF] & 0x7fffffff;
if (k < 0x400368fd)
{
- *sinx = __sin_local (x);
- *cosx = __cos_local (x);
- return;
- }
- if (k < 0x419921FB)
- {
- double a, da;
- int4 n = reduce_sincos_1 (x, &a, &da);
-
- *sinx = do_sincos_1 (a, da, x, n, 0);
- *cosx = do_sincos_1 (a, da, x, n, 1);
-
- return;
- }
- if (k < 0x42F00000)
- {
- double a, da;
- int4 n = reduce_sincos_2 (x, &a, &da);
-
- *sinx = do_sincos_2 (a, da, x, n, 0);
- *cosx = do_sincos_2 (a, da, x, n, 1);
-
+ double a, da, y;
+ /* |x| < 2^-27 => cos (x) = 1, sin (x) = x. */
+ if (k < 0x3e400000)
+ {
+ if (k < 0x3e500000)
+ math_check_force_underflow (x);
+ *sinx = x;
+ *cosx = 1.0;
+ return;
+ }
+ /* |x| < 0.855469. */
+ else if (k < 0x3feb6000)
+ {
+ *sinx = do_sin (x, 0);
+ *cosx = do_cos (x, 0);
+ return;
+ }
+
+ /* |x| < 2.426265. */
+ y = hp0 - fabs (x);
+ a = y + hp1;
+ da = (y - a) + hp1;
+ *sinx = __copysign (do_cos (a, da), x);
+ *cosx = do_sin (a, da);
return;
}
+ /* |x| < 2^1024. */
if (k < 0x7ff00000)
{
- reduce_and_compute_sincos (x, sinx, cosx);
+ double a, da, xx;
+ unsigned int n;
+
+ /* If |x| < 105414350 use simple range reduction. */
+ n = k < 0x419921FB ? reduce_sincos (x, &a, &da) : __branred (x, &a, &da);
+ n = n & 3;
+
+ if (n == 1 || n == 2)
+ {
+ a = -a;
+ da = -da;
+ }
+
+ if (n & 1)
+ {
+ double *temp = cosx;
+ cosx = sinx;
+ sinx = temp;
+ }
+
+ *sinx = do_sin (a, da);
+ xx = do_cos (a, da);
+ *cosx = (n & 2) ? -xx : xx;
return;
}
@@ -106,8 +100,4 @@ __sincos (double x, double *sinx, double *cosx)
*sinx = *cosx = x / x;
}
-weak_alias (__sincos, sincos)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__sincos, __sincosl)
-weak_alias (__sincos, sincosl)
-#endif
+libm_alias_double (__sincos, sincos)
diff --git a/sysdeps/ieee754/dbl-64/s_tan.c b/sysdeps/ieee754/dbl-64/s_tan.c
index ccffdd62d7..04ff8b6717 100644
--- a/sysdeps/ieee754/dbl-64/s_tan.c
+++ b/sysdeps/ieee754/dbl-64/s_tan.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -41,6 +41,8 @@
#include "MathLib.h"
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
#include <fenv.h>
#include <stap-probe.h>
@@ -53,7 +55,7 @@ void __mptan (double, mp_no *, int);
double
SECTION
-tan (double x)
+__tan (double x)
{
#include "utan.h"
#include "utan.tbl"
@@ -843,6 +845,6 @@ tanMp (double x)
return y;
}
-#ifdef NO_LONG_DOUBLE
-weak_alias (tan, tanl)
+#ifndef __tan
+libm_alias_double (__tan, tan)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_tanh.c b/sysdeps/ieee754/dbl-64/s_tanh.c
index 344a2f0330..673a97102d 100644
--- a/sysdeps/ieee754/dbl-64/s_tanh.c
+++ b/sysdeps/ieee754/dbl-64/s_tanh.c
@@ -41,6 +41,8 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-double.h>
static const double one = 1.0, two = 2.0, tiny = 1.0e-300;
@@ -91,8 +93,4 @@ __tanh (double x)
}
return (jx >= 0) ? z : -z;
}
-weak_alias (__tanh, tanh)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__tanh, __tanhl)
-weak_alias (__tanh, tanhl)
-#endif
+libm_alias_double (__tanh, tanh)
diff --git a/sysdeps/ieee754/dbl-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/s_totalorder.c
new file mode 100644
index 0000000000..59092dceda
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalorder.c
@@ -0,0 +1,53 @@
+/* Total order operation. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorder (double x, double y)
+{
+ int32_t hx, hy;
+ uint32_t lx, ly;
+ EXTRACT_WORDS (hx, lx, x);
+ EXTRACT_WORDS (hy, ly, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint32_t uhx = hx & 0x7fffffff, uhy = hy & 0x7fffffff;
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((uhx > 0x7ff00000 || (uhx == 0x7ff00000 && lx != 0))
+ && (uhy > 0x7ff00000 || (uhy == 0x7ff00000 && ly != 0)))
+ {
+ hx ^= 0x00080000;
+ hy ^= 0x00080000;
+ }
+#endif
+ uint32_t hx_sign = hx >> 31;
+ uint32_t hy_sign = hy >> 31;
+ hx ^= hx_sign >> 1;
+ lx ^= hx_sign;
+ hy ^= hy_sign >> 1;
+ ly ^= hy_sign;
+ return hx < hy || (hx == hy && lx <= ly);
+}
+libm_alias_double (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/dbl-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/s_totalordermag.c
new file mode 100644
index 0000000000..3b45113962
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_totalordermag.c
@@ -0,0 +1,48 @@
+/* Total order operation on absolute values. dbl-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermag (double x, double y)
+{
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ EXTRACT_WORDS (hx, lx, x);
+ EXTRACT_WORDS (hy, ly, y);
+ hx &= 0x7fffffff;
+ hy &= 0x7fffffff;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((hx > 0x7ff00000 || (hx == 0x7ff00000 && lx != 0))
+ && (hy > 0x7ff00000 || (hy == 0x7ff00000 && ly != 0)))
+ {
+ hx ^= 0x00080000;
+ hy ^= 0x00080000;
+ }
+#endif
+ return hx < hy || (hx == hy && lx <= ly);
+}
+libm_alias_double (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c
index f64e097f16..6ffabb410a 100644
--- a/sysdeps/ieee754/dbl-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/s_trunc.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,13 +20,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
__trunc (double x)
{
int32_t i0, j0;
- u_int32_t i1;
+ uint32_t i1;
int sx;
EXTRACT_WORDS (i0, i1, x);
@@ -53,8 +54,6 @@ __trunc (double x)
return x;
}
-weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
+#ifndef __trunc
+libm_alias_double (__trunc, trunc)
#endif
diff --git a/sysdeps/ieee754/dbl-64/s_ufromfp.c b/sysdeps/ieee754/dbl-64/s_ufromfp.c
new file mode 100644
index 0000000000..2532215981
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_ufromfp.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfp
+#include <s_fromfp_main.c>
+libm_alias_double (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/dbl-64/s_ufromfpx.c b/sysdeps/ieee754/dbl-64/s_ufromfpx.c
new file mode 100644
index 0000000000..0945dfce08
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/s_ufromfpx.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpx
+#include <s_fromfp_main.c>
+libm_alias_double (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/dbl-64/sincos32.c b/sysdeps/ieee754/dbl-64/sincos32.c
index ad43465f64..a8572910d2 100644
--- a/sysdeps/ieee754/dbl-64/sincos32.c
+++ b/sysdeps/ieee754/dbl-64/sincos32.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/sincos32.h b/sysdeps/ieee754/dbl-64/sincos32.h
index 5a5f2e223a..d4e72bd82a 100644
--- a/sysdeps/ieee754/dbl-64/sincos32.h
+++ b/sysdeps/ieee754/dbl-64/sincos32.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -25,7 +25,7 @@
/******************************************************************/
#ifndef SINCOS32_H
-#define SINCCOS32_H
+#define SINCOS32_H
#ifdef BIG_ENDI
static const number
diff --git a/sysdeps/ieee754/dbl-64/sincostab.c b/sysdeps/ieee754/dbl-64/sincostab.c
index cd88af7331..082ecad7f6 100644
--- a/sysdeps/ieee754/dbl-64/sincostab.c
+++ b/sysdeps/ieee754/dbl-64/sincostab.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/slowexp.c b/sysdeps/ieee754/dbl-64/slowexp.c
deleted file mode 100644
index b602262783..0000000000
--- a/sysdeps/ieee754/dbl-64/slowexp.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/**************************************************************************/
-/* MODULE_NAME:slowexp.c */
-/* */
-/* FUNCTION:slowexp */
-/* */
-/* FILES NEEDED:mpa.h */
-/* mpa.c mpexp.c */
-/* */
-/*Converting from double precision to Multi-precision and calculating */
-/* e^x */
-/**************************************************************************/
-#include <math_private.h>
-
-#include <stap-probe.h>
-
-#ifndef USE_LONG_DOUBLE_FOR_MP
-# include "mpa.h"
-void __mpexp (mp_no *x, mp_no *y, int p);
-#endif
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-/*Converting from double precision to Multi-precision and calculating e^x */
-double
-SECTION
-__slowexp (double x)
-{
-#ifndef USE_LONG_DOUBLE_FOR_MP
- double w, z, res, eps = 3.0e-26;
- int p;
- mp_no mpx, mpy, mpz, mpw, mpeps, mpcor;
-
- /* Use the multiple precision __MPEXP function to compute the exponential
- First at 144 bits and if it is not accurate enough, at 768 bits. */
- p = 6;
- __dbl_mp (x, &mpx, p);
- __mpexp (&mpx, &mpy, p);
- __dbl_mp (eps, &mpeps, p);
- __mul (&mpeps, &mpy, &mpcor, p);
- __add (&mpy, &mpcor, &mpw, p);
- __sub (&mpy, &mpcor, &mpz, p);
- __mp_dbl (&mpw, &w, p);
- __mp_dbl (&mpz, &z, p);
- if (w == z)
- {
- /* Track how often we get to the slow exp code plus
- its input/output values. */
- LIBC_PROBE (slowexp_p6, 2, &x, &w);
- return w;
- }
- else
- {
- p = 32;
- __dbl_mp (x, &mpx, p);
- __mpexp (&mpx, &mpy, p);
- __mp_dbl (&mpy, &res, p);
-
- /* Track how often we get to the uber-slow exp code plus
- its input/output values. */
- LIBC_PROBE (slowexp_p32, 2, &x, &res);
- return res;
- }
-#else
- return (double) __ieee754_expl((long double)x);
-#endif
-}
diff --git a/sysdeps/ieee754/dbl-64/slowpow.c b/sysdeps/ieee754/dbl-64/slowpow.c
deleted file mode 100644
index 266910c979..0000000000
--- a/sysdeps/ieee754/dbl-64/slowpow.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * IBM Accurate Mathematical Library
- * written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-/*************************************************************************/
-/* MODULE_NAME:slowpow.c */
-/* */
-/* FUNCTION:slowpow */
-/* */
-/*FILES NEEDED:mpa.h */
-/* mpa.c mpexp.c mplog.c halfulp.c */
-/* */
-/* Given two IEEE double machine numbers y,x , routine computes the */
-/* correctly rounded (to nearest) value of x^y. Result calculated by */
-/* multiplication (in halfulp.c) or if result isn't accurate enough */
-/* then routine converts x and y into multi-precision doubles and */
-/* calls to mpexp routine */
-/*************************************************************************/
-
-#include "mpa.h"
-#include <math_private.h>
-
-#include <stap-probe.h>
-
-#ifndef SECTION
-# define SECTION
-#endif
-
-void __mpexp (mp_no *x, mp_no *y, int p);
-void __mplog (mp_no *x, mp_no *y, int p);
-double ulog (double);
-double __halfulp (double x, double y);
-
-double
-SECTION
-__slowpow (double x, double y, double z)
-{
- double res, res1;
- mp_no mpx, mpy, mpz, mpw, mpp, mpr, mpr1;
- static const mp_no eps = {-3, {1.0, 4.0}};
- int p;
-
- /* __HALFULP returns -10 or X^Y. */
- res = __halfulp (x, y);
-
- /* Return if the result was computed by __HALFULP. */
- if (res >= 0)
- return res;
-
- /* Compute pow as long double. This is currently only used by powerpc, where
- one may get 106 bits of accuracy. */
-#ifdef USE_LONG_DOUBLE_FOR_MP
- long double ldw, ldz, ldpp;
- static const long double ldeps = 0x4.0p-96;
-
- ldz = __ieee754_logl ((long double) x);
- ldw = (long double) y *ldz;
- ldpp = __ieee754_expl (ldw);
- res = (double) (ldpp + ldeps);
- res1 = (double) (ldpp - ldeps);
-
- /* Return the result if it is accurate enough. */
- if (res == res1)
- return res;
-#endif
-
- /* Or else, calculate using multiple precision. P = 10 implies accuracy of
- 240 bits accuracy, since MP_NO has a radix of 2^24. */
- p = 10;
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __dbl_mp (z, &mpz, p);
-
- /* z = x ^ y
- log (z) = y * log (x)
- z = exp (y * log (x)) */
- __mplog (&mpx, &mpz, p);
- __mul (&mpy, &mpz, &mpw, p);
- __mpexp (&mpw, &mpp, p);
-
- /* Add and subtract EPS to ensure that the result remains unchanged, i.e. we
- have last bit accuracy. */
- __add (&mpp, &eps, &mpr, p);
- __mp_dbl (&mpr, &res, p);
- __sub (&mpp, &eps, &mpr1, p);
- __mp_dbl (&mpr1, &res1, p);
- if (res == res1)
- {
- /* Track how often we get to the slow pow code plus
- its input/output values. */
- LIBC_PROBE (slowpow_p10, 4, &x, &y, &z, &res);
- return res;
- }
-
- /* If we don't, then we repeat using a higher precision. 768 bits of
- precision ought to be enough for anybody. */
- p = 32;
- __dbl_mp (x, &mpx, p);
- __dbl_mp (y, &mpy, p);
- __dbl_mp (z, &mpz, p);
- __mplog (&mpx, &mpz, p);
- __mul (&mpy, &mpz, &mpw, p);
- __mpexp (&mpw, &mpp, p);
- __mp_dbl (&mpp, &res, p);
-
- /* Track how often we get to the uber-slow pow code plus
- its input/output values. */
- LIBC_PROBE (slowpow_p32, 4, &x, &y, &z, &res);
-
- return res;
-}
diff --git a/sysdeps/ieee754/dbl-64/t_exp.c b/sysdeps/ieee754/dbl-64/t_exp.c
index 3c921f1d3d..555c4ff01b 100644
--- a/sysdeps/ieee754/dbl-64/t_exp.c
+++ b/sysdeps/ieee754/dbl-64/t_exp.c
@@ -1,5 +1,5 @@
/* Accurate tables for exp().
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
diff --git a/sysdeps/ieee754/dbl-64/uasncs.h b/sysdeps/ieee754/dbl-64/uasncs.h
index e88bd1bf3e..e980fc5c55 100644
--- a/sysdeps/ieee754/dbl-64/uasncs.h
+++ b/sysdeps/ieee754/dbl-64/uasncs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/uatan.tbl b/sysdeps/ieee754/dbl-64/uatan.tbl
index 979d65d8b2..3f0b2bff90 100644
--- a/sysdeps/ieee754/dbl-64/uatan.tbl
+++ b/sysdeps/ieee754/dbl-64/uatan.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/uexp.h b/sysdeps/ieee754/dbl-64/uexp.h
index eb7aa5f5fb..64ab2c8fca 100644
--- a/sysdeps/ieee754/dbl-64/uexp.h
+++ b/sysdeps/ieee754/dbl-64/uexp.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -29,8 +29,7 @@
#include "mydefs.h"
-const static double zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300,
-err_0 = 1.000014, err_1 = 0.000016;
+const static double zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300;
const static int4 bigint = 0x40862002,
badint = 0x40876000,smallint = 0x3C8fffff;
const static int4 hugeint = 0x7FFFFFFF, infint = 0x7ff00000;
diff --git a/sysdeps/ieee754/dbl-64/uexp.tbl b/sysdeps/ieee754/dbl-64/uexp.tbl
index 9abfc7ef71..b1eff5253e 100644
--- a/sysdeps/ieee754/dbl-64/uexp.tbl
+++ b/sysdeps/ieee754/dbl-64/uexp.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/ulog.h b/sysdeps/ieee754/dbl-64/ulog.h
index d507c693d8..087b76e2ab 100644
--- a/sysdeps/ieee754/dbl-64/ulog.h
+++ b/sysdeps/ieee754/dbl-64/ulog.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,43 +42,6 @@
/**/ b6 = {{0x3fbc71c5, 0x25db58ac} }, /* 0.111... */
/**/ b7 = {{0xbfb9a4ac, 0x11a2a61c} }, /* -0.100... */
/**/ b8 = {{0x3fb75077, 0x0df2b591} }, /* 0.091... */
- /* polynomial III */
-#if 0
-/**/ c1 = {{0x3ff00000, 0x00000000} }, /* 1 */
-#endif
-/**/ c2 = {{0xbfe00000, 0x00000000} }, /* -1/2 */
-/**/ c3 = {{0x3fd55555, 0x55555555} }, /* 1/3 */
-/**/ c4 = {{0xbfd00000, 0x00000000} }, /* -1/4 */
-/**/ c5 = {{0x3fc99999, 0x9999999a} }, /* 1/5 */
- /* polynomial IV */
-/**/ d2 = {{0xbfe00000, 0x00000000} }, /* -1/2 */
-/**/ dd2 = {{0x00000000, 0x00000000} }, /* -1/2-d2 */
-/**/ d3 = {{0x3fd55555, 0x55555555} }, /* 1/3 */
-/**/ dd3 = {{0x3c755555, 0x55555555} }, /* 1/3-d3 */
-/**/ d4 = {{0xbfd00000, 0x00000000} }, /* -1/4 */
-/**/ dd4 = {{0x00000000, 0x00000000} }, /* -1/4-d4 */
-/**/ d5 = {{0x3fc99999, 0x9999999a} }, /* 1/5 */
-/**/ dd5 = {{0xbc699999, 0x9999999a} }, /* 1/5-d5 */
-/**/ d6 = {{0xbfc55555, 0x55555555} }, /* -1/6 */
-/**/ dd6 = {{0xbc655555, 0x55555555} }, /* -1/6-d6 */
-/**/ d7 = {{0x3fc24924, 0x92492492} }, /* 1/7 */
-/**/ dd7 = {{0x3c624924, 0x92492492} }, /* 1/7-d7 */
-/**/ d8 = {{0xbfc00000, 0x00000000} }, /* -1/8 */
-/**/ dd8 = {{0x00000000, 0x00000000} }, /* -1/8-d8 */
-/**/ d9 = {{0x3fbc71c7, 0x1c71c71c} }, /* 1/9 */
-/**/ dd9 = {{0x3c5c71c7, 0x1c71c71c} }, /* 1/9-d9 */
-/**/ d10 = {{0xbfb99999, 0x9999999a} }, /* -1/10 */
-/**/ dd10 = {{0x3c599999, 0x9999999a} }, /* -1/10-d10 */
-/**/ d11 = {{0x3fb745d1, 0x745d1746} }, /* 1/11 */
-/**/ d12 = {{0xbfb55555, 0x55555555} }, /* -1/12 */
-/**/ d13 = {{0x3fb3b13b, 0x13b13b14} }, /* 1/13 */
-/**/ d14 = {{0xbfb24924, 0x92492492} }, /* -1/14 */
-/**/ d15 = {{0x3fb11111, 0x11111111} }, /* 1/15 */
-/**/ d16 = {{0xbfb00000, 0x00000000} }, /* -1/16 */
-/**/ d17 = {{0x3fae1e1e, 0x1e1e1e1e} }, /* 1/17 */
-/**/ d18 = {{0xbfac71c7, 0x1c71c71c} }, /* -1/18 */
-/**/ d19 = {{0x3faaf286, 0xbca1af28} }, /* 1/19 */
-/**/ d20 = {{0xbfa99999, 0x9999999a} }, /* -1/20 */
/* constants */
/**/ sqrt_2 = {{0x3ff6a09e, 0x667f3bcc} }, /* sqrt(2) */
/**/ h1 = {{0x3fd2e000, 0x00000000} }, /* 151/2**9 */
@@ -87,14 +50,6 @@
/**/ delv = {{0x3ef00000, 0x00000000} }, /* 1/2**16 */
/**/ ln2a = {{0x3fe62e42, 0xfefa3800} }, /* ln(2) 43 bits */
/**/ ln2b = {{0x3d2ef357, 0x93c76730} }, /* ln(2)-ln2a */
-/**/ e1 = {{0x3bbcc868, 0x00000000} }, /* 6.095e-21 */
-/**/ e2 = {{0x3c1138ce, 0x00000000} }, /* 2.334e-19 */
-/**/ e3 = {{0x3aa1565d, 0x00000000} }, /* 2.801e-26 */
-/**/ e4 = {{0x39809d88, 0x00000000} }, /* 1.024e-31 */
-/**/ e[M] ={{{0x37da223a, 0x00000000} }, /* 1.2e-39 */
-/**/ {{0x35c851c4, 0x00000000} }, /* 1.3e-49 */
-/**/ {{0x2ab85e51, 0x00000000} }, /* 6.8e-103 */
-/**/ {{0x17383827, 0x00000000} }},/* 8.1e-197 */
/**/ two54 = {{0x43500000, 0x00000000} }, /* 2**54 */
/**/ u03 = {{0x3f9eb851, 0xeb851eb8} }; /* 0.03 */
@@ -114,43 +69,6 @@
/**/ b6 = {{0x25db58ac, 0x3fbc71c5} }, /* 0.111... */
/**/ b7 = {{0x11a2a61c, 0xbfb9a4ac} }, /* -0.100... */
/**/ b8 = {{0x0df2b591, 0x3fb75077} }, /* 0.091... */
- /* polynomial III */
-#if 0
-/**/ c1 = {{0x00000000, 0x3ff00000} }, /* 1 */
-#endif
-/**/ c2 = {{0x00000000, 0xbfe00000} }, /* -1/2 */
-/**/ c3 = {{0x55555555, 0x3fd55555} }, /* 1/3 */
-/**/ c4 = {{0x00000000, 0xbfd00000} }, /* -1/4 */
-/**/ c5 = {{0x9999999a, 0x3fc99999} }, /* 1/5 */
- /* polynomial IV */
-/**/ d2 = {{0x00000000, 0xbfe00000} }, /* -1/2 */
-/**/ dd2 = {{0x00000000, 0x00000000} }, /* -1/2-d2 */
-/**/ d3 = {{0x55555555, 0x3fd55555} }, /* 1/3 */
-/**/ dd3 = {{0x55555555, 0x3c755555} }, /* 1/3-d3 */
-/**/ d4 = {{0x00000000, 0xbfd00000} }, /* -1/4 */
-/**/ dd4 = {{0x00000000, 0x00000000} }, /* -1/4-d4 */
-/**/ d5 = {{0x9999999a, 0x3fc99999} }, /* 1/5 */
-/**/ dd5 = {{0x9999999a, 0xbc699999} }, /* 1/5-d5 */
-/**/ d6 = {{0x55555555, 0xbfc55555} }, /* -1/6 */
-/**/ dd6 = {{0x55555555, 0xbc655555} }, /* -1/6-d6 */
-/**/ d7 = {{0x92492492, 0x3fc24924} }, /* 1/7 */
-/**/ dd7 = {{0x92492492, 0x3c624924} }, /* 1/7-d7 */
-/**/ d8 = {{0x00000000, 0xbfc00000} }, /* -1/8 */
-/**/ dd8 = {{0x00000000, 0x00000000} }, /* -1/8-d8 */
-/**/ d9 = {{0x1c71c71c, 0x3fbc71c7} }, /* 1/9 */
-/**/ dd9 = {{0x1c71c71c, 0x3c5c71c7} }, /* 1/9-d9 */
-/**/ d10 = {{0x9999999a, 0xbfb99999} }, /* -1/10 */
-/**/ dd10 = {{0x9999999a, 0x3c599999} }, /* -1/10-d10 */
-/**/ d11 = {{0x745d1746, 0x3fb745d1} }, /* 1/11 */
-/**/ d12 = {{0x55555555, 0xbfb55555} }, /* -1/12 */
-/**/ d13 = {{0x13b13b14, 0x3fb3b13b} }, /* 1/13 */
-/**/ d14 = {{0x92492492, 0xbfb24924} }, /* -1/14 */
-/**/ d15 = {{0x11111111, 0x3fb11111} }, /* 1/15 */
-/**/ d16 = {{0x00000000, 0xbfb00000} }, /* -1/16 */
-/**/ d17 = {{0x1e1e1e1e, 0x3fae1e1e} }, /* 1/17 */
-/**/ d18 = {{0x1c71c71c, 0xbfac71c7} }, /* -1/18 */
-/**/ d19 = {{0xbca1af28, 0x3faaf286} }, /* 1/19 */
-/**/ d20 = {{0x9999999a, 0xbfa99999} }, /* -1/20 */
/* constants */
/**/ sqrt_2 = {{0x667f3bcc, 0x3ff6a09e} }, /* sqrt(2) */
/**/ h1 = {{0x00000000, 0x3fd2e000} }, /* 151/2**9 */
@@ -159,14 +77,6 @@
/**/ delv = {{0x00000000, 0x3ef00000} }, /* 1/2**16 */
/**/ ln2a = {{0xfefa3800, 0x3fe62e42} }, /* ln(2) 43 bits */
/**/ ln2b = {{0x93c76730, 0x3d2ef357} }, /* ln(2)-ln2a */
-/**/ e1 = {{0x00000000, 0x3bbcc868} }, /* 6.095e-21 */
-/**/ e2 = {{0x00000000, 0x3c1138ce} }, /* 2.334e-19 */
-/**/ e3 = {{0x00000000, 0x3aa1565d} }, /* 2.801e-26 */
-/**/ e4 = {{0x00000000, 0x39809d88} }, /* 1.024e-31 */
-/**/ e[M] ={{{0x00000000, 0x37da223a} }, /* 1.2e-39 */
-/**/ {{0x00000000, 0x35c851c4} }, /* 1.3e-49 */
-/**/ {{0x00000000, 0x2ab85e51} }, /* 6.8e-103 */
-/**/ {{0x00000000, 0x17383827} }},/* 8.1e-197 */
/**/ two54 = {{0x00000000, 0x43500000} }, /* 2**54 */
/**/ u03 = {{0xeb851eb8, 0x3f9eb851} }; /* 0.03 */
@@ -178,10 +88,6 @@
#define DEL_V delv.d
#define LN2A ln2a.d
#define LN2B ln2b.d
-#define E1 e1.d
-#define E2 e2.d
-#define E3 e3.d
-#define E4 e4.d
#define U03 u03.d
#endif
diff --git a/sysdeps/ieee754/dbl-64/ulog.tbl b/sysdeps/ieee754/dbl-64/ulog.tbl
index dd92cbb886..93fa1b36d3 100644
--- a/sysdeps/ieee754/dbl-64/ulog.tbl
+++ b/sysdeps/ieee754/dbl-64/ulog.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/upow.h b/sysdeps/ieee754/dbl-64/upow.h
index dd9ba32b71..c1b9d8e3cc 100644
--- a/sysdeps/ieee754/dbl-64/upow.h
+++ b/sysdeps/ieee754/dbl-64/upow.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/upow.tbl b/sysdeps/ieee754/dbl-64/upow.tbl
index 55d878edad..c1ad333583 100644
--- a/sysdeps/ieee754/dbl-64/upow.tbl
+++ b/sysdeps/ieee754/dbl-64/upow.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/urem.h b/sysdeps/ieee754/dbl-64/urem.h
index 42b26273fd..c810791a1c 100644
--- a/sysdeps/ieee754/dbl-64/urem.h
+++ b/sysdeps/ieee754/dbl-64/urem.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/usncs.h b/sysdeps/ieee754/dbl-64/usncs.h
index 1408695c85..97d1418a23 100644
--- a/sysdeps/ieee754/dbl-64/usncs.h
+++ b/sysdeps/ieee754/dbl-64/usncs.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/utan.h b/sysdeps/ieee754/dbl-64/utan.h
index 0a99812754..d619d0004b 100644
--- a/sysdeps/ieee754/dbl-64/utan.h
+++ b/sysdeps/ieee754/dbl-64/utan.h
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/utan.tbl b/sysdeps/ieee754/dbl-64/utan.tbl
index 8a8c2afa53..92163ec3e8 100644
--- a/sysdeps/ieee754/dbl-64/utan.tbl
+++ b/sysdeps/ieee754/dbl-64/utan.tbl
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
index ccccdaf106..0af05a0222 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
@@ -51,13 +51,13 @@ __ieee754_acosh (double x)
/* 2**28 > x > 2 */
double t = x * x;
- return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
+ return __ieee754_log (2.0 * x - one / (x + sqrt (t - one)));
}
else if (__glibc_likely (hx > INT64_C (0x3ff0000000000000)))
{
/* 1<x<2 */
double t = x - one;
- return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
+ return __log1p (t + sqrt (2.0 * t + t * t));
}
else if (__glibc_likely (hx == INT64_C (0x3ff0000000000000)))
return 0.0; /* acosh(1) = 0 */
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
index 4f5a81669e..cd5567182f 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log10.c
@@ -65,7 +65,7 @@ __ieee754_log10 (double x)
if (hx < INT64_C(0x0010000000000000))
{ /* x < 2**-1022 */
if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
index 5ccb78cf03..f08d5b337d 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_log2.c
@@ -81,7 +81,7 @@ __ieee754_log2 (double x)
if (hx < INT64_C(0x0010000000000000))
{ /* x < 2**-1022 */
if (__glibc_unlikely ((hx & UINT64_C(0x7fffffffffffffff)) == 0))
- return -two54 / (x - x); /* log(+-0)=-inf */
+ return -two54 / fabs (x); /* log(+-0)=-inf */
if (__glibc_unlikely (hx < 0))
return (x - x) / (x - x); /* log(-#) = NaN */
k -= 54;
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
index c687525d4b..b99829d2b0 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
@@ -15,14 +15,11 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const double huge = 1.0e300;
+#include <libm-alias-double.h>
double
__ceil(double x)
@@ -32,14 +29,13 @@ __ceil(double x)
EXTRACT_WORDS64(i0,x);
j0 = ((i0>>52)&0x7ff)-0x3ff;
if(j0<=51) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0<0) {i0=INT64_C(0x8000000000000000);}
else if(i0!=0) { i0=INT64_C(0x3ff0000000000000);}
} else {
i = INT64_C(0x000fffffffffffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0>0) i0 += UINT64_C(0x0010000000000000)>>j0;
i0 &= (~i);
}
@@ -51,9 +47,5 @@ __ceil(double x)
return x;
}
#ifndef __ceil
-weak_alias (__ceil, ceil)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__ceil, __ceill)
-weak_alias (__ceil, ceill)
-# endif
+libm_alias_double (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
index ef51608f6e..40676924fe 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
@@ -16,6 +16,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#include <stdint.h>
@@ -30,7 +31,7 @@ __finite(double x)
hidden_def (__finite)
weak_alias (__finite, finite)
#ifdef NO_LONG_DOUBLE
-# ifdef LDBL_CLASSIFY_COMPAT
+# if LDBL_CLASSIFY_COMPAT
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
# endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
index b7ed14bfa2..f7e0a77ec3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2011.
@@ -33,18 +33,15 @@
#include <math.h>
#include <math_private.h>
#include <stdint.h>
+#include <libm-alias-double.h>
/*
* floor(x)
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
-static const double huge = 1.0e300;
-
double
__floor (double x)
@@ -53,15 +50,14 @@ __floor (double x)
EXTRACT_WORDS64(i0,x);
int32_t j0 = ((i0>>52)&0x7ff)-0x3ff;
if(__builtin_expect(j0<52, 1)) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=0;}
else if((i0&0x7fffffffffffffffl)!=0)
{ i0=0xbff0000000000000l;}
} else {
uint64_t i = (0x000fffffffffffffl)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0<0) i0 += (0x0010000000000000l)>>j0;
i0 &= (~i);
}
@@ -71,9 +67,5 @@ __floor (double x)
return x;
}
#ifndef __floor
-weak_alias (__floor, floor)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__floor, __floorl)
-weak_alias (__floor, floorl)
-# endif
+libm_alias_double (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
index 42068f8187..c73434f5f3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_frexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -19,6 +19,7 @@
#include <inttypes.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/*
* for non-zero, finite x
@@ -55,12 +56,11 @@ __frexp (double x, int *eptr)
ix = (ix & INT64_C (0x800fffffffffffff)) | INT64_C (0x3fe0000000000000);
INSERT_WORDS64 (x, ix);
}
+ else
+ /* Quiet signaling NaNs. */
+ x += x;
*eptr = e;
return x;
}
-weak_alias (__frexp, frexp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__frexp, __frexpl)
-weak_alias (__frexp, frexpl)
-#endif
+libm_alias_double (__frexp, frexp)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
new file mode 100644
index 0000000000..1103ef2ed9
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c
@@ -0,0 +1,32 @@
+/* Get NaN payload. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+double
+__getpayload (const double *x)
+{
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, *x);
+ ix &= 0x7ffffffffffffULL;
+ return (double) ix;
+}
+libm_alias_double (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
index 951fb73239..2b427a8b4c 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isinf.c
@@ -11,6 +11,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
int
@@ -26,7 +27,7 @@ __isinf (double x)
hidden_def (__isinf)
weak_alias (__isinf, isinf)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
# endif
weak_alias (__isinf, isinfl)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index bcff9e3b67..cd805d157b 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -17,6 +17,7 @@
#include <math.h>
#include <math_private.h>
+#include <ldbl-classify-compat.h>
#include <shlib-compat.h>
#include <stdint.h>
@@ -32,7 +33,7 @@ int __isnan(double x)
hidden_def (__isnan)
weak_alias (__isnan, isnan)
#ifdef NO_LONG_DOUBLE
-# if defined LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
+# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
# endif
weak_alias (__isnan, isnanl)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
index c22e608c6e..63ef5ca7d8 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignaling (double x)
{
- u_int64_t xi;
+ uint64_t xi;
EXTRACT_WORDS64 (xi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
index 73ddd8dd9f..e3b18eb893 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
@@ -1,5 +1,5 @@
/* Round double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -24,6 +24,7 @@
#include <sysdep.h>
#include <math_private.h>
+#include <libm-alias-double.h>
long long int
@@ -63,20 +64,12 @@ __llround (double x)
return sign * result;
}
-weak_alias (__llround, llround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
-#endif
+libm_alias_double (__llround, llround)
/* long has the same width as long long on LP64 machines, so use an alias. */
#undef lround
#undef __lround
#ifdef _LP64
strong_alias (__llround, __lround)
-weak_alias (__llround, lround)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __lroundl)
-weak_alias (__llround, lroundl)
-# endif
+libm_alias_double (__lround, lround)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
index c7846054a6..c7fa8169c5 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
@@ -1,5 +1,5 @@
/* Compute radix independent exponent.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
@@ -41,8 +42,6 @@ __logb (double x)
}
return (double) (ex - 1023);
}
-weak_alias (__logb, logb)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__logb, __logbl)
-weak_alias (__logb, logbl)
+#ifndef __logb
+libm_alias_double (__logb, logb)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
index 9e665b01ec..a88c6c8788 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_lround.c
@@ -1,5 +1,5 @@
/* Round double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/* For LP64, lround is an alias for llround. */
#ifndef _LP64
@@ -80,10 +81,6 @@ __lround (double x)
return sign * result;
}
-weak_alias (__lround, lround)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__lround, __lroundl)
-weak_alias (__lround, lroundl)
-# endif
+libm_alias_double (__lround, lround)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
index c309e56272..8d14e78ef0 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_modf.c
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
static const double one = 1.0;
@@ -59,8 +60,6 @@ __modf(double x, double *iptr)
return x;
}
}
-weak_alias (__modf, modf)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__modf, __modfl)
-weak_alias (__modf, modfl)
+#ifndef __modf
+libm_alias_double (__modf, modf)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index 8293819981..a4a081724e 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -22,7 +22,9 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2]={
@@ -42,9 +44,9 @@ __nearbyint(double x)
if(__builtin_expect(j0<52, 1)) {
if(j0<0) {
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier(t);
+ math_force_eval (t);
libc_fesetenv (&env);
return __copysign (t, x);
}
@@ -53,14 +55,10 @@ __nearbyint(double x)
else return x; /* x is integral */
}
libc_feholdexcept (&env);
- double w = TWO52[sx]+x;
+ double w = TWO52[sx] + math_opt_barrier (x);
double t = w-TWO52[sx];
- math_opt_barrier (t);
+ math_force_eval (t);
libc_fesetenv (&env);
return t;
}
-weak_alias (__nearbyint, nearbyint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nearbyint, __nearbyintl)
-weak_alias (__nearbyint, nearbyintl)
-#endif
+libm_alias_double (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
index 716e07e54d..bbfb1195ac 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
static const double zero = 0.0;
@@ -107,8 +108,4 @@ __remquo (double x, double y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquo, remquo)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__remquo, __remquol)
-weak_alias (__remquo, remquol)
-#endif
+libm_alias_double (__remquo, remquo)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
index 87b2339d43..622e479c5f 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_rint.c
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
static const double
TWO52[2]={
@@ -52,9 +53,5 @@ __rint(double x)
return w-TWO52[sx];
}
#ifndef __rint
-weak_alias (__rint, rint)
-# ifdef NO_LONG_DOUBLE
-strong_alias (__rint, __rintl)
-weak_alias (__rint, rintl)
-# endif
+libm_alias_double (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
index f1d75bbe68..3323621ce3 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,10 +20,9 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
#include <stdint.h>
-static const double huge = 1.0e300;
-
double
__round (double x)
@@ -36,8 +35,6 @@ __round (double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= UINT64_C(0x8000000000000000);
if (j0 == -1)
i0 |= UINT64_C(0x3ff0000000000000);
@@ -48,9 +45,7 @@ __round (double x)
if ((i0 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += UINT64_C(0x0008000000000000) >> j0;
i0 &= ~i;
}
@@ -67,8 +62,4 @@ __round (double x)
INSERT_WORDS64 (x, i0);
return x;
}
-weak_alias (__round, round)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__round, roundl)
-#endif
+libm_alias_double (__round, round)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c
new file mode 100644
index 0000000000..7bbbb2dc20
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c
@@ -0,0 +1,71 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+#define MAX_EXP (2 * BIAS + 1)
+
+double
+__roundeven (double x)
+{
+ uint64_t ix, ux;
+ EXTRACT_WORDS64 (ix, x);
+ ux = ix & 0x7fffffffffffffffULL;
+ int exponent = ux >> (MANT_DIG - 1);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer. Locate the bits with
+ exponents 0 and -1 (when the unbiased exponent is 0, the bit
+ with exponent 0 is implicit, but as the bias is odd it is OK
+ to take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if ((ix & (int_bit | (half_bit - 1))) != 0)
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ ix += half_bit;
+ ix &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS - 1 && ux > 0x3fe0000000000000ULL)
+ /* Interval (0.5, 1). */
+ ix = (ix & 0x8000000000000000ULL) | 0x3ff0000000000000ULL;
+ else
+ /* Rounds to 0. */
+ ix &= 0x8000000000000000ULL;
+ INSERT_WORDS64 (x, ix);
+ return x;
+}
+hidden_def (__roundeven)
+libm_alias_double (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c
new file mode 100644
index 0000000000..6af92d7fe2
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_setpayload_main.c
@@ -0,0 +1,54 @@
+/* Set NaN payload. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-double.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (double *x, double payload)
+{
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, payload);
+ int exponent = ix >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && ix == 0))
+ || (ix & ((1ULL << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ INSERT_WORDS64 (*x, 0);
+ return 1;
+ }
+ if (ix != 0)
+ {
+ ix &= (1ULL << EXPLICIT_MANT_DIG) - 1;
+ ix |= 1ULL << EXPLICIT_MANT_DIG;
+ ix >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ ix |= 0x7ff0000000000000ULL | (SET_HIGH_BIT ? 0x8000000000000ULL : 0);
+ INSERT_WORDS64 (*x, ix);
+ return 0;
+}
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
new file mode 100644
index 0000000000..c235e55c20
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c
@@ -0,0 +1,49 @@
+/* Total order operation. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+int
+__totalorder (double x, double y)
+{
+ int64_t ix, iy;
+ EXTRACT_WORDS64 (ix, x);
+ EXTRACT_WORDS64 (iy, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((ix & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL
+ && (iy & 0x7fffffffffffffffULL) > 0x7ff0000000000000ULL)
+ {
+ ix ^= 0x0008000000000000ULL;
+ iy ^= 0x0008000000000000ULL;
+ }
+#endif
+ uint64_t ix_sign = ix >> 63;
+ uint64_t iy_sign = iy >> 63;
+ ix ^= ix_sign >> 1;
+ iy ^= iy_sign >> 1;
+ return ix <= iy;
+}
+libm_alias_double (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c
new file mode 100644
index 0000000000..6da4f118a3
--- /dev/null
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c
@@ -0,0 +1,46 @@
+/* Total order operation on absolute values. dbl-64/wordsize-64 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <libm-alias-double.h>
+#include <stdint.h>
+
+int
+__totalordermag (double x, double y)
+{
+ uint64_t ix, iy;
+ EXTRACT_WORDS64 (ix, x);
+ EXTRACT_WORDS64 (iy, y);
+ ix &= 0x7fffffffffffffffULL;
+ iy &= 0x7fffffffffffffffULL;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if (ix > 0x7ff0000000000000ULL && iy > 0x7ff0000000000000ULL)
+ {
+ ix ^= 0x0008000000000000ULL;
+ iy ^= 0x0008000000000000ULL;
+ }
+#endif
+ return ix <= iy;
+}
+libm_alias_double (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
index 81ac55e2f6..19a09b894e 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-double.h>
double
@@ -48,8 +49,6 @@ __trunc (double x)
return x;
}
-weak_alias (__trunc, trunc)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__trunc, __truncl)
-weak_alias (__trunc, truncl)
+#ifndef __trunc
+libm_alias_double (__trunc, trunc)
#endif
diff --git a/sysdeps/ieee754/dbl-64/x2y2m1.c b/sysdeps/ieee754/dbl-64/x2y2m1.c
index 96078888a7..aa0d9703fa 100644
--- a/sysdeps/ieee754/dbl-64/x2y2m1.c
+++ b/sysdeps/ieee754/dbl-64/x2y2m1.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
diff --git a/sysdeps/ieee754/dbl-64/x2y2m1f.c b/sysdeps/ieee754/dbl-64/x2y2m1f.c
index 480b4c0c67..a61dc4185f 100644
--- a/sysdeps/ieee754/dbl-64/x2y2m1f.c
+++ b/sysdeps/ieee754/dbl-64/x2y2m1f.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/float128/Makeconfig b/sysdeps/ieee754/float128/Makeconfig
new file mode 100644
index 0000000000..a493ff1d41
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makeconfig
@@ -0,0 +1,4 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-fcts = yes
+float64x-alias-fcts = yes
diff --git a/sysdeps/ieee754/float128/Makefile b/sysdeps/ieee754/float128/Makefile
new file mode 100644
index 0000000000..571a841809
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makefile
@@ -0,0 +1,12 @@
+ifeq ($(subdir),stdlib)
+routines += float1282mpn strfromf128
+routines += strtof128 strtof128_l strtof128_nan mpn2float128
+
+# The strfrom class of functions call __printf_fp in order to convert the
+# floating-point value to characters. This requires the value of IO_MTSAFE_IO.
+CFLAGS-strfromf128.c += $(libio-mtsafe)
+endif
+
+ifeq ($(subdir),wcsmbs)
+routines += wcstof128_l wcstof128 wcstof128_nan
+endif
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
new file mode 100644
index 0000000000..2eebc6f1b0
--- /dev/null
+++ b/sysdeps/ieee754/float128/Versions
@@ -0,0 +1,51 @@
+%include <float128-abi.h>
+%ifndef FLOAT128_VERSION
+% error "float128-abi.h must define FLOAT128_VERSION"
+%endif
+libc {
+ FLOAT128_VERSION {
+ __strtof128_internal;
+ __wcstof128_internal;
+ }
+ GLIBC_PRIVATE {
+ # For __nanf128.
+ __strtof128_nan;
+ }
+}
+libm {
+ FLOAT128_VERSION {
+ __acosf128_finite;
+ __acoshf128_finite;
+ __asinf128_finite;
+ __atan2f128_finite;
+ __atanhf128_finite;
+ __coshf128_finite;
+ __exp10f128_finite;
+ __exp2f128_finite;
+ __expf128_finite;
+ __finitef128;
+ __fmodf128_finite;
+ __fpclassifyf128;
+ __gammaf128_r_finite;
+ __hypotf128_finite;
+ __iseqsigf128;
+ __isinff128;
+ __isnanf128;
+ __issignalingf128;
+ __j0f128_finite;
+ __j1f128_finite;
+ __jnf128_finite;
+ __lgammaf128_r_finite;
+ __log10f128_finite;
+ __log2f128_finite;
+ __logf128_finite;
+ __powf128_finite;
+ __remainderf128_finite;
+ __signbitf128;
+ __sinhf128_finite;
+ __sqrtf128_finite;
+ __y0f128_finite;
+ __y1f128_finite;
+ __ynf128_finite;
+ }
+}
diff --git a/sysdeps/ieee754/float128/e_acosf128.c b/sysdeps/ieee754/float128/e_acosf128.c
new file mode 100644
index 0000000000..7ddf7dcdf1
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acosl.c"
diff --git a/sysdeps/ieee754/float128/e_acoshf128.c b/sysdeps/ieee754/float128/e_acoshf128.c
new file mode 100644
index 0000000000..f6dd40cd88
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acoshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acoshl.c"
diff --git a/sysdeps/ieee754/float128/e_asinf128.c b/sysdeps/ieee754/float128/e_asinf128.c
new file mode 100644
index 0000000000..133ab8d875
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_asinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_asinl.c"
diff --git a/sysdeps/ieee754/float128/e_atan2f128.c b/sysdeps/ieee754/float128/e_atan2f128.c
new file mode 100644
index 0000000000..9aa740f770
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atan2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atan2l.c"
diff --git a/sysdeps/ieee754/float128/e_atanhf128.c b/sysdeps/ieee754/float128/e_atanhf128.c
new file mode 100644
index 0000000000..f26c8d54d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atanhl.c"
diff --git a/sysdeps/ieee754/float128/e_coshf128.c b/sysdeps/ieee754/float128/e_coshf128.c
new file mode 100644
index 0000000000..2abf067f64
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_coshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_coshl.c"
diff --git a/sysdeps/ieee754/float128/e_exp10f128.c b/sysdeps/ieee754/float128/e_exp10f128.c
new file mode 100644
index 0000000000..b3468d256b
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_exp10l.c"
diff --git a/sysdeps/ieee754/float128/e_expf128.c b/sysdeps/ieee754/float128/e_expf128.c
new file mode 100644
index 0000000000..b727b17cc9
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_expf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_expl.c"
diff --git a/sysdeps/ieee754/float128/e_fmodf128.c b/sysdeps/ieee754/float128/e_fmodf128.c
new file mode 100644
index 0000000000..ed8a7491ed
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_fmodf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_fmodl.c"
diff --git a/sysdeps/ieee754/float128/e_gammaf128_r.c b/sysdeps/ieee754/float128/e_gammaf128_r.c
new file mode 100644
index 0000000000..895ac6374d
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_gammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_gammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_hypotf128.c b/sysdeps/ieee754/float128/e_hypotf128.c
new file mode 100644
index 0000000000..1f06555505
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_hypotf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_hypotl.c"
diff --git a/sysdeps/ieee754/float128/e_ilogbf128.c b/sysdeps/ieee754/float128/e_ilogbf128.c
new file mode 100644
index 0000000000..2861801854
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_ilogbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_ilogbl.c"
diff --git a/sysdeps/ieee754/float128/e_j0f128.c b/sysdeps/ieee754/float128/e_j0f128.c
new file mode 100644
index 0000000000..b624b5c596
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j0f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j0l.c"
diff --git a/sysdeps/ieee754/float128/e_j1f128.c b/sysdeps/ieee754/float128/e_j1f128.c
new file mode 100644
index 0000000000..445428e742
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j1l.c"
diff --git a/sysdeps/ieee754/float128/e_jnf128.c b/sysdeps/ieee754/float128/e_jnf128.c
new file mode 100644
index 0000000000..7854e11a1a
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_jnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_jnl.c"
diff --git a/sysdeps/ieee754/float128/e_lgammaf128_r.c b/sysdeps/ieee754/float128/e_lgammaf128_r.c
new file mode 100644
index 0000000000..3517ac32af
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_lgammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_log10f128.c b/sysdeps/ieee754/float128/e_log10f128.c
new file mode 100644
index 0000000000..1c3341e412
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log10l.c"
diff --git a/sysdeps/ieee754/float128/e_log2f128.c b/sysdeps/ieee754/float128/e_log2f128.c
new file mode 100644
index 0000000000..36becaadc4
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log2l.c"
diff --git a/sysdeps/ieee754/float128/e_logf128.c b/sysdeps/ieee754/float128/e_logf128.c
new file mode 100644
index 0000000000..b0c9975caf
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_logf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_logl.c"
diff --git a/sysdeps/ieee754/float128/e_powf128.c b/sysdeps/ieee754/float128/e_powf128.c
new file mode 100644
index 0000000000..3afaf7f6a6
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_powf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_powl.c"
diff --git a/sysdeps/ieee754/float128/e_rem_pio2f128.c b/sysdeps/ieee754/float128/e_rem_pio2f128.c
new file mode 100644
index 0000000000..86c2ca1024
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_rem_pio2l.c"
diff --git a/sysdeps/ieee754/float128/e_remainderf128.c b/sysdeps/ieee754/float128/e_remainderf128.c
new file mode 100644
index 0000000000..90c18f8493
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_remainderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_remainderl.c"
diff --git a/sysdeps/ieee754/float128/e_scalbf128.c b/sysdeps/ieee754/float128/e_scalbf128.c
new file mode 100644
index 0000000000..067b724164
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_scalbf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/e_sinhf128.c b/sysdeps/ieee754/float128/e_sinhf128.c
new file mode 100644
index 0000000000..42a54e0015
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_sinhl.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c b/sysdeps/ieee754/float128/float1282mpn.c
index 969fadc205..49e8972221 100644
--- a/sysdeps/ieee754/ldbl-128ibm/w_log1pl.c
+++ b/sysdeps/ieee754/float128/float1282mpn.c
@@ -1,5 +1,5 @@
-/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Convert a _Float128 type to multiprecision.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log1pl.c>
-long_double_symbol (libm, __w_log1pl, log1pl);
+#include <float128_private.h>
+#include "../ldbl-128/ldbl2mpn.c"
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
new file mode 100644
index 0000000000..9dd15601e6
--- /dev/null
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -0,0 +1,366 @@
+/* _Float128 overrides for building ldbl-128 as _Float128.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This must be included before the function renames below. */
+#include <gmp.h>
+#include <math.h>
+#undef HUGE_VALL
+#define HUGE_VALL HUGE_VAL_F128
+#include <math/mul_splitl.h>
+
+/* This must be included before the renames of types and macros from
+ it. */
+#include <ieee754.h>
+
+/* Renames derived from math_private.h. */
+#include <math_private.h>
+#include <ieee754_float128.h>
+#define ieee854_long_double_shape_type ieee854_float128_shape_type
+#define ieee854_long_double ieee854_float128
+
+#undef GET_LDOUBLE_LSW64
+#undef GET_LDOUBLE_MSW64
+#undef GET_LDOUBLE_WORDS64
+#undef SET_LDOUBLE_LSW64
+#undef SET_LDOUBLE_MSW64
+#undef SET_LDOUBLE_WORDS64
+#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
+#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
+#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
+#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
+#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
+#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
+
+#undef IEEE854_LONG_DOUBLE_BIAS
+#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+
+#ifdef SET_RESTORE_ROUNDF128
+# undef SET_RESTORE_ROUNDL
+# define SET_RESTORE_ROUNDL(RM) SET_RESTORE_ROUNDF128 (RM)
+#endif
+
+#ifdef libc_feholdexcept_setroundf128
+# undef libc_feholdexcept_setroundl
+# define libc_feholdexcept_setroundl(ENV, RM) \
+ libc_feholdexcept_setroundf128 (ENV, RM)
+#endif
+
+#ifdef libc_feupdateenv_testf128
+# undef libc_feupdateenv_testl
+# define libc_feupdateenv_testl(ENV, EX) libc_feupdateenv_testf128 (ENV, EX)
+#endif
+
+/* misc macros from the header below. */
+#include <fix-fp-int-convert-overflow.h>
+#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
+#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
+
+
+/* float.h constants. */
+#include <float.h>
+#undef LDBL_DIG
+#undef LDBL_EPSILON
+#undef LDBL_MANT_DIG
+#undef LDBL_MAX
+#undef LDBL_MAX_10_EXP
+#undef LDBL_MAX_EXP
+#undef LDBL_MIN
+#undef LDBL_MIN_10_EXP
+#undef LDBL_MIN_EXP
+#undef LDBL_TRUE_MIN
+#define LDBL_DIG FLT128_DIG
+#define LDBL_EPSILON FLT128_EPSILON
+#define LDBL_MANT_DIG FLT128_MANT_DIG
+#define LDBL_MAX FLT128_MAX
+#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
+#define LDBL_MAX_EXP FLT128_MAX_EXP
+#define LDBL_MIN FLT128_MIN
+#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
+#define LDBL_MIN_EXP FLT128_MIN_EXP
+#define LDBL_TRUE_MIN FLT128_TRUE_MIN
+
+
+/* math.h GNU constants. */
+#undef M_El
+#undef M_LOG2El
+#undef M_LOG10El
+#undef M_LN2l
+#undef M_LN10l
+#undef M_PIl
+#undef M_PI_2l
+#undef M_PI_4l
+#undef M_1_PIl
+#undef M_2_PIl
+#undef M_2_SQRTPIl
+#undef M_SQRT2l
+#undef M_SQRT1_2l
+#define M_El M_Ef128
+#define M_LOG2El M_LOG2Ef128
+#define M_LOG10El M_LOG10Ef128
+#define M_LN2l M_LN2f128
+#define M_LN10l M_LN10f128
+#define M_PIl M_PIf128
+#define M_PI_2l M_PI_2f128
+#define M_PI_4l M_PI_4f128
+#define M_1_PIl M_1_PIf128
+#define M_2_PIl M_2_PIf128
+#define M_2_SQRTPIl M_2_SQRTPIf128
+#define M_SQRT2l M_SQRT2f128
+#define M_SQRT1_2l M_SQRT1_2f128
+
+
+#include <libm-alias-ldouble.h>
+#include <libm-alias-float128.h>
+#undef libm_alias_ldouble_r
+#define libm_alias_ldouble_r(from, to, r) libm_alias_float128_r (from, to, r)
+
+
+#include <math/math-narrow.h>
+#undef libm_alias_float_ldouble
+#define libm_alias_float_ldouble(func) libm_alias_float32_float128 (func)
+#undef libm_alias_double_ldouble
+#define libm_alias_double_ldouble(func) libm_alias_float64_float128 (func)
+
+
+/* IEEE function renames. */
+#define __ieee754_acoshl __ieee754_acoshf128
+#define __ieee754_acosl __ieee754_acosf128
+#define __ieee754_asinhl __ieee754_asinhf128
+#define __ieee754_asinl __ieee754_asinf128
+#define __ieee754_atan2l __ieee754_atan2f128
+#define __ieee754_atanhl __ieee754_atanhf128
+#define __ieee754_coshl __ieee754_coshf128
+#define __ieee754_cosl __ieee754_cosf128
+#define __ieee754_exp10l __ieee754_exp10f128
+#define __ieee754_exp2l __ieee754_exp2f128
+#define __ieee754_expl __ieee754_expf128
+#define __ieee754_fmodl __ieee754_fmodf128
+#define __ieee754_gammal_r __ieee754_gammaf128_r
+#define __ieee754_hypotl __ieee754_hypotf128
+#define __ieee754_ilogbl __ieee754_ilogbf128
+#define __ieee754_j0l __ieee754_j0f128
+#define __ieee754_j1l __ieee754_j1f128
+#define __ieee754_jnl __ieee754_jnf128
+#define __ieee754_lgammal_r __ieee754_lgammaf128_r
+#define __ieee754_log10l __ieee754_log10f128
+#define __ieee754_log2l __ieee754_log2f128
+#define __ieee754_logl __ieee754_logf128
+#define __ieee754_powl __ieee754_powf128
+#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
+#define __ieee754_remainderl __ieee754_remainderf128
+#define __ieee754_sinhl __ieee754_sinhf128
+#define __ieee754_sqrtl __ieee754_sqrtf128
+#define __ieee754_y0l __ieee754_y0f128
+#define __ieee754_y1l __ieee754_y1f128
+#define __ieee754_ynl __ieee754_ynf128
+
+
+/* finite math entry points. */
+#define __acoshl_finite __acoshf128_finite
+#define __acosl_finite __acosf128_finite
+#define __asinl_finite __asinf128_finite
+#define __atan2l_finite __atan2f128_finite
+#define __atanhl_finite __atanhf128_finite
+#define __coshl_finite __coshf128_finite
+#define __cosl_finite __cosf128_finite
+#define __exp10l_finite __exp10f128_finite
+#define __exp2l_finite __exp2f128_finite
+#define __expl_finite __expf128_finite
+#define __fmodl_finite __fmodf128_finite
+#define __hypotl_finite __hypotf128_finite
+#define __ilogbl_finite __ilogbf128_finite
+#define __j0l_finite __j0f128_finite
+#define __j1l_finite __j1f128_finite
+#define __jnl_finite __jnf128_finite
+#define __lgammal_r_finite __lgammaf128_r_finite
+#define __log10l_finite __log10f128_finite
+#define __log2l_finite __log2f128_finite
+#define __logl_finite __logf128_finite
+#define __powl_finite __powf128_finite
+#define __remainderl_finite __remainderf128_finite
+#define __sinhl_finite __sinhf128_finite
+#define __y0l_finite __y0f128_finite
+#define __y1l_finite __y1f128_finite
+#define __ynl_finite __ynf128_finite
+
+
+/* internal function names. */
+#define __asinhl __asinhf128
+#define __atanl __atanf128
+#define __cbrtl __cbrtf128
+#define __ceill __ceilf128
+#define __copysignl __copysignf128
+#define __cosl __cosf128
+#define __erfcl __erfcf128
+#define __erfl __erff128
+#define __expl __expf128
+#define __expm1l __expm1f128
+#define __fabsl __fabsf128
+#define __fdiml __fdimf128
+#define __finitel __finitef128
+#define __floorl __floorf128
+#define __fmal __fmaf128
+#define __fmaxl __fmaxf128
+#define __fminl __fminf128
+#define __fpclassifyl __fpclassifyf128
+#define __frexpl __frexpf128
+#define __gammal_r_finite __gammaf128_r_finite
+#define __getpayloadl __getpayloadf128
+#define __isinfl __isinff128
+#define __isnanl __isnanf128
+#define __issignalingl __issignalingf128
+#define __ldexpl __ldexpf128
+#define __llrintl __llrintf128
+#define __llroundl __llroundf128
+#define __log1pl __log1pf128
+#define __logbl __logbf128
+#define __logl __logf128
+#define __lrintl __lrintf128
+#define __lroundl __lroundf128
+#define __modfl __modff128
+#define __nearbyintl __nearbyintf128
+#define __nextafterl __nextafterf128
+#define __nextdownl __nextdownf128
+#define __nextupl __nextupf128
+#define __remquol __remquof128
+#define __rintl __rintf128
+#define __roundevenl __roundevenf128
+#define __roundl __roundf128
+#define __scalblnl __scalblnf128
+#define __scalbnl __scalbnf128
+#define __signbitl __signbitf128
+#define __sincosl __sincosf128
+#define __sinl __sinf128
+#define __sqrtl __sqrtf128
+#define __tanhl __tanhf128
+#define __tanl __tanf128
+#define __totalorderl __totalorderf128
+#define __totalordermagl __totalordermagf128
+#define __truncl __truncf128
+#define __x2y2m1l __x2y2m1f128
+
+#define __faddl __f32addf128
+#define __daddl __f64addf128
+#define __fdivl __f32divf128
+#define __ddivl __f64divf128
+#define __fmull __f32mulf128
+#define __dmull __f64mulf128
+#define __fsubl __f32subf128
+#define __dsubl __f64subf128
+
+/* __nexttowardf128 is not _Float128 API. */
+#define __nexttowardl __nexttowardf128_do_not_use
+#define nexttowardl nexttowardf128_do_not_use
+
+
+/* public entry points. */
+#define asinhl asinhf128
+#define atanl atanf128
+#define cbrtl cbrtf128
+#define ceill ceilf128
+#define copysignl copysignf128
+#define cosl cosf128
+#define erfcl erfcf128
+#define erfl erff128
+#define expl expf128
+#define expm1l expm1f128
+#define fabsl fabsf128
+#define fdiml fdimf128
+#define finitel finitef128_do_not_use
+#define floorl floorf128
+#define fmal fmaf128
+#define fmaxl fmaxf128
+#define fminl fminf128
+#define frexpl frexpf128
+#define getpayloadl getpayloadf128
+#define isinfl isinff128_do_not_use
+#define isnanl isnanf128_do_not_use
+#define ldexpl ldexpf128
+#define llrintl llrintf128
+#define llroundl llroundf128
+#define log1pl log1pf128
+#define logbl logbf128
+#define logl logf128
+#define lrintl lrintf128
+#define lroundl lroundf128
+#define modfl modff128
+#define nanl nanf128
+#define nearbyintl nearbyintf128
+#define nextafterl nextafterf128
+#define nextdownl nextdownf128
+#define nextupl nextupf128
+#define remquol remquof128
+#define rintl rintf128
+#define roundevenl roundevenf128
+#define roundl roundf128
+#define scalbnl scalbnf128
+#define sincosl sincosf128
+#define sinl sinf128
+#define sqrtl sqrtf128
+#define tanhl tanhf128
+#define tanl tanf128
+#define totalorderl totalorderf128
+#define totalordermagl totalordermagf128
+#define truncl truncf128
+
+
+/* misc internal renames. */
+#define __builtin_fmal __builtin_fmaf128
+#define __expl_table __expf128_table
+#define __gamma_productl __gamma_productf128
+#define __kernel_cosl __kernel_cosf128
+#define __kernel_rem_pio2l __kernel_rem_pio2f128
+#define __kernel_sincosl __kernel_sincosf128
+#define __kernel_sinl __kernel_sinf128
+#define __kernel_tanl __kernel_tanf128
+#define __lgamma_negl __lgamma_negf128
+#define __lgamma_productl __lgamma_productf128
+#define __mpn_extract_long_double __mpn_extract_float128
+#define __sincosl_table __sincosf128_table
+#define mul_splitl mul_splitf128
+
+/* Builtin renames. */
+#define __builtin_copysignl __builtin_copysignf128
+#define __builtin_signbitl __builtin_signbit
+
+/* Get the constant suffix from bits/floatn-compat.h. */
+#define L(x) __f128 (x)
+
+static inline void
+mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
+{
+#ifdef __FP_FAST_FMAF128
+ /* Fast built-in fused multiply-add. */
+ *hi = x * y;
+ *lo = __builtin_fmal (x, y, -*hi);
+#else
+ /* Apply Dekker's algorithm. */
+ *hi = x * y;
+# define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
+ _Float128 x1 = x * C;
+ _Float128 y1 = y * C;
+# undef C
+ x1 = (x - x1) + x1;
+ y1 = (y - y1) + y1;
+ _Float128 x2 = x - x1;
+ _Float128 y2 = y - y1;
+ *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
diff --git a/sysdeps/ieee754/float128/gamma_productf128.c b/sysdeps/ieee754/float128/gamma_productf128.c
new file mode 100644
index 0000000000..be2271f12f
--- /dev/null
+++ b/sysdeps/ieee754/float128/gamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/gamma_productl.c"
diff --git a/sysdeps/ieee754/float128/ieee754_float128.h b/sysdeps/ieee754/float128/ieee754_float128.h
new file mode 100644
index 0000000000..ea307eb9e9
--- /dev/null
+++ b/sysdeps/ieee754/float128/ieee754_float128.h
@@ -0,0 +1,140 @@
+/* _Float128 IEEE like macros.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#ifndef _IEEE754_FLOAT128_H
+#define _IEEE754_FLOAT128_H
+
+#include <endian.h>
+#include <stdint.h>
+
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+# define __FLT_EORDER2(t, a, b) t a; t b;
+# define __FLT_EORDER4(t, a, b, c, d) \
+ t a; t b; t c; t d;
+# define __FLT_EORDER6(t, a, b, c, d, e, f) \
+ t a; t b; t c; t d; t e; t f;
+# define __FLT_EORDER7(t, a, b, c, d, e, f, g) \
+ t a; t b; t c; t d; t e; t f; t g;
+# else
+# define __FLT_EORDER2(t, a, b) \
+ t b; t a;
+# define __FLT_EORDER4(t, a, b, c, d) \
+ t d; t c; t b; t a;
+# define __FLT_EORDER6(t, a, b, c, d, e, f) \
+ t f; t e; t d; t c; t b; t a;
+# define __FLT_EORDER7(t, a, b, c, d, e, f, g) \
+ t g; t f; t e; t d; t c; t b; t a;
+# endif
+
+/* A union which permits us to convert between _Float128 and
+ four 32 bit ints or two 64 bit ints. */
+
+typedef union
+{
+ _Float128 value;
+ struct
+ {
+ __FLT_EORDER2 (uint64_t, msw, lsw);
+ } parts64;
+ struct
+ {
+ __FLT_EORDER4 (uint32_t, w0, w1, w2, w3);
+ } parts32;
+} ieee854_float128_shape_type;
+
+/* Get two 64 bit ints from a _Float128. */
+
+# define GET_FLOAT128_WORDS64(ix0,ix1,d) \
+do { \
+ ieee854_float128_shape_type qw_u; \
+ qw_u.value = (d); \
+ (ix0) = qw_u.parts64.msw; \
+ (ix1) = qw_u.parts64.lsw; \
+} while (0)
+
+/* Set a _Float128 from two 64 bit ints. */
+
+# define SET_FLOAT128_WORDS64(d,ix0,ix1) \
+do { \
+ ieee854_float128_shape_type qw_u; \
+ qw_u.parts64.msw = (ix0); \
+ qw_u.parts64.lsw = (ix1); \
+ (d) = qw_u.value; \
+} while (0)
+
+/* Get the more significant 64 bits of a _Float128 mantissa. */
+
+# define GET_FLOAT128_MSW64(v,d) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ (v) = sh_u.parts64.msw; \
+} while (0)
+
+/* Set the more significant 64 bits of a _Float128 mantissa from an int. */
+
+# define SET_FLOAT128_MSW64(d,v) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts64.msw = (v); \
+ (d) = sh_u.value; \
+} while (0)
+
+/* Get the least significant 64 bits of a _Float128 mantissa. */
+
+# define GET_FLOAT128_LSW64(v,d) \
+do { \
+ ieee854_float128_shape_type sh_u; \
+ sh_u.value = (d); \
+ (v) = sh_u.parts64.lsw; \
+} while (0)
+
+/* Likewise, some helper macros which are exposed via ieee754.h for
+ C99 real types, but not _Float128. */
+
+union ieee854_float128
+ {
+ _Float128 d;
+
+ /* This is the IEEE 854 quad-precision format. */
+ struct
+ {
+ __FLT_EORDER6 (unsigned int, negative:1,
+ exponent:15,
+ mantissa0:16,
+ mantissa1:32,
+ mantissa2:32,
+ mantissa3:32)
+ } ieee;
+
+ /* This format makes it easier to see if a NaN is a signalling NaN. */
+ struct
+ {
+ __FLT_EORDER7 (unsigned int, negative:1,
+ exponent:15,
+ quiet_nan:1,
+ mantissa0:15,
+ mantissa1:32,
+ mantissa2:32,
+ mantissa3:32)
+ } ieee_nan;
+ };
+
+#define IEEE854_FLOAT128_BIAS 0x3fff /* Added to exponent. */
+
+#endif
diff --git a/sysdeps/ieee754/float128/k_cosf128.c b/sysdeps/ieee754/float128/k_cosf128.c
new file mode 100644
index 0000000000..9db0906e9a
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_cosl.c"
diff --git a/sysdeps/ieee754/float128/k_sincosf128.c b/sysdeps/ieee754/float128/k_sincosf128.c
new file mode 100644
index 0000000000..14c0f1eccf
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sincosl.c"
diff --git a/sysdeps/ieee754/float128/k_sinf128.c b/sysdeps/ieee754/float128/k_sinf128.c
new file mode 100644
index 0000000000..f3acf1cfe1
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sinl.c"
diff --git a/sysdeps/ieee754/float128/k_tanf128.c b/sysdeps/ieee754/float128/k_tanf128.c
new file mode 100644
index 0000000000..ca6be539f7
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_tanl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_negf128.c b/sysdeps/ieee754/float128/lgamma_negf128.c
new file mode 100644
index 0000000000..9c16f93025
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_negf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_negl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_productf128.c b/sysdeps/ieee754/float128/lgamma_productf128.c
new file mode 100644
index 0000000000..5efe5dd576
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_productl.c"
diff --git a/sysdeps/ieee754/float128/math-nan-payload-float128.h b/sysdeps/ieee754/float128/math-nan-payload-float128.h
new file mode 100644
index 0000000000..95ab953596
--- /dev/null
+++ b/sysdeps/ieee754/float128/math-nan-payload-float128.h
@@ -0,0 +1,34 @@
+/* NaN payload handling for _Float128.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <ieee754_float128.h>
+
+#define SET_NAN_PAYLOAD(flt, mant) \
+ do \
+ { \
+ union ieee854_float128 u; \
+ u.d = (flt); \
+ u.ieee_nan.mantissa0 = 0; \
+ u.ieee_nan.mantissa1 = 0; \
+ u.ieee_nan.mantissa2 = (mant) >> 32; \
+ u.ieee_nan.mantissa3 = (mant); \
+ if ((u.ieee.mantissa0 | u.ieee.mantissa1 \
+ | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \
+ (flt) = u.d; \
+ } \
+ while (0)
diff --git a/sysdeps/ieee754/float128/mpn2float128.c b/sysdeps/ieee754/float128/mpn2float128.c
new file mode 100644
index 0000000000..1360abc5c0
--- /dev/null
+++ b/sysdeps/ieee754/float128/mpn2float128.c
@@ -0,0 +1,54 @@
+/* Convert a number in multi-precision format to _Float128.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include <float.h>
+#include <math.h>
+
+#include "ieee754_float128.h"
+
+/* Convert a multi-precision integer of the needed number of bits (113 for
+ binary128) and an integral power of two to a `_Float128' in IEEE854
+ quad-precision format. */
+
+_Float128
+__mpn_construct_float128 (mp_srcptr frac_ptr, int expt, int sign)
+{
+ union ieee854_float128 u;
+
+ u.ieee.negative = sign;
+ u.ieee.exponent = expt + IEEE854_FLOAT128_BIAS;
+#if BITS_PER_MP_LIMB == 32
+ u.ieee.mantissa3 = frac_ptr[0];
+ u.ieee.mantissa2 = frac_ptr[1];
+ u.ieee.mantissa1 = frac_ptr[2];
+ u.ieee.mantissa0 = frac_ptr[3] & (((mp_limb_t) 1
+ << (FLT128_MANT_DIG - 96)) - 1);
+#elif BITS_PER_MP_LIMB == 64
+ u.ieee.mantissa3 = frac_ptr[0] & (((mp_limb_t) 1 << 32) - 1);
+ u.ieee.mantissa2 = frac_ptr[0] >> 32;
+ u.ieee.mantissa1 = frac_ptr[1] & (((mp_limb_t) 1 << 32) - 1);
+ u.ieee.mantissa0 = (frac_ptr[1] >> 32) & (((mp_limb_t) 1
+ << (FLT128_MANT_DIG - 96)) - 1);
+#else
+ #error "mp_limb size " BITS_PER_MP_LIMB "not accounted for"
+#endif
+
+ return u.d;
+}
diff --git a/sysdeps/ieee754/float128/s_asinhf128.c b/sysdeps/ieee754/float128/s_asinhf128.c
new file mode 100644
index 0000000000..7b93d8cf3a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_asinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_asinhl.c"
diff --git a/sysdeps/ieee754/float128/s_atanf128.c b/sysdeps/ieee754/float128/s_atanf128.c
new file mode 100644
index 0000000000..9b4d7ecec3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_atanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_atanl.c"
diff --git a/sysdeps/ieee754/float128/s_cbrtf128.c b/sysdeps/ieee754/float128/s_cbrtf128.c
new file mode 100644
index 0000000000..3bd5797373
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cbrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cbrtl.c"
diff --git a/sysdeps/ieee754/float128/s_ceilf128.c b/sysdeps/ieee754/float128/s_ceilf128.c
new file mode 100644
index 0000000000..0af15f5f03
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ceilf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_ceill.c"
diff --git a/sysdeps/ieee754/float128/s_copysignf128.c b/sysdeps/ieee754/float128/s_copysignf128.c
new file mode 100644
index 0000000000..808f7abbc0
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_copysignf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_copysignl.c"
diff --git a/sysdeps/ieee754/float128/s_cosf128.c b/sysdeps/ieee754/float128/s_cosf128.c
new file mode 100644
index 0000000000..8ba552695c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cosl.c"
diff --git a/sysdeps/ieee754/float128/s_erff128.c b/sysdeps/ieee754/float128/s_erff128.c
new file mode 100644
index 0000000000..ac16ad6665
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_erff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_erfl.c"
diff --git a/sysdeps/ieee754/float128/s_expm1f128.c b/sysdeps/ieee754/float128/s_expm1f128.c
new file mode 100644
index 0000000000..ea28d89db4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_expm1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_expm1l.c"
diff --git a/sysdeps/ieee754/float128/s_f32addf128.c b/sysdeps/ieee754/float128/s_f32addf128.c
new file mode 100644
index 0000000000..e2f8ded401
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32addf128.c
@@ -0,0 +1,6 @@
+#define f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <float128_private.h>
+#undef f32addf64x
+#undef f32addf128
+#include "../ldbl-128/s_faddl.c"
diff --git a/sysdeps/ieee754/float128/s_f32divf128.c b/sysdeps/ieee754/float128/s_f32divf128.c
new file mode 100644
index 0000000000..de8d252e80
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32divf128.c
@@ -0,0 +1,6 @@
+#define f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <float128_private.h>
+#undef f32divf64x
+#undef f32divf128
+#include "../ldbl-128/s_fdivl.c"
diff --git a/sysdeps/ieee754/float128/s_f32mulf128.c b/sysdeps/ieee754/float128/s_f32mulf128.c
new file mode 100644
index 0000000000..45fdc66ba6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32mulf128.c
@@ -0,0 +1,6 @@
+#define f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <float128_private.h>
+#undef f32mulf64x
+#undef f32mulf128
+#include "../ldbl-128/s_fmull.c"
diff --git a/sysdeps/ieee754/float128/s_f32subf128.c b/sysdeps/ieee754/float128/s_f32subf128.c
new file mode 100644
index 0000000000..f1373f68ac
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f32subf128.c
@@ -0,0 +1,6 @@
+#define f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <float128_private.h>
+#undef f32subf64x
+#undef f32subf128
+#include "../ldbl-128/s_fsubl.c"
diff --git a/sysdeps/ieee754/float128/s_f64addf128.c b/sysdeps/ieee754/float128/s_f64addf128.c
new file mode 100644
index 0000000000..c2bb293399
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64addf128.c
@@ -0,0 +1,10 @@
+#define f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <float128_private.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+#include "../ldbl-128/s_daddl.c"
diff --git a/sysdeps/ieee754/float128/s_f64divf128.c b/sysdeps/ieee754/float128/s_f64divf128.c
new file mode 100644
index 0000000000..ea37e8bcaf
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64divf128.c
@@ -0,0 +1,10 @@
+#define f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <float128_private.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+#include "../ldbl-128/s_ddivl.c"
diff --git a/sysdeps/ieee754/float128/s_f64mulf128.c b/sysdeps/ieee754/float128/s_f64mulf128.c
new file mode 100644
index 0000000000..47a645ac4d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64mulf128.c
@@ -0,0 +1,10 @@
+#define f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <float128_private.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+#include "../ldbl-128/s_dmull.c"
diff --git a/sysdeps/ieee754/float128/s_f64subf128.c b/sysdeps/ieee754/float128/s_f64subf128.c
new file mode 100644
index 0000000000..89ef5a7cc6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64subf128.c
@@ -0,0 +1,10 @@
+#define f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <float128_private.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+#include "../ldbl-128/s_dsubl.c"
diff --git a/sysdeps/ieee754/float128/s_f64xaddf128.c b/sysdeps/ieee754/float128/s_f64xaddf128.c
new file mode 100644
index 0000000000..c8af0a5dff
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xaddf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xaddf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xdivf128.c b/sysdeps/ieee754/float128/s_f64xdivf128.c
new file mode 100644
index 0000000000..55cc953ba6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xdivf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xdivf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xmulf128.c b/sysdeps/ieee754/float128/s_f64xmulf128.c
new file mode 100644
index 0000000000..085bf9fe4e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xmulf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xmulf128.c"
diff --git a/sysdeps/ieee754/float128/s_f64xsubf128.c b/sysdeps/ieee754/float128/s_f64xsubf128.c
new file mode 100644
index 0000000000..64a0d6d82c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_f64xsubf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_f64xsubf128.c"
diff --git a/sysdeps/ieee754/float128/s_fabsf128.c b/sysdeps/ieee754/float128/s_fabsf128.c
new file mode 100644
index 0000000000..79ba47c3fd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fabsf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fabsl.c"
diff --git a/sysdeps/ieee754/float128/s_finitef128.c b/sysdeps/ieee754/float128/s_finitef128.c
new file mode 100644
index 0000000000..801de88e32
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_finitef128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_finitel.c"
diff --git a/sysdeps/ieee754/float128/s_floorf128.c b/sysdeps/ieee754/float128/s_floorf128.c
new file mode 100644
index 0000000000..18298436a1
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_floorf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_floorl.c"
diff --git a/sysdeps/ieee754/float128/s_fmaf128.c b/sysdeps/ieee754/float128/s_fmaf128.c
new file mode 100644
index 0000000000..6497895c8d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fmaf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fmal.c"
diff --git a/sysdeps/ieee754/float128/s_fpclassifyf128.c b/sysdeps/ieee754/float128/s_fpclassifyf128.c
new file mode 100644
index 0000000000..15131dc4a2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fpclassifyf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fpclassifyl.c"
diff --git a/sysdeps/ieee754/float128/s_frexpf128.c b/sysdeps/ieee754/float128/s_frexpf128.c
new file mode 100644
index 0000000000..7b040b3e33
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_frexpf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_frexpl.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
new file mode 100644
index 0000000000..86adf3821e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
new file mode 100644
index 0000000000..c56422381f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/float128/s_getpayloadf128.c b/sysdeps/ieee754/float128/s_getpayloadf128.c
new file mode 100644
index 0000000000..2e2607a81b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_getpayloadf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_getpayloadl.c"
diff --git a/sysdeps/ieee754/float128/s_isinff128.c b/sysdeps/ieee754/float128/s_isinff128.c
new file mode 100644
index 0000000000..62cc424b16
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isinff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isinfl.c"
diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c
new file mode 100644
index 0000000000..efba24059a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isnanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isnanl.c"
diff --git a/sysdeps/ieee754/float128/s_issignalingf128.c b/sysdeps/ieee754/float128/s_issignalingf128.c
new file mode 100644
index 0000000000..1d4599544f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_issignalingf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_issignalingl.c"
diff --git a/sysdeps/ieee754/float128/s_llrintf128.c b/sysdeps/ieee754/float128/s_llrintf128.c
new file mode 100644
index 0000000000..bb9ca580cd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llrintl.c"
diff --git a/sysdeps/ieee754/float128/s_llroundf128.c b/sysdeps/ieee754/float128/s_llroundf128.c
new file mode 100644
index 0000000000..be54a90608
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llroundl.c"
diff --git a/sysdeps/ieee754/float128/s_log1pf128.c b/sysdeps/ieee754/float128/s_log1pf128.c
new file mode 100644
index 0000000000..48bb84f987
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_log1pf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_log1pl.c"
diff --git a/sysdeps/ieee754/float128/s_logbf128.c b/sysdeps/ieee754/float128/s_logbf128.c
new file mode 100644
index 0000000000..167384a8d4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_logbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_logbl.c"
diff --git a/sysdeps/ieee754/float128/s_lrintf128.c b/sysdeps/ieee754/float128/s_lrintf128.c
new file mode 100644
index 0000000000..1cfa9d7ca4
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lrintl.c"
diff --git a/sysdeps/ieee754/float128/s_lroundf128.c b/sysdeps/ieee754/float128/s_lroundf128.c
new file mode 100644
index 0000000000..13ba9f220d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lroundl.c"
diff --git a/sysdeps/ieee754/float128/s_modff128.c b/sysdeps/ieee754/float128/s_modff128.c
new file mode 100644
index 0000000000..4618c6c380
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_modff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_modfl.c"
diff --git a/sysdeps/ieee754/float128/s_nearbyintf128.c b/sysdeps/ieee754/float128/s_nearbyintf128.c
new file mode 100644
index 0000000000..e61a3b3bfb
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nearbyintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nearbyintl.c"
diff --git a/sysdeps/ieee754/float128/s_nextafterf128.c b/sysdeps/ieee754/float128/s_nextafterf128.c
new file mode 100644
index 0000000000..2c43a00384
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextafterf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextafterl.c"
diff --git a/sysdeps/ieee754/float128/s_nexttowardf128.c b/sysdeps/ieee754/float128/s_nexttowardf128.c
new file mode 100644
index 0000000000..006e4c98b1
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nexttowardf128.c
@@ -0,0 +1 @@
+/* This function does not exist for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/s_nextupf128.c b/sysdeps/ieee754/float128/s_nextupf128.c
new file mode 100644
index 0000000000..7d5d0b8c72
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextupf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextupl.c"
diff --git a/sysdeps/ieee754/float128/s_remquof128.c b/sysdeps/ieee754/float128/s_remquof128.c
new file mode 100644
index 0000000000..1cef61ab1b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_remquof128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_remquol.c"
diff --git a/sysdeps/ieee754/float128/s_rintf128.c b/sysdeps/ieee754/float128/s_rintf128.c
new file mode 100644
index 0000000000..2adb95f360
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_rintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_rintl.c"
diff --git a/sysdeps/ieee754/float128/s_roundevenf128.c b/sysdeps/ieee754/float128/s_roundevenf128.c
new file mode 100644
index 0000000000..5a9b3f395f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundevenf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundevenl.c"
diff --git a/sysdeps/ieee754/float128/s_roundf128.c b/sysdeps/ieee754/float128/s_roundf128.c
new file mode 100644
index 0000000000..1eb36f2a5e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundl.c"
diff --git a/sysdeps/ieee754/float128/s_scalblnf128.c b/sysdeps/ieee754/float128/s_scalblnf128.c
new file mode 100644
index 0000000000..999223c517
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalblnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalblnl.c"
diff --git a/sysdeps/ieee754/float128/s_scalbnf128.c b/sysdeps/ieee754/float128/s_scalbnf128.c
new file mode 100644
index 0000000000..0e7ab2663b
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalbnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalbnl.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadf128.c b/sysdeps/ieee754/float128/s_setpayloadf128.c
new file mode 100644
index 0000000000..65f0961fc7
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadf128.c
@@ -0,0 +1,5 @@
+#include <float128_private.h>
+#define SIG 0
+#define FUNC __setpayloadf128
+#include "../ldbl-128/s_setpayloadl_main.c"
+libm_alias_float128 (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/float128/s_setpayloadsigf128.c b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
new file mode 100644
index 0000000000..bd3ffb6775
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
@@ -0,0 +1,5 @@
+#include <float128_private.h>
+#define SIG 1
+#define FUNC __setpayloadsigf128
+#include "../ldbl-128/s_setpayloadl_main.c"
+libm_alias_float128 (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/dbl-64/w_exp.c b/sysdeps/ieee754/float128/s_signbitf128.c
index 595ed992d2..559df3b56c 100644
--- a/sysdeps/ieee754/dbl-64/w_exp.c
+++ b/sysdeps/ieee754/float128/s_signbitf128.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Return nonzero value if number is negative.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,23 +16,22 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <float128_private.h>
#include <math.h>
#include <math_private.h>
-/* wrapper exp */
-double
-__exp (double x)
+/* Once GCC >= 6.0 is required for building glibc, this implementation can
+ be removed and replaced with an inclusion of ldbl-128/s_signbitl.c. */
+int
+__signbitf128 (_Float128 x)
{
- double z = __ieee754_exp (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard (x, x, 6 + !!signbit (x));
+#if __GNUC_PREREQ (6, 0)
+ return __builtin_signbit (x);
+#else
+ int64_t e;
- return z;
-}
-hidden_def (__exp)
-weak_alias (__exp, exp)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__exp, __expl)
-weak_alias (__exp, expl)
+ GET_FLOAT128_MSW64 (e, x);
+ return e < 0;
#endif
+}
+hidden_def (__signbitf128)
diff --git a/sysdeps/ieee754/float128/s_significandf128.c b/sysdeps/ieee754/float128/s_significandf128.c
new file mode 100644
index 0000000000..067b724164
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_significandf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types. */
diff --git a/sysdeps/ieee754/float128/s_sincosf128.c b/sysdeps/ieee754/float128/s_sincosf128.c
new file mode 100644
index 0000000000..472adde17f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sincosl.c"
diff --git a/sysdeps/ieee754/float128/s_sinf128.c b/sysdeps/ieee754/float128/s_sinf128.c
new file mode 100644
index 0000000000..d79a1163a5
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sinl.c"
diff --git a/sysdeps/ieee754/float128/s_tanf128.c b/sysdeps/ieee754/float128/s_tanf128.c
new file mode 100644
index 0000000000..382961aada
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanl.c"
diff --git a/sysdeps/ieee754/float128/s_tanhf128.c b/sysdeps/ieee754/float128/s_tanhf128.c
new file mode 100644
index 0000000000..e02c9a6005
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanhl.c"
diff --git a/sysdeps/ieee754/float128/s_totalorderf128.c b/sysdeps/ieee754/float128/s_totalorderf128.c
new file mode 100644
index 0000000000..1b115d8307
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalorderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalorderl.c"
diff --git a/sysdeps/ieee754/float128/s_totalordermagf128.c b/sysdeps/ieee754/float128/s_totalordermagf128.c
new file mode 100644
index 0000000000..e44c657275
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalordermagf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalordermagl.c"
diff --git a/sysdeps/ieee754/float128/s_truncf128.c b/sysdeps/ieee754/float128/s_truncf128.c
new file mode 100644
index 0000000000..474d9dc77e
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_truncf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_truncl.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpf128.c b/sysdeps/ieee754/float128/s_ufromfpf128.c
new file mode 100644
index 0000000000..0e6521f587
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/float128/s_ufromfpxf128.c b/sysdeps/ieee754/float128/s_ufromfpxf128.c
new file mode 100644
index 0000000000..cd192b73bf
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpxf128.c
@@ -0,0 +1,6 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
+libm_alias_float128 (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c b/sysdeps/ieee754/float128/strfromf128.c
index 05d4dfe05b..bdc540aa71 100644
--- a/sysdeps/ieee754/ldbl-64-128/w_scalblnl.c
+++ b/sysdeps/ieee754/float128/strfromf128.c
@@ -1,6 +1,6 @@
-/* Wrapper for __scalblnl handles setting errno.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+/* Definitions for strfromf128. Implementation in stdlib/strfrom-skeleton.c.
+
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,12 +16,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(name, alias)
-#include <math/w_scalblnl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __w_scalblnl, scalblnl);
-#else
-long_double_symbol (libc, __w_scalblnl, scalblnl);
+#include <bits/floatn.h>
+
+#define FLOAT _Float128
+#define STRFROM strfromf128
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strfromf64x __hide_strfromf64x
+# include <stdlib.h>
+# undef strfromf64x
+#endif
+
+#include <float128_private.h>
+
+#include <stdlib/strfrom-skeleton.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+weak_alias (strfromf128, strfromf64x)
#endif
diff --git a/sysdeps/ieee754/float128/strtof128.c b/sysdeps/ieee754/float128/strtof128.c
new file mode 100644
index 0000000000..b7265b125a
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128.c
@@ -0,0 +1,51 @@
+/* strtof128 wrapper of strtof128_l.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* The actual implementation for all floating point sizes is in strtod.c.
+ These macros tell it to produce the `_Float128' version, `strtof128'. */
+
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x __hide_strtof64x
+# define wcstof64x __hide_wcstof64x
+#endif
+
+#define FLOAT _Float128
+#define FLT FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF wcstof128
+# define STRTOF_L __wcstof128_l
+#else
+# define STRTOF strtof128
+# define STRTOF_L __strtof128_l
+#endif
+
+#include <float128_private.h>
+
+#include <stdlib/strtod.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x
+# undef wcstof64x
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128, wcstof64x)
+# else
+weak_alias (strtof128, strtof64x)
+# endif
+#endif
diff --git a/sysdeps/ieee754/float128/strtof128_l.c b/sysdeps/ieee754/float128/strtof128_l.c
new file mode 100644
index 0000000000..eff0c97d46
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_l.c
@@ -0,0 +1,58 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <bits/types/locale_t.h>
+
+/* Bring in potential typedef for _Float128 early for declaration below. */
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
+extern _Float128 ____strtof128_l_internal (const char *, char **,
+ int, locale_t);
+
+#define FLOAT _Float128
+#define FLT FLT128
+#ifdef USE_WIDE_CHAR
+# define STRTOF wcstof128_l
+# define __STRTOF __wcstof128_l
+# define STRTOF_NAN __wcstof128_nan
+#else
+# define STRTOF strtof128_l
+# define __STRTOF __strtof128_l
+# define STRTOF_NAN __strtof128_nan
+#endif
+#define MPN2FLOAT __mpn_construct_float128
+#define FLOAT_HUGE_VAL __builtin_huge_valf128 ()
+
+#include <float128_private.h>
+
+#include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128_l, wcstof64x_l)
+# else
+weak_alias (strtof128_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/float128/strtof128_nan.c b/sysdeps/ieee754/float128/strtof128_nan.c
new file mode 100644
index 0000000000..37a7f4e02e
--- /dev/null
+++ b/sysdeps/ieee754/float128/strtof128_nan.c
@@ -0,0 +1,26 @@
+/* Convert string for NaN payload to corresponding NaN. Narrow
+ strings, __float128.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+#include <strtod_nan_narrow.h>
+#include <math-type-macros-float128.h>
+
+#define STRTOD_NAN __strtof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/sysdeps/ieee754/float128/t_sincosf128.c b/sysdeps/ieee754/float128/t_sincosf128.c
new file mode 100644
index 0000000000..7e699d3c8e
--- /dev/null
+++ b/sysdeps/ieee754/float128/t_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/t_sincosl.c"
diff --git a/sysdeps/ieee754/float128/wcstof128.c b/sysdeps/ieee754/float128/wcstof128.c
new file mode 100644
index 0000000000..4337b9f790
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128.c
@@ -0,0 +1,27 @@
+/* wcstof128 wrapper of wcstof128_l.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stddef.h>
+#include <bits/types/locale_t.h>
+
+#define USE_WIDE_CHAR 1
+
+/* Bring in _Float128 typedef if needed. */
+#include <bits/floatn.h>
+
+#include "strtof128.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_l.c b/sysdeps/ieee754/float128/wcstof128_l.c
new file mode 100644
index 0000000000..19c3c51184
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_l.c
@@ -0,0 +1,27 @@
+/* Convert string representing a number to integer value, using given locale.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stddef.h>
+#include <bits/types/locale_t.h>
+
+
+#define USE_WIDE_CHAR 1
+
+#include <bits/floatn.h>
+
+#include "strtof128_l.c"
diff --git a/sysdeps/ieee754/float128/wcstof128_nan.c b/sysdeps/ieee754/float128/wcstof128_nan.c
new file mode 100644
index 0000000000..f504809dcf
--- /dev/null
+++ b/sysdeps/ieee754/float128/wcstof128_nan.c
@@ -0,0 +1,23 @@
+/* Convert string for NaN payload to corresponding NaN. Wide strings,
+ _Float128.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdlib/strtod_nan_wide.h>
+#include <math-type-macros-float128.h>
+#define STRTOD_NAN __wcstof128_nan
+#include <stdlib/strtod_nan_main.c>
diff --git a/sysdeps/ieee754/float128/x2y2m1f128.c b/sysdeps/ieee754/float128/x2y2m1f128.c
new file mode 100644
index 0000000000..68880792e6
--- /dev/null
+++ b/sysdeps/ieee754/float128/x2y2m1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/x2y2m1l.c"
diff --git a/sysdeps/ieee754/flt-32/e_acosf.c b/sysdeps/ieee754/flt-32/e_acosf.c
index 6f792f6604..3b2e4f1bde 100644
--- a/sysdeps/ieee754/flt-32/e_acosf.c
+++ b/sysdeps/ieee754/flt-32/e_acosf.c
@@ -56,14 +56,14 @@ __ieee754_acosf(float x)
z = (one+x)*(float)0.5;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
- s = __ieee754_sqrtf(z);
+ s = sqrtf(z);
r = p/q;
w = r*s-pio2_lo;
return pi - (float)2.0*(s+w);
} else { /* x > 0.5 */
int32_t idf;
z = (one-x)*(float)0.5;
- s = __ieee754_sqrtf(z);
+ s = sqrtf(z);
df = s;
GET_FLOAT_WORD(idf,df);
SET_FLOAT_WORD(df,idf&0xfffff000);
diff --git a/sysdeps/ieee754/flt-32/e_acoshf.c b/sysdeps/ieee754/flt-32/e_acoshf.c
index aabfb85df7..49e64f3c43 100644
--- a/sysdeps/ieee754/flt-32/e_acoshf.c
+++ b/sysdeps/ieee754/flt-32/e_acoshf.c
@@ -40,10 +40,10 @@ float __ieee754_acoshf(float x)
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one)));
+ return __ieee754_logf((float)2.0*x-one/(x+sqrtf(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t));
+ return __log1pf(t+sqrtf((float)2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshf, __acoshf_finite)
diff --git a/sysdeps/ieee754/flt-32/e_asinf.c b/sysdeps/ieee754/flt-32/e_asinf.c
index 2ca2dbcb28..e03073b8bd 100644
--- a/sysdeps/ieee754/flt-32/e_asinf.c
+++ b/sysdeps/ieee754/flt-32/e_asinf.c
@@ -42,6 +42,7 @@ static char rcsid[] = "$NetBSD: e_asinf.c,v 1.5 1995/05/12 04:57:25 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
one = 1.0000000000e+00, /* 0x3F800000 */
@@ -85,7 +86,7 @@ float __ieee754_asinf(float x)
w = one-fabsf(x);
t = w*0.5f;
p = t * (p0 + t * (p1 + t * (p2 + t * (p3 + t * p4))));
- s = __ieee754_sqrtf(t);
+ s = sqrtf(t);
if(ix>=0x3F79999A) { /* if |x| > 0.975 */
t = pio2_hi-(2.0f*(s+s*p)-pio2_lo);
} else {
diff --git a/sysdeps/ieee754/flt-32/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c
index 29eefc0dd6..ddc5873ade 100644
--- a/sysdeps/ieee754/flt-32/e_atan2f.c
+++ b/sysdeps/ieee754/flt-32/e_atan2f.c
@@ -81,7 +81,7 @@ __ieee754_atan2f (float y, float x)
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int32_t zh;
+ uint32_t zh;
GET_FLOAT_WORD(zh,z);
SET_FLOAT_WORD(z,zh ^ 0x80000000);
}
diff --git a/sysdeps/ieee754/flt-32/e_atanhf.c b/sysdeps/ieee754/flt-32/e_atanhf.c
index 82de071ab8..207d759362 100644
--- a/sysdeps/ieee754/flt-32/e_atanhf.c
+++ b/sysdeps/ieee754/flt-32/e_atanhf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
@@ -38,7 +38,9 @@
#include <float.h>
#include <inttypes.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float huge = 1e30;
diff --git a/sysdeps/ieee754/flt-32/e_coshf.c b/sysdeps/ieee754/flt-32/e_coshf.c
index 7b223758e1..a2aa83876d 100644
--- a/sysdeps/ieee754/flt-32/e_coshf.c
+++ b/sysdeps/ieee754/flt-32/e_coshf.c
@@ -15,6 +15,7 @@
*/
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float huge = 1.0e30;
diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
index 1723c482de..7218e5d254 100644
--- a/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -1,7 +1,6 @@
-/* Single-precision floating point 2^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Single-precision 2^x function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,116 +16,81 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* The basic design here is from
- Shmuel Gal and Boris Bachelis, "An Accurate Elementary Mathematical
- Library for the IEEE Floating Point Standard", ACM Trans. Math. Soft.,
- 17 (1), March 1991, pp. 26-45.
- It has been slightly modified to compute 2^x instead of e^x, and for
- single-precision.
- */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-#include <stdlib.h>
-#include <float.h>
-#include <ieee754.h>
#include <math.h>
-#include <fenv.h>
-#include <inttypes.h>
-#include <math_private.h>
-
-#include "t_exp2f.h"
-
-static const float TWOM100 = 7.88860905e-31;
-static const float TWO127 = 1.7014118346e+38;
+#include <math-narrow-eval.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+EXP2F_TABLE_BITS = 5
+EXP2F_POLY_ORDER = 3
+
+ULP error: 0.502 (nearest rounding.)
+Relative error: 1.69 * 2^-34 in [-1/64, 1/64] (before rounding.)
+Wrong count: 168353 (all nearest rounding wrong results with fma.)
+Non-nearest ULP error: 1 (rounded ULP error)
+*/
+
+#define N (1 << EXP2F_TABLE_BITS)
+#define T __exp2f_data.tab
+#define C __exp2f_data.poly
+#define SHIFT __exp2f_data.shift_scaled
+
+static inline uint32_t
+top12 (float x)
+{
+ return asuint (x) >> 20;
+}
float
-__ieee754_exp2f (float x)
+__exp2f (float x)
{
- static const float himark = (float) FLT_MAX_EXP;
- static const float lomark = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
-
- /* Check for usual case. */
- if (isless (x, himark) && isgreaterequal (x, lomark))
- {
- static const float THREEp14 = 49152.0;
- int tval, unsafe;
- float rx, x22, result;
- union ieee754_float ex2_u, scale_u;
-
- if (fabsf (x) < FLT_EPSILON / 4.0f)
- return 1.0f + x;
-
- {
- SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
-
- /* 1. Argument reduction.
- Choose integers ex, -128 <= t < 128, and some real
- -1/512 <= x1 <= 1/512 so that
- x = ex + t/512 + x1.
-
- First, calculate rx = ex + t/256. */
- rx = x + THREEp14;
- rx -= THREEp14;
- x -= rx; /* Compute x=x1. */
- /* Compute tval = (ex*256 + t)+128.
- Now, t = (tval mod 256)-128 and ex=tval/256 [that's mod, NOT %;
- and /-round-to-nearest not the usual c integer /]. */
- tval = (int) (rx * 256.0f + 128.0f);
-
- /* 2. Adjust for accurate table entry.
- Find e so that
- x = ex + t/256 + e + x2
- where -7e-4 < e < 7e-4, and
- (float)(2^(t/256+e))
- is accurate to one part in 2^-64. */
-
- /* 'tval & 255' is the same as 'tval%256' except that it's always
- positive.
- Compute x = x2. */
- x -= __exp2f_deltatable[tval & 255];
-
- /* 3. Compute ex2 = 2^(t/255+e+ex). */
- ex2_u.f = __exp2f_atable[tval & 255];
- tval >>= 8;
- /* x2 is an integer multiple of 2^-30; avoid intermediate
- underflow from the calculation of x22 * x. */
- unsafe = abs(tval) >= -FLT_MIN_EXP - 32;
- ex2_u.ieee.exponent += tval >> unsafe;
- scale_u.f = 1.0;
- scale_u.ieee.exponent += tval - (tval >> unsafe);
-
- /* 4. Approximate 2^x2 - 1, using a second-degree polynomial,
- with maximum error in [-2^-9 - 2^-14, 2^-9 + 2^-14]
- less than 1.3e-10. */
-
- x22 = (.24022656679f * x + .69314736128f) * ex2_u.f;
- }
-
- /* 5. Return (2^x2-1) * 2^(t/512+e+ex) + 2^(t/512+e+ex). */
- result = x22 * x + ex2_u.f;
-
- if (!unsafe)
- return result;
- else
- {
- result *= scale_u.f;
- math_check_force_underflow_nonneg (result);
- return result;
- }
- }
- /* Exceptional cases: */
- else if (isless (x, himark))
+ uint32_t abstop;
+ uint64_t ki, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, xd, z, r, r2, y, s;
+
+ xd = (double_t) x;
+ abstop = top12 (x) & 0x7ff;
+ if (__glibc_unlikely (abstop >= top12 (128.0f)))
{
- if (isinf (x))
- /* e^-inf == 0, with no error. */
- return 0;
- else
- /* Underflow */
- return TWOM100 * TWOM100;
+ /* |x| >= 128 or x is nan. */
+ if (asuint (x) == asuint (-INFINITY))
+ return 0.0f;
+ if (abstop >= top12 (INFINITY))
+ return x + x;
+ if (x > 0.0f)
+ return __math_oflowf (0);
+ if (x <= -150.0f)
+ return __math_uflowf (0);
+#if WANT_ERRNO_UFLOW
+ if (x < -149.0f)
+ return __math_may_uflowf (0);
+#endif
}
- else
- /* Return x, if x is a NaN or Inf; or overflow, otherwise. */
- return TWO127*x;
+
+ /* x = k/N + r with r in [-1/(2N), 1/(2N)] and int k. */
+ kd = math_narrow_eval ((double) (xd + SHIFT)); /* Needs to be double. */
+ ki = asuint64 (kd);
+ kd -= SHIFT; /* k/N for int k. */
+ r = xd - kd;
+
+ /* exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ t += ki << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return (float) y;
}
-strong_alias (__ieee754_exp2f, __exp2f_finite)
+#ifndef __exp2f
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+libm_alias_float_other (__exp2, exp2)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_exp2f_data.c b/sysdeps/ieee754/flt-32/e_exp2f_data.c
new file mode 100644
index 0000000000..8d4e702c92
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_exp2f_data.c
@@ -0,0 +1,44 @@
+/* Shared data between expf, exp2f and powf.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_config.h"
+
+#define N (1 << EXP2F_TABLE_BITS)
+
+const struct exp2f_data __exp2f_data = {
+ /* tab[i] = uint(2^(i/N)) - (i << 52-BITS)
+ used for computing 2^(k/N) for an int |k| < 150 N as
+ double(tab[k%N] + (k << 52-BITS)) */
+ .tab = {
+0x3ff0000000000000, 0x3fefd9b0d3158574, 0x3fefb5586cf9890f, 0x3fef9301d0125b51,
+0x3fef72b83c7d517b, 0x3fef54873168b9aa, 0x3fef387a6e756238, 0x3fef1e9df51fdee1,
+0x3fef06fe0a31b715, 0x3feef1a7373aa9cb, 0x3feedea64c123422, 0x3feece086061892d,
+0x3feebfdad5362a27, 0x3feeb42b569d4f82, 0x3feeab07dd485429, 0x3feea47eb03a5585,
+0x3feea09e667f3bcd, 0x3fee9f75e8ec5f74, 0x3feea11473eb0187, 0x3feea589994cce13,
+0x3feeace5422aa0db, 0x3feeb737b0cdc5e5, 0x3feec49182a3f090, 0x3feed503b23e255d,
+0x3feee89f995ad3ad, 0x3feeff76f2fb5e47, 0x3fef199bdd85529c, 0x3fef3720dcef9069,
+0x3fef5818dcfba487, 0x3fef7c97337b9b5f, 0x3fefa4afa2a490da, 0x3fefd0765b6e4540,
+ },
+ .shift_scaled = 0x1.8p+52 / N,
+ .poly = { 0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1 },
+ .shift = 0x1.8p+52,
+ .invln2_scaled = 0x1.71547652b82fep+0 * N,
+ .poly_scaled = {
+0x1.c6af84b912394p-5/N/N/N, 0x1.ebfce50fac4f3p-3/N/N, 0x1.62e42ff0c52d6p-1/N
+ },
+};
diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
index 071f615ef4..f2238bfd74 100644
--- a/sysdeps/ieee754/flt-32/e_expf.c
+++ b/sysdeps/ieee754/flt-32/e_expf.c
@@ -1,7 +1,6 @@
-/* Single-precision floating point e^x.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Single-precision e^x function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,117 +16,102 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* How this works:
+#ifdef __expf
+# undef libm_hidden_proto
+# define libm_hidden_proto(ignored)
+#endif
- The input value, x, is written as
-
- x = n * ln(2) + t/512 + delta[t] + x;
-
- where:
- - n is an integer, 127 >= n >= -150;
- - t is an integer, 177 >= t >= -177
- - delta is based on a table entry, delta[t] < 2^-28
- - x is whatever is left, |x| < 2^-10
-
- Then e^x is approximated as
-
- e^x = 2^n ( e^(t/512 + delta[t])
- + ( e^(t/512 + delta[t])
- * ( p(x + delta[t] + n * ln(2)) - delta ) ) )
-
- where
- - p(x) is a polynomial approximating e(x)-1;
- - e^(t/512 + delta[t]) is obtained from a table.
-
- The table used is the same one as for the double precision version;
- since we have the table, we might as well use it.
-
- It turns out to be faster to do calculations in double precision than
- to perform an 'accurate table method' expf, because of the range reduction
- overhead (compare exp2f).
- */
-#include <float.h>
-#include <ieee754.h>
#include <math.h>
-#include <fenv.h>
-#include <inttypes.h>
-#include <math_private.h>
-
-extern const float __exp_deltatable[178];
-extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
-
-static const float TWOM100 = 7.88860905e-31;
-static const float TWO127 = 1.7014118346e+38;
+#include <math-narrow-eval.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+EXP2F_TABLE_BITS = 5
+EXP2F_POLY_ORDER = 3
+
+ULP error: 0.502 (nearest rounding.)
+Relative error: 1.69 * 2^-34 in [-ln2/64, ln2/64] (before rounding.)
+Wrong count: 170635 (all nearest rounding wrong results with fma.)
+Non-nearest ULP error: 1 (rounded ULP error)
+*/
+
+#define N (1 << EXP2F_TABLE_BITS)
+#define InvLn2N __exp2f_data.invln2_scaled
+#define T __exp2f_data.tab
+#define C __exp2f_data.poly_scaled
+
+static inline uint32_t
+top12 (float x)
+{
+ return asuint (x) >> 20;
+}
float
-__ieee754_expf (float x)
+__expf (float x)
{
- static const float himark = 88.72283935546875;
- static const float lomark = -103.972084045410;
- /* Check for usual case. */
- if (isless (x, himark) && isgreater (x, lomark))
- {
- static const float THREEp42 = 13194139533312.0;
- static const float THREEp22 = 12582912.0;
- /* 1/ln(2). */
-#undef M_1_LN2
- static const float M_1_LN2 = 1.44269502163f;
- /* ln(2) */
-#undef M_LN2
- static const double M_LN2 = .6931471805599452862;
-
- int tval;
- double x22, t, result, dx;
- float n, delta;
- union ieee754_double ex2_u;
-
- {
- SET_RESTORE_ROUND_NOEXF (FE_TONEAREST);
-
- /* Calculate n. */
- n = x * M_1_LN2 + THREEp22;
- n -= THREEp22;
- dx = x - n*M_LN2;
-
- /* Calculate t/512. */
- t = dx + THREEp42;
- t -= THREEp42;
- dx -= t;
-
- /* Compute tval = t. */
- tval = (int) (t * 512.0);
-
- if (t >= 0)
- delta = - __exp_deltatable[tval];
- else
- delta = __exp_deltatable[-tval];
-
- /* Compute ex2 = 2^n e^(t/512+delta[t]). */
- ex2_u.d = __exp_atable[tval+177];
- ex2_u.ieee.exponent += (int) n;
-
- /* Approximate e^(dx+delta) - 1, using a second-degree polynomial,
- with maximum error in [-2^-10-2^-28,2^-10+2^-28]
- less than 5e-11. */
- x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
- }
-
- /* Return result. */
- result = x22 * ex2_u.d + ex2_u.d;
- return (float) result;
- }
- /* Exceptional cases: */
- else if (isless (x, himark))
+ uint32_t abstop;
+ uint64_t ki, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, xd, z, r, r2, y, s;
+
+ xd = (double_t) x;
+ abstop = top12 (x) & 0x7ff;
+ if (__glibc_unlikely (abstop >= top12 (88.0f)))
{
- if (isinf (x))
- /* e^-inf == 0, with no error. */
- return 0;
- else
- /* Underflow */
- return TWOM100 * TWOM100;
+ /* |x| >= 88 or x is nan. */
+ if (asuint (x) == asuint (-INFINITY))
+ return 0.0f;
+ if (abstop >= top12 (INFINITY))
+ return x + x;
+ if (x > 0x1.62e42ep6f) /* x > log(0x1p128) ~= 88.72 */
+ return __math_oflowf (0);
+ if (x < -0x1.9fe368p6f) /* x < log(0x1p-150) ~= -103.97 */
+ return __math_uflowf (0);
+#if WANT_ERRNO_UFLOW
+ if (x < -0x1.9d1d9ep6f) /* x < log(0x1p-149) ~= -103.28 */
+ return __math_may_uflowf (0);
+#endif
}
- else
- /* Return x, if x is a NaN or Inf; or overflow, otherwise. */
- return TWO127*x;
+
+ /* x*N/Ln2 = k + r with r in [-1/2, 1/2] and int k. */
+ z = InvLn2N * xd;
+
+ /* Round and convert z to int, the result is in [-150*N, 128*N] and
+ ideally ties-to-even rule is used, otherwise the magnitude of r
+ can be bigger which gives larger approximation error. */
+#if TOINT_INTRINSICS
+ kd = roundtoint (z);
+ ki = converttoint (z);
+#elif TOINT_RINT
+ kd = rint (z);
+ ki = (long) kd;
+#elif TOINT_SHIFT
+# define SHIFT __exp2f_data.shift
+ kd = math_narrow_eval ((double) (z + SHIFT)); /* Needs to be double. */
+ ki = asuint64 (kd);
+ kd -= SHIFT;
+#endif
+ r = z - kd;
+
+ /* exp(x) = 2^(k/N) * 2^(r/N) ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ t += ki << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return (float) y;
}
-strong_alias (__ieee754_expf, __expf_finite)
+
+#ifndef __expf
+hidden_def (__expf)
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+libm_alias_float_other (__exp, exp)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_fmodf.c b/sysdeps/ieee754/flt-32/e_fmodf.c
index 8d8fad4eb5..1a9407b517 100644
--- a/sysdeps/ieee754/flt-32/e_fmodf.c
+++ b/sysdeps/ieee754/flt-32/e_fmodf.c
@@ -41,7 +41,7 @@ __ieee754_fmodf (float x, float y)
return (x*y)/(x*y);
if(hx<hy) return x; /* |x|<|y| return x */
if(hx==hy)
- return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
+ return Zero[(uint32_t)sx>>31]; /* |x|=|y| return x*0*/
/* determine ix = ilogb(x) */
if(hx<0x00800000) { /* subnormal x */
@@ -74,7 +74,7 @@ __ieee754_fmodf (float x, float y)
if(hz<0){hx = hx+hx;}
else {
if(hz==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ return Zero[(uint32_t)sx>>31];
hx = hz+hz;
}
}
@@ -83,7 +83,7 @@ __ieee754_fmodf (float x, float y)
/* convert back to floating value and restore the sign */
if(hx==0) /* return sign(x)*0 */
- return Zero[(u_int32_t)sx>>31];
+ return Zero[(uint32_t)sx>>31];
while(hx<0x00800000) { /* normalize x */
hx = hx+hx;
iy -= 1;
diff --git a/sysdeps/ieee754/flt-32/e_gammaf_r.c b/sysdeps/ieee754/flt-32/e_gammaf_r.c
index 19f51b0c8b..8b23add347 100644
--- a/sysdeps/ieee754/flt-32/e_gammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_gammaf_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,7 +18,9 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -91,7 +93,7 @@ gammaf_positive (float x, int *exp2_adj)
float ret = (__ieee754_powf (x_adj_mant, x_adj)
* __ieee754_exp2f (x_adj_log2 * x_adj_frac)
* __ieee754_expf (-x_adj)
- * __ieee754_sqrtf (2 * (float) M_PI / x_adj)
+ * sqrtf (2 * (float) M_PI / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logf (x_adj);
float bsum = gamma_coeff[NCOEFF - 1];
@@ -118,7 +120,7 @@ __ieee754_gammaf_r (float x, int *signgamp)
return 1.0 / x;
}
if (__builtin_expect (hx < 0, 0)
- && (u_int32_t) hx < 0xff800000 && __rintf (x) == x)
+ && (uint32_t) hx < 0xff800000 && __rintf (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/flt-32/e_hypotf.c b/sysdeps/ieee754/flt-32/e_hypotf.c
index 717b82e42f..5336876cf4 100644
--- a/sysdeps/ieee754/flt-32/e_hypotf.c
+++ b/sysdeps/ieee754/flt-32/e_hypotf.c
@@ -26,9 +26,9 @@ __ieee754_hypotf(float x, float y)
ha &= 0x7fffffff;
GET_FLOAT_WORD(hb,y);
hb &= 0x7fffffff;
- if (ha == 0x7f800000)
+ if (ha == 0x7f800000 && !issignaling (y))
return fabsf(x);
- else if (hb == 0x7f800000)
+ else if (hb == 0x7f800000 && !issignaling (x))
return fabsf(y);
else if (ha > 0x7f800000 || hb > 0x7f800000)
return fabsf(x) * fabsf(y);
@@ -40,6 +40,6 @@ __ieee754_hypotf(float x, float y)
d_x = (double) x;
d_y = (double) y;
- return (float) __ieee754_sqrt(d_x * d_x + d_y * d_y);
+ return (float) sqrt(d_x * d_x + d_y * d_y);
}
strong_alias (__ieee754_hypotf, __hypotf_finite)
diff --git a/sysdeps/ieee754/flt-32/e_j0f.c b/sysdeps/ieee754/flt-32/e_j0f.c
index bd0b80fdb0..0efc646a12 100644
--- a/sysdeps/ieee754/flt-32/e_j0f.c
+++ b/sysdeps/ieee754/flt-32/e_j0f.c
@@ -14,6 +14,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static float pzerof(float), qzerof(float);
@@ -58,10 +59,10 @@ __ieee754_j0f(float x)
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
- if(ix>0x48000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*cc)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
- z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*cc-v*ss)/sqrtf(x);
}
return z;
}
@@ -105,7 +106,7 @@ __ieee754_y0f(float x)
ix = 0x7fffffff&hx;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0, y0(0) is -inf. */
if(ix>=0x7f800000) return one/(x+x*x);
- if(ix==0) return -HUGE_VALF+x; /* -inf and overflow exception. */
+ if(ix==0) return -1/zero; /* -inf and divide by zero exception. */
if(hx<0) return zero/(zero*x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
@@ -131,10 +132,10 @@ __ieee754_y0f(float x)
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = pzerof(x); v = qzerof(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
diff --git a/sysdeps/ieee754/flt-32/e_j1f.c b/sysdeps/ieee754/flt-32/e_j1f.c
index f359a3d9ba..887b5f7d1e 100644
--- a/sysdeps/ieee754/flt-32/e_j1f.c
+++ b/sysdeps/ieee754/flt-32/e_j1f.c
@@ -16,7 +16,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static float ponef(float), qonef(float);
@@ -61,10 +63,10 @@ __ieee754_j1f(float x)
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
- if(ix>0x48000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(y);
+ if(ix>0x48000000) z = (invsqrtpi*cc)/sqrtf(y);
else {
u = ponef(y); v = qonef(y);
- z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(y);
+ z = invsqrtpi*(u*cc-v*ss)/sqrtf(y);
}
if(hx<0) return -z;
else return z;
@@ -112,7 +114,7 @@ __ieee754_y1f(float x)
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
if(__builtin_expect(ix>=0x7f800000, 0)) return one/(x+x*x);
if(__builtin_expect(ix==0, 0))
- return -HUGE_VALF+x; /* -inf and overflow exception. */
+ return -1/zero; /* -inf and divide by zero exception. */
if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
SET_RESTORE_ROUNDF (FE_TONEAREST);
@@ -135,10 +137,10 @@ __ieee754_y1f(float x)
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
- if(ix>0x48000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+ if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = ponef(x); v = qonef(x);
- z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+ z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
diff --git a/sysdeps/ieee754/flt-32/e_jnf.c b/sysdeps/ieee754/flt-32/e_jnf.c
index 4e634778d3..cd15ed7d4b 100644
--- a/sysdeps/ieee754/flt-32/e_jnf.c
+++ b/sysdeps/ieee754/flt-32/e_jnf.c
@@ -16,7 +16,9 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
two = 2.0000000000e+00, /* 0x40000000 */
@@ -186,7 +188,7 @@ __ieee754_ynf(int n, float x)
float ret;
{
int32_t i,hx,ix;
- u_int32_t ib;
+ uint32_t ib;
int32_t sign;
float a, b, temp;
@@ -194,15 +196,15 @@ __ieee754_ynf(int n, float x)
ix = 0x7fffffff&hx;
/* if Y(n,NaN) is NaN */
if(__builtin_expect(ix>0x7f800000, 0)) return x+x;
- if(__builtin_expect(ix==0, 0))
- return -HUGE_VALF+x; /* -inf and overflow exception. */
- if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
sign = 1;
if(n<0){
n = -n;
sign = 1 - ((n&1)<<1);
}
if(n==0) return(__ieee754_y0f(x));
+ if(__builtin_expect(ix==0, 0))
+ return -sign/zero;
+ if(__builtin_expect(hx<0, 0)) return zero/(zero*x);
SET_RESTORE_ROUNDF (FE_TONEAREST);
if(n==1) {
ret = sign*__ieee754_y1f(x);
diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
index 4d8a66bb39..8fdf9bb8bc 100644
--- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c
+++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c
@@ -13,9 +13,10 @@
* ====================================================
*/
-#include <libc-internal.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
static const float
two23= 8.3886080000e+06, /* 0x4b000000 */
@@ -160,7 +161,7 @@ __ieee754_lgammaf_r(float x, int *signgamp)
}
if(hx<0) {
if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */
- return x/zero;
+ return fabsf (x)/zero;
if (ix > 0x40000000 /* X < 2.0f. */
&& ix < 0x41700000 /* X > -15.0f. */)
return __lgamma_negf (x, signgamp);
diff --git a/sysdeps/ieee754/flt-32/e_log10f.c b/sysdeps/ieee754/flt-32/e_log10f.c
index 2cd01b4a50..7f1ffdad77 100644
--- a/sysdeps/ieee754/flt-32/e_log10f.c
+++ b/sysdeps/ieee754/flt-32/e_log10f.c
@@ -34,7 +34,7 @@ __ieee754_log10f(float x)
k=0;
if (hx < 0x00800000) { /* x < 2**-126 */
if (__builtin_expect((hx&0x7fffffff)==0, 0))
- return -two25/(x-x); /* log(+-0)=-inf */
+ return -two25/fabsf (x); /* log(+-0)=-inf */
if (__builtin_expect(hx<0, 0))
return (x-x)/(x-x); /* log(-#) = NaN */
k -= 25; x *= two25; /* subnormal number, scale up x */
@@ -42,7 +42,7 @@ __ieee754_log10f(float x)
}
if (__builtin_expect(hx >= 0x7f800000, 0)) return x+x;
k += (hx>>23)-127;
- i = ((u_int32_t)k&0x80000000)>>31;
+ i = ((uint32_t)k&0x80000000)>>31;
hx = (hx&0x007fffff)|((0x7f-i)<<23);
y = (float)(k+i);
if (FIX_INT_FP_CONVERT_ZERO && y == 0.0f)
diff --git a/sysdeps/ieee754/flt-32/e_log2f.c b/sysdeps/ieee754/flt-32/e_log2f.c
index 857d13fb9b..62edc59cde 100644
--- a/sysdeps/ieee754/flt-32/e_log2f.c
+++ b/sysdeps/ieee754/flt-32/e_log2f.c
@@ -1,86 +1,95 @@
-/* e_logf.c -- float version of e_log.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- * adapted for log2 by Ulrich Drepper <drepper@cygnus.com>
- */
+/* Single-precision log2 function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
-#include <fix-int-fp-convert-zero.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
+
+/*
+LOG2F_TABLE_BITS = 4
+LOG2F_POLY_ORDER = 4
-static const float
-ln2 = 0.69314718055994530942,
-two25 = 3.355443200e+07, /* 0x4c000000 */
-Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
-Lg2 = 4.0000000596e-01, /* 3ECCCCCD */
-Lg3 = 2.8571429849e-01, /* 3E924925 */
-Lg4 = 2.2222198546e-01, /* 3E638E29 */
-Lg5 = 1.8183572590e-01, /* 3E3A3325 */
-Lg6 = 1.5313838422e-01, /* 3E1CD04F */
-Lg7 = 1.4798198640e-01; /* 3E178897 */
+ULP error: 0.752 (nearest rounding.)
+Relative error: 1.9 * 2^-26 (before rounding.)
+*/
-static const float zero = 0.0;
+#define N (1 << LOG2F_TABLE_BITS)
+#define T __log2f_data.tab
+#define A __log2f_data.poly
+#define OFF 0x3f330000
float
-__ieee754_log2f(float x)
+__log2f (float x)
{
- float hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,ix,i,j;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, p, y, y0, invc, logc;
+ uint32_t ix, iz, top, tmp;
+ int k, i;
+
+ ix = asuint (x);
+#if WANT_ROUNDING
+ /* Fix sign of zero with downward rounding when x==1. */
+ if (__glibc_unlikely (ix == 0x3f800000))
+ return 0;
+#endif
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000))
+ {
+ /* x < 0x1p-126 or inf or nan. */
+ if (ix * 2 == 0)
+ return __math_divzerof (1);
+ if (ix == 0x7f800000) /* log2(inf) == inf. */
+ return x;
+ if ((ix & 0x80000000) || ix * 2 >= 0xff000000)
+ return __math_invalidf (x);
+ /* x is subnormal, normalize it. */
+ ix = asuint (x * 0x1p23f);
+ ix -= 23 << 23;
+ }
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - LOG2F_TABLE_BITS)) % N;
+ top = tmp & 0xff800000;
+ iz = ix - top;
+ k = (int32_t) tmp >> 23; /* arithmetic shift */
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
- GET_FLOAT_WORD(ix,x);
+ /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k;
- k=0;
- if (ix < 0x00800000) { /* x < 2**-126 */
- if (__builtin_expect((ix&0x7fffffff)==0, 0))
- return -two25/(x-x); /* log(+-0)=-inf */
- if (__builtin_expect(ix<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 25; x *= two25; /* subnormal number, scale up x */
- GET_FLOAT_WORD(ix,x);
- }
- if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
- k += (ix>>23)-127;
- ix &= 0x007fffff;
- i = (ix+(0x95f64<<3))&0x800000;
- SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */
- k += (i>>23);
- dk = (float)k;
- f = x-(float)1.0;
- if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */
- if(f==zero)
- {
- if (FIX_INT_FP_CONVERT_ZERO && dk == 0.0f)
- dk = 0.0f;
- return dk;
- }
- R = f*f*((float)0.5-(float)0.33333333333333333*f);
- return dk-(R-f)/ln2;
- }
- s = f/((float)2.0+f);
- z = s*s;
- i = ix-(0x6147a<<3);
- w = z*z;
- j = (0x6b851<<3)-ix;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=(float)0.5*f*f;
- return dk-((hfsq-(s*(hfsq+R)))-f)/ln2;
- } else {
- return dk-((s*(f-R))-f)/ln2;
- }
+ /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */
+ r2 = r * r;
+ y = A[1] * r + A[2];
+ y = A[0] * r2 + y;
+ p = A[3] * r + y0;
+ y = y * r2 + p;
+ return (float) y;
}
-strong_alias (__ieee754_log2f, __log2f_finite)
+#ifndef __log2f
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+libm_alias_float_other (__log2, log2)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_log2f_data.c b/sysdeps/ieee754/flt-32/e_log2f_data.c
new file mode 100644
index 0000000000..6390e9ce51
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_log2f_data.c
@@ -0,0 +1,44 @@
+/* Data definition for log2f.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_config.h"
+
+const struct log2f_data __log2f_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 },
+ { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 },
+ { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 },
+ { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 },
+ { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 },
+ { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 },
+ { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 },
+ { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 },
+ { 0x1p+0, 0x0p+0 },
+ { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 },
+ { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 },
+ { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 },
+ { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 },
+ { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 },
+ },
+ .poly = {
+ -0x1.712b6f70a7e4dp-2, 0x1.ecabf496832ep-2, -0x1.715479ffae3dep-1,
+ 0x1.715475f35c8b8p0,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c
index cf75e11781..879a673e12 100644
--- a/sysdeps/ieee754/flt-32/e_logf.c
+++ b/sysdeps/ieee754/flt-32/e_logf.c
@@ -1,85 +1,94 @@
-/* e_logf.c -- float version of e_log.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Single-precision log function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <math.h>
-#include <math_private.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
-static const float
-ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
-ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */
-two25 = 3.355443200e+07, /* 0x4c000000 */
-Lg1 = 6.6666668653e-01, /* 3F2AAAAB */
-Lg2 = 4.0000000596e-01, /* 3ECCCCCD */
-Lg3 = 2.8571429849e-01, /* 3E924925 */
-Lg4 = 2.2222198546e-01, /* 3E638E29 */
-Lg5 = 1.8183572590e-01, /* 3E3A3325 */
-Lg6 = 1.5313838422e-01, /* 3E1CD04F */
-Lg7 = 1.4798198640e-01; /* 3E178897 */
+/*
+LOGF_TABLE_BITS = 4
+LOGF_POLY_ORDER = 4
-static const float zero = 0.0;
+ULP error: 0.818 (nearest rounding.)
+Relative error: 1.957 * 2^-26 (before rounding.)
+*/
+
+#define T __logf_data.tab
+#define A __logf_data.poly
+#define Ln2 __logf_data.ln2
+#define N (1 << LOGF_TABLE_BITS)
+#define OFF 0x3f330000
float
-__ieee754_logf(float x)
+__logf (float x)
{
- float hfsq,f,s,z,R,w,t1,t2,dk;
- int32_t k,ix,i,j;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, y, y0, invc, logc;
+ uint32_t ix, iz, tmp;
+ int k, i;
+
+ ix = asuint (x);
+#if WANT_ROUNDING
+ /* Fix sign of zero with downward rounding when x==1. */
+ if (__glibc_unlikely (ix == 0x3f800000))
+ return 0;
+#endif
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000))
+ {
+ /* x < 0x1p-126 or inf or nan. */
+ if (ix * 2 == 0)
+ return __math_divzerof (1);
+ if (ix == 0x7f800000) /* log(inf) == inf. */
+ return x;
+ if ((ix & 0x80000000) || ix * 2 >= 0xff000000)
+ return __math_invalidf (x);
+ /* x is subnormal, normalize it. */
+ ix = asuint (x * 0x1p23f);
+ ix -= 23 << 23;
+ }
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - LOGF_TABLE_BITS)) % N;
+ k = (int32_t) tmp >> 23; /* arithmetic shift */
+ iz = ix - (tmp & 0x1ff << 23);
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
- GET_FLOAT_WORD(ix,x);
+ /* log(x) = log1p(z/c-1) + log(c) + k*Ln2 */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k * Ln2;
- k=0;
- if (ix < 0x00800000) { /* x < 2**-126 */
- if (__builtin_expect((ix&0x7fffffff)==0, 0))
- return -two25/zero; /* log(+-0)=-inf */
- if (__builtin_expect(ix<0, 0))
- return (x-x)/(x-x); /* log(-#) = NaN */
- k -= 25; x *= two25; /* subnormal number, scale up x */
- GET_FLOAT_WORD(ix,x);
- }
- if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x;
- k += (ix>>23)-127;
- ix &= 0x007fffff;
- i = (ix+(0x95f64<<3))&0x800000;
- SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */
- k += (i>>23);
- f = x-(float)1.0;
- if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */
- if(f==zero) {
- if(k==0) return zero; else {dk=(float)k;
- return dk*ln2_hi+dk*ln2_lo;}
- }
- R = f*f*((float)0.5-(float)0.33333333333333333*f);
- if(k==0) return f-R; else {dk=(float)k;
- return dk*ln2_hi-((R-dk*ln2_lo)-f);}
- }
- s = f/((float)2.0+f);
- dk = (float)k;
- z = s*s;
- i = ix-(0x6147a<<3);
- w = z*z;
- j = (0x6b851<<3)-ix;
- t1= w*(Lg2+w*(Lg4+w*Lg6));
- t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7)));
- i |= j;
- R = t2+t1;
- if(i>0) {
- hfsq=(float)0.5*f*f;
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
- } else {
- if(k==0) return f-s*(f-R); else
- return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
- }
+ /* Pipelined polynomial evaluation to approximate log1p(r). */
+ r2 = r * r;
+ y = A[1] * r + A[2];
+ y = A[0] * r2 + y;
+ y = y * r2 + (y0 + r);
+ return (float) y;
}
-strong_alias (__ieee754_logf, __logf_finite)
+#ifndef __logf
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+libm_alias_float_other (__log, log)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_logf_data.c b/sysdeps/ieee754/flt-32/e_logf_data.c
new file mode 100644
index 0000000000..0c71414a8a
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_logf_data.c
@@ -0,0 +1,44 @@
+/* Data definition for logf.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_config.h"
+
+const struct logf_data __logf_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2 },
+ { 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2 },
+ { 0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2 },
+ { 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3 },
+ { 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3 },
+ { 0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3 },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4 },
+ { 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4 },
+ { 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5 },
+ { 0x1p+0, 0x0p+0 },
+ { 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5 },
+ { 0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4 },
+ { 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3 },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 },
+ { 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2 },
+ { 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2 },
+ },
+ .ln2 = 0x1.62e42fefa39efp-1,
+ .poly = {
+ -0x1.00ea348b88334p-2, 0x1.5575b0be00b6ap-2, -0x1.ffffef20a4123p-2,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c
index c72fe37d3b..ece83f0dd2 100644
--- a/sysdeps/ieee754/flt-32/e_powf.c
+++ b/sysdeps/ieee754/flt-32/e_powf.c
@@ -1,258 +1,224 @@
-/* e_powf.c -- float version of e_pow.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Single-precision pow function.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#include <math.h>
-#include <math_private.h>
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-static const float huge = 1.0e+30, tiny = 1.0e-30;
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
-static const float
-bp[] = {1.0, 1.5,},
-dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */
-dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */
-zero = 0.0,
-one = 1.0,
-two = 2.0,
-two24 = 16777216.0, /* 0x4b800000 */
- /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
-L1 = 6.0000002384e-01, /* 0x3f19999a */
-L2 = 4.2857143283e-01, /* 0x3edb6db7 */
-L3 = 3.3333334327e-01, /* 0x3eaaaaab */
-L4 = 2.7272811532e-01, /* 0x3e8ba305 */
-L5 = 2.3066075146e-01, /* 0x3e6c3255 */
-L6 = 2.0697501302e-01, /* 0x3e53f142 */
-P1 = 1.6666667163e-01, /* 0x3e2aaaab */
-P2 = -2.7777778450e-03, /* 0xbb360b61 */
-P3 = 6.6137559770e-05, /* 0x388ab355 */
-P4 = -1.6533901999e-06, /* 0xb5ddea0e */
-P5 = 4.1381369442e-08, /* 0x3331bb4c */
-lg2 = 6.9314718246e-01, /* 0x3f317218 */
-lg2_h = 6.93145752e-01, /* 0x3f317200 */
-lg2_l = 1.42860654e-06, /* 0x35bfbe8c */
-ovt = 4.2995665694e-08, /* -(128-log2(ovfl+.5ulp)) */
-cp = 9.6179670095e-01, /* 0x3f76384f =2/(3ln2) */
-cp_h = 9.6179199219e-01, /* 0x3f763800 =head of cp */
-cp_l = 4.7017383622e-06, /* 0x369dc3a0 =tail of cp_h */
-ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */
-ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/
-ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
+#include <math.h>
+#include <stdint.h>
+#include <shlib-compat.h>
+#include <libm-alias-float.h>
+#include "math_config.h"
-float
-__ieee754_powf(float x, float y)
+/*
+POWF_LOG2_POLY_ORDER = 5
+EXP2F_TABLE_BITS = 5
+
+ULP error: 0.82 (~ 0.5 + relerr*2^24)
+relerr: 1.27 * 2^-26 (Relative error ~= 128*Ln2*relerr_log2 + relerr_exp2)
+relerr_log2: 1.83 * 2^-33 (Relative error of logx.)
+relerr_exp2: 1.69 * 2^-34 (Relative error of exp2(ylogx).)
+*/
+
+#define N (1 << POWF_LOG2_TABLE_BITS)
+#define T __powf_log2_data.tab
+#define A __powf_log2_data.poly
+#define OFF 0x3f330000
+
+/* Subnormal input is normalized so ix has negative biased exponent.
+ Output is multiplied by N (POWF_SCALE) if TOINT_INTRINICS is set. */
+static inline double_t
+log2_inline (uint32_t ix)
{
- float z,ax,z_h,z_l,p_h,p_l;
- float y1,t1,t2,r,s,t,u,v,w;
- int32_t i,j,k,yisint,n;
- int32_t hx,hy,ix,iy,is;
-
- GET_FLOAT_WORD(hx,x);
- GET_FLOAT_WORD(hy,y);
- ix = hx&0x7fffffff; iy = hy&0x7fffffff;
-
- /* y==zero: x**0 = 1 */
- if(iy==0) return one;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t z, r, r2, r4, p, q, y, y0, invc, logc;
+ uint32_t iz, top, tmp;
+ int k, i;
+
+ /* x = 2^k z; where z is in range [OFF,2*OFF] and exact.
+ The range is split into N subintervals.
+ The ith subinterval contains z and c is near its center. */
+ tmp = ix - OFF;
+ i = (tmp >> (23 - POWF_LOG2_TABLE_BITS)) % N;
+ top = tmp & 0xff800000;
+ iz = ix - top;
+ k = (int32_t) top >> (23 - POWF_SCALE_BITS); /* arithmetic shift */
+ invc = T[i].invc;
+ logc = T[i].logc;
+ z = (double_t) asfloat (iz);
+
+ /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */
+ r = z * invc - 1;
+ y0 = logc + (double_t) k;
+
+ /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */
+ r2 = r * r;
+ y = A[0] * r + A[1];
+ p = A[2] * r + A[3];
+ r4 = r2 * r2;
+ q = A[4] * r + y0;
+ q = p * r2 + q;
+ y = y * r4 + q;
+ return y;
+}
- /* x==+-1 */
- if(x == 1.0) return one;
- if(x == -1.0 && isinf(y)) return one;
+#undef N
+#undef T
+#define N (1 << EXP2F_TABLE_BITS)
+#define T __exp2f_data.tab
+#define SIGN_BIAS (1 << (EXP2F_TABLE_BITS + 11))
+
+/* The output of log2 and thus the input of exp2 is either scaled by N
+ (in case of fast toint intrinsics) or not. The unscaled xd must be
+ in [-1021,1023], sign_bias sets the sign of the result. */
+static inline double_t
+exp2_inline (double_t xd, uint32_t sign_bias)
+{
+ uint64_t ki, ski, t;
+ /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
+ double_t kd, z, r, r2, y, s;
+
+#if TOINT_INTRINSICS
+# define C __exp2f_data.poly_scaled
+ /* N*x = k + r with r in [-1/2, 1/2] */
+ kd = roundtoint (xd); /* k */
+ ki = converttoint (xd);
+#else
+# define C __exp2f_data.poly
+# define SHIFT __exp2f_data.shift_scaled
+ /* x = k/N + r with r in [-1/(2N), 1/(2N)] */
+ kd = (double) (xd + SHIFT); /* Rounding to double precision is required. */
+ ki = asuint64 (kd);
+ kd -= SHIFT; /* k/N */
+#endif
+ r = xd - kd;
+
+ /* exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */
+ t = T[ki % N];
+ ski = ki + sign_bias;
+ t += ski << (52 - EXP2F_TABLE_BITS);
+ s = asdouble (t);
+ z = C[0] * r + C[1];
+ r2 = r * r;
+ y = C[2] * r + 1;
+ y = z * r2 + y;
+ y = y * s;
+ return y;
+}
- /* +-NaN return x+y */
- if(__builtin_expect(ix > 0x7f800000 ||
- iy > 0x7f800000, 0))
- return x+y;
+/* Returns 0 if not int, 1 if odd int, 2 if even int. */
+static inline int
+checkint (uint32_t iy)
+{
+ int e = iy >> 23 & 0xff;
+ if (e < 0x7f)
+ return 0;
+ if (e > 0x7f + 23)
+ return 2;
+ if (iy & ((1 << (0x7f + 23 - e)) - 1))
+ return 0;
+ if (iy & (1 << (0x7f + 23 - e)))
+ return 1;
+ return 2;
+}
- /* determine if y is an odd int when x < 0
- * yisint = 0 ... y is not an integer
- * yisint = 1 ... y is an odd int
- * yisint = 2 ... y is an even int
- */
- yisint = 0;
- if(hx<0) {
- if(iy>=0x4b800000) yisint = 2; /* even integer y */
- else if(iy>=0x3f800000) {
- k = (iy>>23)-0x7f; /* exponent */
- j = iy>>(23-k);
- if((j<<(23-k))==iy) yisint = 2-(j&1);
- }
- }
+static inline int
+zeroinfnan (uint32_t ix)
+{
+ return 2 * ix - 1 >= 2u * 0x7f800000 - 1;
+}
- /* special value of y */
- if (__builtin_expect(iy==0x7f800000, 0)) { /* y is +-inf */
- if (ix==0x3f800000)
- return y - y; /* inf**+-1 is NaN */
- else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */
- return (hy>=0)? y: zero;
- else /* (|x|<1)**-,+inf = inf,0 */
- return (hy<0)?-y: zero;
- }
- if(iy==0x3f800000) { /* y is +-1 */
- if(hy<0) return one/x; else return x;
- }
- if(hy==0x40000000) return x*x; /* y is 2 */
- if(hy==0x3f000000) { /* y is 0.5 */
- if(__builtin_expect(hx>=0, 1)) /* x >= +0 */
- return __ieee754_sqrtf(x);
+float
+__powf (float x, float y)
+{
+ uint32_t sign_bias = 0;
+ uint32_t ix, iy;
+
+ ix = asuint (x);
+ iy = asuint (y);
+ if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000
+ || zeroinfnan (iy)))
+ {
+ /* Either (x < 0x1p-126 or inf or nan) or (y is 0 or inf or nan). */
+ if (__glibc_unlikely (zeroinfnan (iy)))
+ {
+ if (2 * iy == 0)
+ return issignalingf_inline (x) ? x + y : 1.0f;
+ if (ix == 0x3f800000)
+ return issignalingf_inline (y) ? x + y : 1.0f;
+ if (2 * ix > 2u * 0x7f800000 || 2 * iy > 2u * 0x7f800000)
+ return x + y;
+ if (2 * ix == 2 * 0x3f800000)
+ return 1.0f;
+ if ((2 * ix < 2 * 0x3f800000) == !(iy & 0x80000000))
+ return 0.0f; /* |x|<1 && y==inf or |x|>1 && y==-inf. */
+ return y * y;
}
-
- ax = fabsf(x);
- /* special value of x */
- if(__builtin_expect(ix==0x7f800000||ix==0||ix==0x3f800000, 0)){
- z = ax; /*x is +-0,+-inf,+-1*/
- if(hy<0) z = one/z; /* z = (1/|x|) */
- if(hx<0) {
- if(((ix-0x3f800000)|yisint)==0) {
- z = (z-z)/(z-z); /* (-1)**non-int is NaN */
- } else if(yisint==1)
- z = -z; /* (x<0)**odd = -(|x|**odd) */
+ if (__glibc_unlikely (zeroinfnan (ix)))
+ {
+ float_t x2 = x * x;
+ if (ix & 0x80000000 && checkint (iy) == 1)
+ {
+ x2 = -x2;
+ sign_bias = 1;
}
- return z;
- }
-
- /* (x<0)**(non-int) is NaN */
- if(__builtin_expect(((((u_int32_t)hx>>31)-1)|yisint)==0, 0))
- return (x-x)/(x-x);
-
- /* |y| is huge */
- if(__builtin_expect(iy>0x4d000000, 0)) { /* if |y| > 2**27 */
- /* over/underflow if x is not close to one */
- if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny;
- if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny;
- /* now |1-x| is tiny <= 2**-20, suffice to compute
- log(x) by x-x^2/2+x^3/3-x^4/4 */
- t = ax-1; /* t has 20 trailing zeros */
- w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25));
- u = ivln2_h*t; /* ivln2_h has 16 sig. bits */
- v = t*ivln2_l-w*ivln2;
- t1 = u+v;
- GET_FLOAT_WORD(is,t1);
- SET_FLOAT_WORD(t1,is&0xfffff000);
- t2 = v-(t1-u);
- } else {
- float s2,s_h,s_l,t_h,t_l;
- /* Avoid internal underflow for tiny y. The exact value
- of y does not matter if |y| <= 2**-32. */
- if (iy < 0x2f800000)
- SET_FLOAT_WORD (y, (hy & 0x80000000) | 0x2f800000);
- n = 0;
- /* take care subnormal number */
- if(ix<0x00800000)
- {ax *= two24; n -= 24; GET_FLOAT_WORD(ix,ax); }
- n += ((ix)>>23)-0x7f;
- j = ix&0x007fffff;
- /* determine interval */
- ix = j|0x3f800000; /* normalize ix */
- if(j<=0x1cc471) k=0; /* |x|<sqrt(3/2) */
- else if(j<0x5db3d7) k=1; /* |x|<sqrt(3) */
- else {k=0;n+=1;ix -= 0x00800000;}
- SET_FLOAT_WORD(ax,ix);
-
- /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
- u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
- v = one/(ax+bp[k]);
- s = u*v;
- s_h = s;
- GET_FLOAT_WORD(is,s_h);
- SET_FLOAT_WORD(s_h,is&0xfffff000);
- /* t_h=ax+bp[k] High */
- SET_FLOAT_WORD (t_h,
- ((((ix>>1)|0x20000000)+0x00400000+(k<<21))
- & 0xfffff000));
- t_l = ax - (t_h-bp[k]);
- s_l = v*((u-s_h*t_h)-s_h*t_l);
- /* compute log(ax) */
- s2 = s*s;
- r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
- r += s_l*(s_h+s);
- s2 = s_h*s_h;
- t_h = (float)3.0+s2+r;
- GET_FLOAT_WORD(is,t_h);
- SET_FLOAT_WORD(t_h,is&0xfffff000);
- t_l = r-((t_h-(float)3.0)-s2);
- /* u+v = s*(1+...) */
- u = s_h*t_h;
- v = s_l*t_h+t_l*s;
- /* 2/(3log2)*(s+...) */
- p_h = u+v;
- GET_FLOAT_WORD(is,p_h);
- SET_FLOAT_WORD(p_h,is&0xfffff000);
- p_l = v-(p_h-u);
- z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */
- z_l = cp_l*p_h+p_l*cp+dp_l[k];
- /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (float)n;
- t1 = (((z_h+z_l)+dp_h[k])+t);
- GET_FLOAT_WORD(is,t1);
- SET_FLOAT_WORD(t1,is&0xfffff000);
- t2 = z_l-(((t1-t)-dp_h[k])-z_h);
- }
-
- s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
- if(((((u_int32_t)hx>>31)-1)|(yisint-1))==0)
- s = -one; /* (-ve)**(odd int) */
-
- /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
- GET_FLOAT_WORD(is,y);
- SET_FLOAT_WORD(y1,is&0xfffff000);
- p_l = (y-y1)*t1+y*t2;
- p_h = y1*t1;
- z = p_l+p_h;
- GET_FLOAT_WORD(j,z);
- if (__builtin_expect(j>0x43000000, 0)) /* if z > 128 */
- return s*huge*huge; /* overflow */
- else if (__builtin_expect(j==0x43000000, 0)) { /* if z == 128 */
- if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
+#if WANT_ERRNO
+ if (2 * ix == 0 && iy & 0x80000000)
+ return __math_divzerof (sign_bias);
+#endif
+ return iy & 0x80000000 ? 1 / x2 : x2;
}
- else if (__builtin_expect((j&0x7fffffff)>0x43160000, 0))/* z <= -150 */
- return s*tiny*tiny; /* underflow */
- else if (__builtin_expect((u_int32_t) j==0xc3160000, 0)){/* z == -150*/
- if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
+ /* x and y are non-zero finite. */
+ if (ix & 0x80000000)
+ {
+ /* Finite x < 0. */
+ int yint = checkint (iy);
+ if (yint == 0)
+ return __math_invalidf (x);
+ if (yint == 1)
+ sign_bias = SIGN_BIAS;
+ ix &= 0x7fffffff;
}
- /*
- * compute 2**(p_h+p_l)
- */
- i = j&0x7fffffff;
- k = (i>>23)-0x7f;
- n = 0;
- if(i>0x3f000000) { /* if |z| > 0.5, set n = [z+0.5] */
- n = j+(0x00800000>>(k+1));
- k = ((n&0x7fffffff)>>23)-0x7f; /* new k for n */
- SET_FLOAT_WORD(t,n&~(0x007fffff>>k));
- n = ((n&0x007fffff)|0x00800000)>>(23-k);
- if(j<0) n = -n;
- p_h -= t;
+ if (ix < 0x00800000)
+ {
+ /* Normalize subnormal x so exponent becomes negative. */
+ ix = asuint (x * 0x1p23f);
+ ix &= 0x7fffffff;
+ ix -= 23 << 23;
}
- t = p_l+p_h;
- GET_FLOAT_WORD(is,t);
- SET_FLOAT_WORD(t,is&0xfffff000);
- u = t*lg2_h;
- v = (p_l-(t-p_h))*lg2+t*lg2_l;
- z = u+v;
- w = v-(z-u);
- t = z*z;
- t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
- r = (z*t1)/(t1-two)-(w+z*w);
- z = one-(r-z);
- GET_FLOAT_WORD(j,z);
- j += (n<<23);
- if((j>>23)<=0) /* subnormal output */
- {
- z = __scalbnf (z, n);
- float force_underflow = z * z;
- math_force_eval (force_underflow);
- }
- else SET_FLOAT_WORD(z,j);
- return s*z;
+ }
+ double_t logx = log2_inline (ix);
+ double_t ylogx = y * logx; /* Note: cannot overflow, y is single prec. */
+ if (__glibc_unlikely ((asuint64 (ylogx) >> 47 & 0xffff)
+ >= asuint64 (126.0 * POWF_SCALE) >> 47))
+ {
+ /* |y*log(x)| >= 126. */
+ if (ylogx > 0x1.fffffffd1d571p+6 * POWF_SCALE)
+ return __math_oflowf (sign_bias);
+ if (ylogx <= -150.0 * POWF_SCALE)
+ return __math_uflowf (sign_bias);
+#if WANT_ERRNO_UFLOW
+ if (ylogx < -149.0 * POWF_SCALE)
+ return __math_may_uflowf (sign_bias);
+#endif
+ }
+ return (float) exp2_inline (ylogx, sign_bias);
}
-strong_alias (__ieee754_powf, __powf_finite)
+#ifndef __powf
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+libm_alias_float_other (__pow, pow)
+#endif
diff --git a/sysdeps/ieee754/flt-32/e_powf_log2_data.c b/sysdeps/ieee754/flt-32/e_powf_log2_data.c
new file mode 100644
index 0000000000..27cd6b7a81
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/e_powf_log2_data.c
@@ -0,0 +1,45 @@
+/* Data definition for powf.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_config.h"
+
+const struct powf_log2_data __powf_log2_data = {
+ .tab = {
+ { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 * POWF_SCALE },
+ { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 * POWF_SCALE },
+ { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 * POWF_SCALE },
+ { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 * POWF_SCALE },
+ { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 * POWF_SCALE },
+ { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 * POWF_SCALE },
+ { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 * POWF_SCALE },
+ { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 * POWF_SCALE },
+ { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 * POWF_SCALE },
+ { 0x1p+0, 0x0p+0 * POWF_SCALE },
+ { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 * POWF_SCALE },
+ { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 * POWF_SCALE },
+ { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 * POWF_SCALE },
+ { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 * POWF_SCALE },
+ { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 * POWF_SCALE },
+ { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 * POWF_SCALE },
+ },
+ .poly = {
+ 0x1.27616c9496e0bp-2 * POWF_SCALE, -0x1.71969a075c67ap-2 * POWF_SCALE,
+ 0x1.ec70a6ca7baddp-2 * POWF_SCALE, -0x1.7154748bef6c8p-1 * POWF_SCALE,
+ 0x1.71547652ab82bp0 * POWF_SCALE,
+ }
+};
diff --git a/sysdeps/ieee754/flt-32/e_rem_pio2f.c b/sysdeps/ieee754/flt-32/e_rem_pio2f.c
index 0928373498..bd871a26c2 100644
--- a/sysdeps/ieee754/flt-32/e_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/e_rem_pio2f.c
@@ -100,7 +100,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */
if(hx>0) {
z = x - pio2_1;
- if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
+ if((ix&0xffffffc0)!=0x3fc90fc0) { /* 24+24 bit pi OK */
y[0] = z - pio2_1t;
y[1] = (z-y[0])-pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
@@ -111,7 +111,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
return 1;
} else { /* negative x */
z = x + pio2_1;
- if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
+ if((ix&0xffffffc0)!=0x3fc90fc0) { /* 24+24 bit pi OK */
y[0] = z + pio2_1t;
y[1] = (z-y[0])+pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
@@ -131,7 +131,7 @@ int32_t __ieee754_rem_pio2f(float x, float *y)
if(n<32&&(int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) {
y[0] = r-w; /* quick check no cancellation */
} else {
- u_int32_t high;
+ uint32_t high;
j = ix>>23;
y[0] = r-w;
GET_FLOAT_WORD(high,y[0]);
diff --git a/sysdeps/ieee754/flt-32/e_remainderf.c b/sysdeps/ieee754/flt-32/e_remainderf.c
index cc0167862e..8e78784e0f 100644
--- a/sysdeps/ieee754/flt-32/e_remainderf.c
+++ b/sysdeps/ieee754/flt-32/e_remainderf.c
@@ -23,7 +23,7 @@ float
__ieee754_remainderf(float x, float p)
{
int32_t hx,hp;
- u_int32_t sx;
+ uint32_t sx;
float p_half;
GET_FLOAT_WORD(hx,x);
diff --git a/sysdeps/ieee754/flt-32/e_sinhf.c b/sysdeps/ieee754/flt-32/e_sinhf.c
index 6100d95c55..20f7db81ea 100644
--- a/sysdeps/ieee754/flt-32/e_sinhf.c
+++ b/sysdeps/ieee754/flt-32/e_sinhf.c
@@ -15,7 +15,9 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float one = 1.0, shuge = 1.0e37;
diff --git a/sysdeps/ieee754/flt-32/e_sqrtf.c b/sysdeps/ieee754/flt-32/e_sqrtf.c
index c02206ac01..6025da19cf 100644
--- a/sysdeps/ieee754/flt-32/e_sqrtf.c
+++ b/sysdeps/ieee754/flt-32/e_sqrtf.c
@@ -24,7 +24,7 @@ __ieee754_sqrtf(float x)
float z;
int32_t sign = (int)0x80000000;
int32_t ix,s,q,m,t,i;
- u_int32_t r;
+ uint32_t r;
GET_FLOAT_WORD(ix,x);
diff --git a/sysdeps/ieee754/flt-32/k_rem_pio2f.c b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
index 392afdbb6c..ea4915b765 100644
--- a/sysdeps/ieee754/flt-32/k_rem_pio2f.c
+++ b/sysdeps/ieee754/flt-32/k_rem_pio2f.c
@@ -18,7 +18,9 @@ static char rcsid[] = "$NetBSD: k_rem_pio2f.c,v 1.4 1995/05/10 20:46:28 jtc Exp
#endif
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libc-diag.h>
/* In the float version, the input parameter x contains 8 bit
integers, not 24 bit integers. 113 bit precision is not supported. */
@@ -122,7 +124,16 @@ recompute:
j = 0;
for (i=jz-1;i>=jk;i--) j |= iq[i];
if(j==0) { /* need recomputation */
+ /* On s390x gcc 6.1 -O3 produces the warning "array subscript is
+ below array bounds [-Werror=array-bounds]". Only
+ __ieee754_rem_pio2f calls __kernel_rem_pio2f for normal
+ numbers and |x| ~> 2^7*(pi/2). Thus x can't be zero and
+ ipio2 is not zero, too. Thus not all iq[] values can't be
+ zero. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (6.1, "-Warray-bounds");
for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */
+ DIAG_POP_NEEDS_COMMENT;
for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */
f[jx+i] = (float) ipio2[jv+i];
@@ -172,7 +183,17 @@ recompute:
float fv = 0.0;
for (i=jz;i>=0;i--) fv = math_narrow_eval (fv + fq[i]);
y[0] = (ih==0)? fv: -fv;
+ /* GCC mainline (to be GCC 9), as of 2018-05-22 on
+ i686, warns that fq[0] may be used uninitialized.
+ This is not possible because jz is always
+ nonnegative when the above loop initializing fq is
+ executed, because the result is never zero to full
+ precision (this function is not called for zero
+ arguments). */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized");
fv = math_narrow_eval (fq[0]-fv);
+ DIAG_POP_NEEDS_COMMENT;
for (i=1;i<=jz;i++) fv = math_narrow_eval (fv + fq[i]);
y[1] = (ih==0)? fv: -fv;
break;
diff --git a/sysdeps/ieee754/flt-32/k_sinf.c b/sysdeps/ieee754/flt-32/k_sinf.c
index a195d59466..dcf3c35358 100644
--- a/sysdeps/ieee754/flt-32/k_sinf.c
+++ b/sysdeps/ieee754/flt-32/k_sinf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: k_sinf.c,v 1.4 1995/05/10 20:46:33 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
half = 5.0000000000e-01,/* 0x3f000000 */
diff --git a/sysdeps/ieee754/flt-32/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c
index 9f0e55860f..228ece2075 100644
--- a/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/sysdeps/ieee754/flt-32/k_tanf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: k_tanf.c,v 1.4 1995/05/10 20:46:39 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const float
one = 1.0000000000e+00, /* 0x3f800000 */
pio4 = 7.8539812565e-01, /* 0x3f490fda */
diff --git a/sysdeps/ieee754/flt-32/lgamma_negf.c b/sysdeps/ieee754/flt-32/lgamma_negf.c
index f15719b059..01edb0b8de 100644
--- a/sysdeps/ieee754/flt-32/lgamma_negf.c
+++ b/sysdeps/ieee754/flt-32/lgamma_negf.c
@@ -1,5 +1,5 @@
/* lgammaf expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
static const float lgamma_zeros[][2] =
diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h
new file mode 100644
index 0000000000..9c4ef30173
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/math_config.h
@@ -0,0 +1,164 @@
+/* Configuration for math routines.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_CONFIG_H
+#define _MATH_CONFIG_H
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#ifndef WANT_ROUNDING
+/* Correct special case results in non-nearest rounding modes. */
+# define WANT_ROUNDING 1
+#endif
+#ifndef WANT_ERRNO
+/* Set errno according to ISO C with (math_errhandling & MATH_ERRNO) != 0. */
+# define WANT_ERRNO 1
+#endif
+#ifndef WANT_ERRNO_UFLOW
+/* Set errno to ERANGE if result underflows to 0 (in all rounding modes). */
+# define WANT_ERRNO_UFLOW (WANT_ROUNDING && WANT_ERRNO)
+#endif
+
+#ifndef TOINT_INTRINSICS
+# define TOINT_INTRINSICS 0
+#endif
+#ifndef TOINT_RINT
+# define TOINT_RINT 0
+#endif
+#ifndef TOINT_SHIFT
+# define TOINT_SHIFT 1
+#endif
+
+static inline uint32_t
+asuint (float f)
+{
+ union
+ {
+ float f;
+ uint32_t i;
+ } u = {f};
+ return u.i;
+}
+
+static inline float
+asfloat (uint32_t i)
+{
+ union
+ {
+ uint32_t i;
+ float f;
+ } u = {i};
+ return u.f;
+}
+
+static inline uint64_t
+asuint64 (double f)
+{
+ union
+ {
+ double f;
+ uint64_t i;
+ } u = {f};
+ return u.i;
+}
+
+static inline double
+asdouble (uint64_t i)
+{
+ union
+ {
+ uint64_t i;
+ double f;
+ } u = {i};
+ return u.f;
+}
+
+static inline int
+issignalingf_inline (float x)
+{
+ uint32_t ix = asuint (x);
+ if (HIGH_ORDER_BIT_IS_SET_FOR_SNAN)
+ return (ix & 0x7fc00000) == 0x7fc00000;
+ return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000;
+}
+
+#define NOINLINE __attribute__ ((noinline))
+
+attribute_hidden float __math_oflowf (uint32_t);
+attribute_hidden float __math_uflowf (uint32_t);
+attribute_hidden float __math_may_uflowf (uint32_t);
+attribute_hidden float __math_divzerof (uint32_t);
+attribute_hidden float __math_invalidf (float);
+
+/* Shared between expf, exp2f and powf. */
+#define EXP2F_TABLE_BITS 5
+#define EXP2F_POLY_ORDER 3
+extern const struct exp2f_data
+{
+ uint64_t tab[1 << EXP2F_TABLE_BITS];
+ double shift_scaled;
+ double poly[EXP2F_POLY_ORDER];
+ double shift;
+ double invln2_scaled;
+ double poly_scaled[EXP2F_POLY_ORDER];
+} __exp2f_data attribute_hidden;
+
+#define LOGF_TABLE_BITS 4
+#define LOGF_POLY_ORDER 4
+extern const struct logf_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << LOGF_TABLE_BITS];
+ double ln2;
+ double poly[LOGF_POLY_ORDER - 1]; /* First order coefficient is 1. */
+} __logf_data attribute_hidden;
+
+#define LOG2F_TABLE_BITS 4
+#define LOG2F_POLY_ORDER 4
+extern const struct log2f_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << LOG2F_TABLE_BITS];
+ double poly[LOG2F_POLY_ORDER];
+} __log2f_data attribute_hidden;
+
+#define POWF_LOG2_TABLE_BITS 4
+#define POWF_LOG2_POLY_ORDER 5
+#if TOINT_INTRINSICS
+# define POWF_SCALE_BITS EXP2F_TABLE_BITS
+#else
+# define POWF_SCALE_BITS 0
+#endif
+#define POWF_SCALE ((double) (1 << POWF_SCALE_BITS))
+extern const struct powf_log2_data
+{
+ struct
+ {
+ double invc, logc;
+ } tab[1 << POWF_LOG2_TABLE_BITS];
+ double poly[POWF_LOG2_POLY_ORDER];
+} __powf_log2_data attribute_hidden;
+
+#endif
diff --git a/sysdeps/ieee754/flt-32/math_errf.c b/sysdeps/ieee754/flt-32/math_errf.c
new file mode 100644
index 0000000000..5bc7ac6ef5
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/math_errf.c
@@ -0,0 +1,76 @@
+/* Single-precision math error handling.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "math_config.h"
+
+#if WANT_ERRNO
+# include <errno.h>
+/* NOINLINE reduces code size. */
+NOINLINE static float
+with_errnof (float y, int e)
+{
+ errno = e;
+ return y;
+}
+#else
+# define with_errnof(x, e) (x)
+#endif
+
+/* NOINLINE prevents fenv semantics breaking optimizations. */
+NOINLINE static float
+xflowf (uint32_t sign, float y)
+{
+ y = (sign ? -y : y) * y;
+ return with_errnof (y, ERANGE);
+}
+
+attribute_hidden float
+__math_uflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1p-95f);
+}
+
+#if WANT_ERRNO_UFLOW
+/* Underflows to zero in some non-nearest rounding mode, setting errno
+ is valid even if the result is non-zero, but in the subnormal range. */
+attribute_hidden float
+__math_may_uflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1.4p-75f);
+}
+#endif
+
+attribute_hidden float
+__math_oflowf (uint32_t sign)
+{
+ return xflowf (sign, 0x1p97f);
+}
+
+attribute_hidden float
+__math_divzerof (uint32_t sign)
+{
+ float y = 0;
+ return with_errnof ((sign ? -1 : 1) / y, ERANGE);
+}
+
+attribute_hidden float
+__math_invalidf (float x)
+{
+ float y = (x - x) / (x - x);
+ return isnan (x) ? y : with_errnof (y, EDOM);
+}
diff --git a/sysdeps/ieee754/flt-32/mpn2flt.c b/sysdeps/ieee754/flt-32/mpn2flt.c
index 7f40f56d33..accca55fde 100644
--- a/sysdeps/ieee754/flt-32/mpn2flt.c
+++ b/sysdeps/ieee754/flt-32/mpn2flt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/flt-32/s_asinhf.c b/sysdeps/ieee754/flt-32/s_asinhf.c
index da9cafb600..0812b54dca 100644
--- a/sysdeps/ieee754/flt-32/s_asinhf.c
+++ b/sysdeps/ieee754/flt-32/s_asinhf.c
@@ -16,6 +16,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float
one = 1.0000000000e+00, /* 0x3F800000 */
@@ -39,12 +41,12 @@ __asinhf(float x)
} else {
float xa = fabsf(x);
if (ix>0x40000000) { /* 2**14 > |x| > 2.0 */
- w = __ieee754_logf(2.0f*xa+one/(__ieee754_sqrtf(xa*xa+one)+xa));
+ w = __ieee754_logf(2.0f*xa+one/(sqrtf(xa*xa+one)+xa));
} else { /* 2.0 > |x| > 2**-14 */
float t = xa*xa;
- w =__log1pf(xa+t/(one+__ieee754_sqrtf(one+t)));
+ w =__log1pf(xa+t/(one+sqrtf(one+t)));
}
}
return __copysignf(w, x);
}
-weak_alias (__asinhf, asinhf)
+libm_alias_float (__asinh, asinh)
diff --git a/sysdeps/ieee754/flt-32/s_atanf.c b/sysdeps/ieee754/flt-32/s_atanf.c
index e322a1d41f..f61b0f5ef6 100644
--- a/sysdeps/ieee754/flt-32/s_atanf.c
+++ b/sysdeps/ieee754/flt-32/s_atanf.c
@@ -20,6 +20,8 @@ static char rcsid[] = "$NetBSD: s_atanf.c,v 1.4 1995/05/10 20:46:47 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float atanhi[] = {
4.6364760399e-01, /* atan(0.5)hi 0x3eed6338 */
@@ -98,4 +100,4 @@ float __atanf(float x)
return (hx<0)? -z:z;
}
}
-weak_alias (__atanf, atanf)
+libm_alias_float (__atan, atan)
diff --git a/sysdeps/ieee754/flt-32/s_cbrtf.c b/sysdeps/ieee754/flt-32/s_cbrtf.c
index b9e2b3738c..afa1454399 100644
--- a/sysdeps/ieee754/flt-32/s_cbrtf.c
+++ b/sysdeps/ieee754/flt-32/s_cbrtf.c
@@ -1,5 +1,5 @@
/* Compute cubic root of float value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -60,4 +61,4 @@ __cbrtf (float x)
return __ldexpf (x > 0.0 ? ym : -ym, xe / 3);
}
-weak_alias (__cbrtf, cbrtf)
+libm_alias_float (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/flt-32/s_ceilf.c b/sysdeps/ieee754/flt-32/s_ceilf.c
index 37659ea2ae..f289ec2341 100644
--- a/sysdeps/ieee754/flt-32/s_ceilf.c
+++ b/sysdeps/ieee754/flt-32/s_ceilf.c
@@ -15,27 +15,25 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
-static const float huge = 1.0e30;
-
float
__ceilf(float x)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0<0) {i0=0x80000000;}
else if(i0!=0) { i0=0x3f800000;}
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0>0) i0 += (0x00800000)>>j0;
i0 &= (~i);
}
@@ -47,5 +45,5 @@ __ceilf(float x)
return x;
}
#ifndef __ceilf
-weak_alias (__ceilf, ceilf)
+libm_alias_float (__ceil, ceil)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_copysignf.c b/sysdeps/ieee754/flt-32/s_copysignf.c
index 1621836065..3c4ac7ce68 100644
--- a/sysdeps/ieee754/flt-32/s_copysignf.c
+++ b/sysdeps/ieee754/flt-32/s_copysignf.c
@@ -25,13 +25,14 @@ static char rcsid[] = "$NetBSD: s_copysignf.c,v 1.4 1995/05/10 20:46:59 jtc Exp
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float __copysignf(float x, float y)
{
- u_int32_t ix,iy;
+ uint32_t ix,iy;
GET_FLOAT_WORD(ix,x);
GET_FLOAT_WORD(iy,y);
SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000));
return x;
}
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
diff --git a/sysdeps/ieee754/flt-32/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c
index 0affd406bb..061264d259 100644
--- a/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/sysdeps/ieee754/flt-32/s_cosf.c
@@ -1,25 +1,26 @@
-/* s_cosf.c -- float version of s_cos.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Compute cosine of argument.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef COSF
# define COSF_FUNC __cosf
@@ -27,37 +28,123 @@ static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
# define COSF_FUNC COSF
#endif
-float COSF_FUNC(float x)
+float
+COSF_FUNC (float x)
{
- float y[2],z=0.0;
- int32_t n,ix;
-
- GET_FLOAT_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3f490fd8) return __kernel_cosf(x,z);
-
- /* cos(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) {
- if (ix == 0x7f800000)
- __set_errno (EDOM);
- return x-x;
+ double theta = x;
+ double abstheta = fabs (theta);
+ if (isless (abstheta, M_PI_4))
+ {
+ double cx;
+ if (abstheta >= 0x1p-5)
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for cos:
+ * 1 + x^2 (C0 + x^2 (C1 + x^2 (C2 + x^2 (C3 + x^2 * C4)))). */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1. + theta2 * cx;
+ return cx;
}
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2f(x,y);
- switch(n&3) {
- case 0: return __kernel_cosf(y[0],y[1]);
- case 1: return -__kernel_sinf(y[0],y[1],1);
- case 2: return -__kernel_cosf(y[0],y[1]);
- default:
- return __kernel_sinf(y[0],y[1],1);
+ else if (abstheta >= 0x1p-27)
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ * 1 + x^2 (CC0 + x^3 * CC1). */
+ const double theta2 = theta * theta;
+ cx = CC0 + theta * theta2 * CC1;
+ cx = 1.0 + theta2 * cx;
+ return cx;
+ }
+ else
+ {
+ /* For small enough |theta|, this is close enough. */
+ return 1.0 - abstheta;
+ }
+ }
+ else /* |theta| >= Pi/4. */
+ {
+ if (isless (abstheta, 9 * M_PI_4))
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ return reduced_cos (theta, n);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23)
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ return reduced_cos (theta, n);
}
+ else /* |theta| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent = (exponent >> FLOAT_EXPONENT_SHIFT)
+ - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ return reduced_cos (e, l + 1);
+ }
+ }
+ }
+ }
+ else
+ {
+ int32_t ix;
+ GET_FLOAT_WORD (ix, abstheta);
+ /* cos(Inf or NaN) is NaN. */
+ if (ix == 0x7f800000) /* Inf. */
+ __set_errno (EDOM);
+ return x - x;
}
+ }
}
#ifndef COSF
-weak_alias (__cosf, cosf)
+libm_alias_float (__cos, cos)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_erff.c b/sysdeps/ieee754/flt-32/s_erff.c
index c8b6287503..693934d59a 100644
--- a/sysdeps/ieee754/flt-32/s_erff.c
+++ b/sysdeps/ieee754/flt-32/s_erff.c
@@ -20,7 +20,10 @@ static char rcsid[] = "$NetBSD: s_erff.c,v 1.4 1995/05/10 20:47:07 jtc Exp $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
#include <fix-int-fp-convert-zero.h>
static const float
@@ -104,7 +107,7 @@ float __erff(float x)
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7f800000) { /* erf(nan)=nan */
- i = ((u_int32_t)hx>>31)<<1;
+ i = ((uint32_t)hx>>31)<<1;
return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */
}
@@ -152,7 +155,7 @@ float __erff(float x)
r = __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S);
if(hx>=0) return one-r/x; else return r/x-one;
}
-weak_alias (__erff, erff)
+libm_alias_float (__erf, erf)
float __erfcf(float x)
{
@@ -162,7 +165,7 @@ float __erfcf(float x)
ix = hx&0x7fffffff;
if(ix>=0x7f800000) { /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
- float ret = (float)(((u_int32_t)hx>>31)<<1)+one/x;
+ float ret = (float)(((uint32_t)hx>>31)<<1)+one/x;
if (FIX_INT_FP_CONVERT_ZERO && ret == 0.0f)
return 0.0f;
return ret;
@@ -227,4 +230,4 @@ float __erfcf(float x)
return two-tiny;
}
}
-weak_alias (__erfcf, erfcf)
+libm_alias_float (__erfc, erfc)
diff --git a/sysdeps/ieee754/flt-32/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c
index c515d25e28..b72cc0d083 100644
--- a/sysdeps/ieee754/flt-32/s_expm1f.c
+++ b/sysdeps/ieee754/flt-32/s_expm1f.c
@@ -16,7 +16,10 @@
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float huge = 1.0e+30;
static const float tiny = 1.0e-30;
@@ -39,7 +42,7 @@ __expm1f(float x)
{
float y,hi,lo,c,t,e,hxs,hfx,r1;
int32_t k,xsb;
- u_int32_t hx;
+ uint32_t hx;
GET_FLOAT_WORD(hx,x);
xsb = hx&0x80000000; /* sign bit of x */
@@ -127,4 +130,4 @@ __expm1f(float x)
}
return y;
}
-weak_alias (__expm1f, expm1f)
+libm_alias_float (__expm1, expm1)
diff --git a/sysdeps/ieee754/flt-32/s_fabsf.c b/sysdeps/ieee754/flt-32/s_fabsf.c
index 297abe64bd..d3f6eb830b 100644
--- a/sysdeps/ieee754/flt-32/s_fabsf.c
+++ b/sysdeps/ieee754/flt-32/s_fabsf.c
@@ -22,9 +22,10 @@ static char rcsid[] = "$NetBSD: s_fabsf.c,v 1.4 1995/05/10 20:47:15 jtc Exp $";
*/
#include <math.h>
+#include <libm-alias-float.h>
float __fabsf(float x)
{
return __builtin_fabsf (x);
}
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
diff --git a/sysdeps/ieee754/flt-32/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c
index 4c5b339235..b9ae048559 100644
--- a/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/sysdeps/ieee754/flt-32/s_finitef.c
@@ -35,7 +35,7 @@ int FINITEF(float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
- return (int)((u_int32_t)((ix&0x7f800000)-0x7f800000)>>31);
+ return (int)((uint32_t)((ix&0x7f800000)-0x7f800000)>>31);
}
hidden_def (__finitef)
weak_alias (__finitef, finitef)
diff --git a/sysdeps/ieee754/flt-32/s_floorf.c b/sysdeps/ieee754/flt-32/s_floorf.c
index 99d6c01833..12aed343a0 100644
--- a/sysdeps/ieee754/flt-32/s_floorf.c
+++ b/sysdeps/ieee754/flt-32/s_floorf.c
@@ -18,32 +18,28 @@
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floorf(x).
*/
#include <math.h>
#include <math_private.h>
-
-static const float huge = 1.0e30;
+#include <libm-alias-float.h>
float
__floorf(float x)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
- if(j0<0) { /* raise inexact if x != 0 */
- math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=0;}
else if((i0&0x7fffffff)!=0)
{ i0=0xbf800000;}
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
- math_force_eval(huge+x); /* raise inexact flag */
if(i0<0) i0 += (0x00800000)>>j0;
i0 &= (~i);
}
@@ -55,5 +51,5 @@ __floorf(float x)
return x;
}
#ifndef __floorf
-weak_alias (__floorf, floorf)
+libm_alias_float (__floor, floor)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_fpclassifyf.c b/sysdeps/ieee754/flt-32/s_fpclassifyf.c
index 480557e2ae..01df9f26f5 100644
--- a/sysdeps/ieee754/flt-32/s_fpclassifyf.c
+++ b/sysdeps/ieee754/flt-32/s_fpclassifyf.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +25,7 @@
int
__fpclassifyf (float x)
{
- u_int32_t wx;
+ uint32_t wx;
int retval = FP_NORMAL;
GET_FLOAT_WORD (wx, x);
diff --git a/sysdeps/ieee754/flt-32/s_frexpf.c b/sysdeps/ieee754/flt-32/s_frexpf.c
index 67a28d3603..b7403bf0d8 100644
--- a/sysdeps/ieee754/flt-32/s_frexpf.c
+++ b/sysdeps/ieee754/flt-32/s_frexpf.c
@@ -19,6 +19,7 @@ static char rcsid[] = "$NetBSD: s_frexpf.c,v 1.5 1995/05/10 20:47:26 jtc Exp $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
two25 = 3.3554432000e+07; /* 0x4c000000 */
@@ -29,7 +30,7 @@ float __frexpf(float x, int *eptr)
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
*eptr = 0;
- if(ix>=0x7f800000||(ix==0)) return x; /* 0,inf,nan */
+ if(ix>=0x7f800000||(ix==0)) return x + x; /* 0,inf,nan */
if (ix<0x00800000) { /* subnormal */
x *= two25;
GET_FLOAT_WORD(hx,x);
@@ -41,4 +42,4 @@ float __frexpf(float x, int *eptr)
SET_FLOAT_WORD(x,hx);
return x;
}
-weak_alias (__frexpf, frexpf)
+libm_alias_float (__frexp, frexp)
diff --git a/sysdeps/ieee754/flt-32/s_fromfpf.c b/sysdeps/ieee754/flt-32/s_fromfpf.c
new file mode 100644
index 0000000000..d0c83b8f5d
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpf
+#include <s_fromfpf_main.c>
+libm_alias_float (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/flt-32/s_fromfpf_main.c b/sysdeps/ieee754/flt-32/s_fromfpf_main.c
new file mode 100644
index 0000000000..b220b7212c
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpf_main.c
@@ -0,0 +1,83 @@
+/* Round to integer type. flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x7f
+#define MANT_DIG 24
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (float x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, x);
+ bool negative = (ix & 0x80000000) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ ix &= 0x7fffffff;
+ if (ix == 0)
+ return 0;
+ int exponent = ix >> (MANT_DIG - 1);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ ix &= ((1U << (MANT_DIG - 1)) - 1);
+ ix |= 1U << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ uret <<= exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint32_t h = 1U << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/flt-32/s_fromfpxf.c b/sysdeps/ieee754/flt-32/s_fromfpxf.c
new file mode 100644
index 0000000000..01d9247c31
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_fromfpxf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxf
+#include <s_fromfpf_main.c>
+libm_alias_float (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/flt-32/s_getpayloadf.c b/sysdeps/ieee754/flt-32/s_getpayloadf.c
new file mode 100644
index 0000000000..98a16f9347
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_getpayloadf.c
@@ -0,0 +1,35 @@
+/* Get NaN payload. flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <stdint.h>
+
+float
+__getpayloadf (const float *x)
+{
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, *x);
+ ix &= 0x3fffff;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0f;
+ return (float) ix;
+}
+libm_alias_float (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/flt-32/s_isnanf.c b/sysdeps/ieee754/flt-32/s_isnanf.c
index 820b31a2b4..52129735fe 100644
--- a/sysdeps/ieee754/flt-32/s_isnanf.c
+++ b/sysdeps/ieee754/flt-32/s_isnanf.c
@@ -32,7 +32,7 @@ int __isnanf(float x)
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
ix = 0x7f800000 - ix;
- return (int)(((u_int32_t)(ix))>>31);
+ return (int)(((uint32_t)(ix))>>31);
}
hidden_def (__isnanf)
weak_alias (__isnanf, isnanf)
diff --git a/sysdeps/ieee754/flt-32/s_issignalingf.c b/sysdeps/ieee754/flt-32/s_issignalingf.c
index 2409ff408c..a18ba3e586 100644
--- a/sysdeps/ieee754/flt-32/s_issignalingf.c
+++ b/sysdeps/ieee754/flt-32/s_issignalingf.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingf (float x)
{
- u_int32_t xi;
+ uint32_t xi;
GET_FLOAT_WORD (xi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/flt-32/s_llrintf.c b/sysdeps/ieee754/flt-32/s_llrintf.c
index 56415d34f8..7c64bb2db4 100644
--- a/sysdeps/ieee754/flt-32/s_llrintf.c
+++ b/sysdeps/ieee754/flt-32/s_llrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
static const float two23[2] =
@@ -36,7 +38,7 @@ long long int
__llrintf (float x)
{
int32_t j0;
- u_int32_t i0;
+ uint32_t i0;
float w;
float t;
long long int result;
@@ -83,4 +85,4 @@ __llrintf (float x)
return sx ? -result : result;
}
-weak_alias (__llrintf, llrintf)
+libm_alias_float (__llrint, llrint)
diff --git a/sysdeps/ieee754/flt-32/s_llroundf.c b/sysdeps/ieee754/flt-32/s_llroundf.c
index 1d35f71321..5457f9fa88 100644
--- a/sysdeps/ieee754/flt-32/s_llroundf.c
+++ b/sysdeps/ieee754/flt-32/s_llroundf.c
@@ -1,5 +1,5 @@
/* Round float value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long long int
__llroundf (float x)
{
int32_t j0;
- u_int32_t i;
+ uint32_t i;
long long int result;
int sign;
@@ -70,4 +71,4 @@ __llroundf (float x)
return sign * result;
}
-weak_alias (__llroundf, llroundf)
+libm_alias_float (__llround, llround)
diff --git a/sysdeps/ieee754/flt-32/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c
index ade60a2e27..a06190a589 100644
--- a/sysdeps/ieee754/flt-32/s_log1pf.c
+++ b/sysdeps/ieee754/flt-32/s_log1pf.c
@@ -15,7 +15,10 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
static const float
ln2_hi = 6.9313812256e-01, /* 0x3f317180 */
@@ -97,6 +100,18 @@ __log1pf(float x)
s = f/((float)2.0+f);
z = s*s;
R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
- if(k==0) return f-(hfsq-s*(hfsq+R)); else
- return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
+ if (k == 0)
+ return f - (hfsq - s * (hfsq + R));
+ else
+ {
+ /* With GCC 7 when compiling with -Os the compiler warns
+ that c might be used uninitialized. This can't be true
+ because k must be 0 for c to be uninitialized and we
+ handled that computation earlier without using c. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
+ return k * ln2_hi - ((hfsq - (s * (hfsq + R)
+ + (k * ln2_lo + c))) - f);
+ DIAG_POP_NEEDS_COMMENT;
+ }
}
diff --git a/sysdeps/ieee754/flt-32/s_logbf.c b/sysdeps/ieee754/flt-32/s_logbf.c
index 9ae20e332a..e0d4f3fbab 100644
--- a/sysdeps/ieee754/flt-32/s_logbf.c
+++ b/sysdeps/ieee754/flt-32/s_logbf.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-int-fp-convert-zero.h>
float
@@ -38,4 +39,4 @@ __logbf (float x)
return 0.0f;
return (float) (rix - 127);
}
-weak_alias (__logbf, logbf)
+libm_alias_float (__logb, logb)
diff --git a/sysdeps/ieee754/flt-32/s_lrintf.c b/sysdeps/ieee754/flt-32/s_lrintf.c
index 3b480a2107..5171377a4e 100644
--- a/sysdeps/ieee754/flt-32/s_lrintf.c
+++ b/sysdeps/ieee754/flt-32/s_lrintf.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,9 @@
#include <limits.h>
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
static const float two23[2] =
@@ -36,7 +38,7 @@ long int
__lrintf (float x)
{
int32_t j0;
- u_int32_t i0;
+ uint32_t i0;
float w;
float t;
long int result;
@@ -83,4 +85,4 @@ __lrintf (float x)
return sx ? -result : result;
}
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)
diff --git a/sysdeps/ieee754/flt-32/s_lroundf.c b/sysdeps/ieee754/flt-32/s_lroundf.c
index 116c9e0627..20e7216640 100644
--- a/sysdeps/ieee754/flt-32/s_lroundf.c
+++ b/sysdeps/ieee754/flt-32/s_lroundf.c
@@ -1,5 +1,5 @@
/* Round float value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,6 +22,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <fix-fp-int-convert-overflow.h>
@@ -29,7 +30,7 @@ long int
__lroundf (float x)
{
int32_t j0;
- u_int32_t i;
+ uint32_t i;
long int result;
int sign;
@@ -70,4 +71,4 @@ __lroundf (float x)
return sign * result;
}
-weak_alias (__lroundf, lroundf)
+libm_alias_float (__lround, lround)
diff --git a/sysdeps/ieee754/flt-32/s_modff.c b/sysdeps/ieee754/flt-32/s_modff.c
index 23f6a902b3..45a94594fe 100644
--- a/sysdeps/ieee754/flt-32/s_modff.c
+++ b/sysdeps/ieee754/flt-32/s_modff.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float one = 1.0;
@@ -22,7 +23,7 @@ float
__modff(float x, float *iptr)
{
int32_t i0,j0;
- u_int32_t i;
+ uint32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f; /* exponent of x */
if(__builtin_expect(j0<23, 1)) { /* integer part in x */
@@ -32,7 +33,7 @@ __modff(float x, float *iptr)
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) { /* x is integral */
- u_int32_t ix;
+ uint32_t ix;
*iptr = x;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
@@ -51,4 +52,4 @@ __modff(float x, float *iptr)
return x;
}
}
-weak_alias (__modff, modff)
+libm_alias_float (__modf, modf)
diff --git a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
index 5aebefafcf..4dfe491f27 100644
--- a/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -17,7 +17,9 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
TWO23[2]={
@@ -37,7 +39,7 @@ __nearbyintf(float x)
if(j0<23) {
if(j0<0) {
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
@@ -50,10 +52,10 @@ __nearbyintf(float x)
else return x; /* x is integral */
}
libc_feholdexceptf (&env);
- w = TWO23[sx]+x;
+ w = TWO23[sx] + math_opt_barrier (x);
t = w-TWO23[sx];
math_force_eval (t);
libc_fesetenvf (&env);
return t;
}
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/flt-32/s_nextafterf.c b/sysdeps/ieee754/flt-32/s_nextafterf.c
index 625d54b768..aa49df5a9e 100644
--- a/sysdeps/ieee754/flt-32/s_nextafterf.c
+++ b/sysdeps/ieee754/flt-32/s_nextafterf.c
@@ -19,7 +19,9 @@ static char rcsid[] = "$NetBSD: s_nextafterf.c,v 1.4 1995/05/10 20:48:01 jtc Exp
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-float.h>
#include <float.h>
float __nextafterf(float x, float y)
@@ -70,4 +72,4 @@ float __nextafterf(float x, float y)
SET_FLOAT_WORD(x,hx);
return x;
}
-weak_alias (__nextafterf, nextafterf)
+libm_alias_float (__nextafter, nextafter)
diff --git a/sysdeps/ieee754/flt-32/s_nextupf.c b/sysdeps/ieee754/flt-32/s_nextupf.c
new file mode 100644
index 0000000000..87ec7ba21f
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_nextupf.c
@@ -0,0 +1,48 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+
+/* Return the least floating-point number greater than X. */
+float
+__nextupf (float x)
+{
+ int32_t hx, ix;
+
+ GET_FLOAT_WORD (hx, x);
+ ix = hx & 0x7fffffff;
+ if (ix == 0)
+ return FLT_TRUE_MIN;
+ if (ix > 0x7f800000) /* x is nan. */
+ return x + x;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ hx += 1;
+ }
+ else
+ hx -= 1;
+ SET_FLOAT_WORD (x, hx);
+ return x;
+}
+
+libm_alias_float (__nextup, nextup)
diff --git a/sysdeps/ieee754/flt-32/s_remquof.c b/sysdeps/ieee754/flt-32/s_remquof.c
index ecf831deaf..66704d46c2 100644
--- a/sysdeps/ieee754/flt-32/s_remquof.c
+++ b/sysdeps/ieee754/flt-32/s_remquof.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,14 @@
static const float zero = 0.0;
+#include <libm-alias-float.h>
float
__remquof (float x, float y, int *quo)
{
int32_t hx,hy;
- u_int32_t sx;
+ uint32_t sx;
int cquo, qs;
GET_FLOAT_WORD (hx, x);
@@ -107,4 +108,4 @@ __remquof (float x, float y, int *quo)
x = -x;
return x;
}
-weak_alias (__remquof, remquof)
+libm_alias_float (__remquo, remquo)
diff --git a/sysdeps/ieee754/flt-32/s_rintf.c b/sysdeps/ieee754/flt-32/s_rintf.c
index 8a907488f7..db6f260a0b 100644
--- a/sysdeps/ieee754/flt-32/s_rintf.c
+++ b/sysdeps/ieee754/flt-32/s_rintf.c
@@ -15,6 +15,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
static const float
TWO23[2]={
@@ -46,5 +47,5 @@ __rintf(float x)
return w-TWO23[sx];
}
#ifndef __rintf
-weak_alias (__rintf, rintf)
+libm_alias_float (__rint, rint)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_roundevenf.c b/sysdeps/ieee754/flt-32/s_roundevenf.c
new file mode 100644
index 0000000000..90f991d5c4
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_roundevenf.c
@@ -0,0 +1,70 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <stdint.h>
+
+#define BIAS 0x7f
+#define MANT_DIG 24
+#define MAX_EXP (2 * BIAS + 1)
+
+float
+__roundevenf (float x)
+{
+ uint32_t ix, ux;
+ GET_FLOAT_WORD (ix, x);
+ ux = ix & 0x7fffffff;
+ int exponent = ux >> (MANT_DIG - 1);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer. Locate the bits with
+ exponents 0 and -1 (when the unbiased exponent is 0, the bit
+ with exponent 0 is implicit, but as the bias is odd it is OK
+ to take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((ix & (int_bit | (half_bit - 1))) != 0)
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ ix += half_bit;
+ ix &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS - 1 && ux > 0x3f000000)
+ /* Interval (0.5, 1). */
+ ix = (ix & 0x80000000) | 0x3f800000;
+ else
+ /* Rounds to 0. */
+ ix &= 0x80000000;
+ SET_FLOAT_WORD (x, ix);
+ return x;
+}
+libm_alias_float (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/flt-32/s_roundf.c b/sysdeps/ieee754/flt-32/s_roundf.c
index a75d98f384..7c95125d9c 100644
--- a/sysdeps/ieee754/flt-32/s_roundf.c
+++ b/sysdeps/ieee754/flt-32/s_roundf.c
@@ -1,5 +1,5 @@
/* Round float to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,9 +20,7 @@
#include <math.h>
#include <math_private.h>
-
-
-static const float huge = 1.0e30;
+#include <libm-alias-float.h>
float
@@ -36,21 +34,17 @@ __roundf (float x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
-
i0 &= 0x80000000;
if (j0 == -1)
i0 |= 0x3f800000;
}
else
{
- u_int32_t i = 0x007fffff >> j0;
+ uint32_t i = 0x007fffff >> j0;
if ((i0 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
i0 += 0x00400000 >> j0;
i0 &= ~i;
}
@@ -67,4 +61,4 @@ __roundf (float x)
SET_FLOAT_WORD (x, i0);
return x;
}
-weak_alias (__roundf, roundf)
+libm_alias_float (__round, round)
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadf.c b/sysdeps/ieee754/flt-32/s_setpayloadf.c
new file mode 100644
index 0000000000..6faf26bdcc
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadf.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadf
+#include <s_setpayloadf_main.c>
+libm_alias_float (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadf_main.c b/sysdeps/ieee754/flt-32/s_setpayloadf_main.c
new file mode 100644
index 0000000000..a01c8677a3
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadf_main.c
@@ -0,0 +1,54 @@
+/* Set NaN payload. flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x7f
+#define PAYLOAD_DIG 22
+#define EXPLICIT_MANT_DIG 23
+
+int
+FUNC (float *x, float payload)
+{
+ uint32_t ix;
+ GET_FLOAT_WORD (ix, payload);
+ int exponent = ix >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && ix == 0))
+ || (ix & ((1U << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ SET_FLOAT_WORD (*x, 0);
+ return 1;
+ }
+ if (ix != 0)
+ {
+ ix &= (1U << EXPLICIT_MANT_DIG) - 1;
+ ix |= 1U << EXPLICIT_MANT_DIG;
+ ix >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ ix |= 0x7f800000 | (SET_HIGH_BIT ? 0x400000 : 0);
+ SET_FLOAT_WORD (*x, ix);
+ return 0;
+}
diff --git a/sysdeps/ieee754/flt-32/s_setpayloadsigf.c b/sysdeps/ieee754/flt-32/s_setpayloadsigf.c
new file mode 100644
index 0000000000..f08c877dc6
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_setpayloadsigf.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigf
+#include <s_setpayloadf_main.c>
+libm_alias_float (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/flt-32/s_signbitf.c b/sysdeps/ieee754/flt-32/s_signbitf.c
index 3cdde778d5..e97c6261d2 100644
--- a/sysdeps/ieee754/flt-32/s_signbitf.c
+++ b/sysdeps/ieee754/flt-32/s_signbitf.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/flt-32/s_sincosf.c b/sysdeps/ieee754/flt-32/s_sincosf.c
index e0737b5ce4..d4a5a1b22c 100644
--- a/sysdeps/ieee754/flt-32/s_sincosf.c
+++ b/sysdeps/ieee754/flt-32/s_sincosf.c
@@ -1,7 +1,6 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -19,8 +18,9 @@
#include <errno.h>
#include <math.h>
-
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef SINCOSF
# define SINCOSF_FUNC __sincosf
@@ -31,54 +31,141 @@
void
SINCOSF_FUNC (float x, float *sinx, float *cosx)
{
- int32_t ix;
-
- /* High word of x. */
- GET_FLOAT_WORD (ix, x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if (ix <= 0x3f490fd8)
- {
- *sinx = __kernel_sinf (x, 0.0, 0);
- *cosx = __kernel_cosf (x, 0.0);
- }
- else if (ix>=0x7f800000)
+ double cx;
+ double theta = x;
+ double abstheta = fabs (theta);
+ /* If |x|< Pi/4. */
+ if (isless (abstheta, M_PI_4))
{
- /* sin(Inf or NaN) is NaN */
- *sinx = *cosx = x - x;
- if (ix == 0x7f800000)
- __set_errno (EDOM);
+ if (abstheta >= 0x1p-5) /* |x| >= 2^-5. */
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for sin and cos. */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1.0 + theta2 * cx;
+ *cosx = cx;
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ *sinx = cx;
+ }
+ else if (abstheta >= 0x1p-27) /* |x| >= 2^-27. */
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ for sin: x+x^3*(SS0+x^2*SS1)
+ for cos: 1.0+x^2*(CC0+x^3*CC1). */
+ const double theta2 = theta * theta;
+ cx = CC0 + theta * theta2 * CC1;
+ cx = 1.0 + theta2 * cx;
+ *cosx = cx;
+ cx = SS0 + theta2 * SS1;
+ cx = theta + theta * theta2 * cx;
+ *sinx = cx;
+ }
+ else
+ {
+ /* Handle some special cases. */
+ if (theta)
+ *sinx = theta - (theta * SMALL);
+ else
+ *sinx = theta;
+ *cosx = 1.0 - abstheta;
+ }
}
- else
+ else /* |x| >= Pi/4. */
{
- /* Argument reduction needed. */
- float y[2];
- int n;
-
- n = __ieee754_rem_pio2f (x, y);
- switch (n & 3)
+ unsigned int signbit = isless (x, 0);
+ if (isless (abstheta, 9 * M_PI_4)) /* |x| < 9*Pi/4. */
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ *sinx = reduced_sin (theta, n, signbit);
+ *cosx = reduced_cos (theta, n);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23) /* |x| < 2^23. */
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ *sinx = reduced_sin (theta, n, signbit);
+ *cosx = reduced_cos (theta, n);
+ }
+ else /* |x| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent
+ = (exponent >> FLOAT_EXPONENT_SHIFT) - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ *sinx = reduced_sin (e, l + 1, signbit);
+ *cosx = reduced_cos (e, l + 1);
+ }
+ }
+ }
+ }
+ else
{
- case 0:
- *sinx = __kernel_sinf (y[0], y[1], 1);
- *cosx = __kernel_cosf (y[0], y[1]);
- break;
- case 1:
- *sinx = __kernel_cosf (y[0], y[1]);
- *cosx = -__kernel_sinf (y[0], y[1], 1);
- break;
- case 2:
- *sinx = -__kernel_sinf (y[0], y[1], 1);
- *cosx = -__kernel_cosf (y[0], y[1]);
- break;
- default:
- *sinx = -__kernel_cosf (y[0], y[1]);
- *cosx = __kernel_sinf (y[0], y[1], 1);
- break;
+ int32_t ix;
+ /* High word of x. */
+ GET_FLOAT_WORD (ix, abstheta);
+ /* sin/cos(Inf or NaN) is NaN. */
+ *sinx = *cosx = x - x;
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
}
}
}
#ifndef SINCOSF
-weak_alias (__sincosf, sincosf)
+libm_alias_float (__sincos, sincos)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_sincosf.h b/sysdeps/ieee754/flt-32/s_sincosf.h
new file mode 100644
index 0000000000..35b5eee536
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_sincosf.h
@@ -0,0 +1,155 @@
+/* Used by sinf, cosf and sincosf functions.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Chebyshev constants for cos, range -PI/4 - PI/4. */
+static const double C0 = -0x1.ffffffffe98aep-2;
+static const double C1 = 0x1.55555545c50c7p-5;
+static const double C2 = -0x1.6c16b348b6874p-10;
+static const double C3 = 0x1.a00eb9ac43ccp-16;
+static const double C4 = -0x1.23c97dd8844d7p-22;
+
+/* Chebyshev constants for sin, range -PI/4 - PI/4. */
+static const double S0 = -0x1.5555555551cd9p-3;
+static const double S1 = 0x1.1111110c2688bp-7;
+static const double S2 = -0x1.a019f8b4bd1f9p-13;
+static const double S3 = 0x1.71d7264e6b5b4p-19;
+static const double S4 = -0x1.a947e1674b58ap-26;
+
+/* Chebyshev constants for sin, range 2^-27 - 2^-5. */
+static const double SS0 = -0x1.555555543d49dp-3;
+static const double SS1 = 0x1.110f475cec8c5p-7;
+
+/* Chebyshev constants for cos, range 2^-27 - 2^-5. */
+static const double CC0 = -0x1.fffffff5cc6fdp-2;
+static const double CC1 = 0x1.55514b178dac5p-5;
+
+/* PI/2 with 98 bits of accuracy. */
+static const double PI_2_hi = 0x1.921fb544p+0;
+static const double PI_2_lo = 0x1.0b4611a626332p-34;
+
+static const double SMALL = 0x1p-50; /* 2^-50. */
+static const double inv_PI_4 = 0x1.45f306dc9c883p+0; /* 4/PI. */
+
+#define FLOAT_EXPONENT_SHIFT 23
+#define FLOAT_EXPONENT_BIAS 127
+
+static const double pio2_table[] = {
+ 0 * M_PI_2,
+ 1 * M_PI_2,
+ 2 * M_PI_2,
+ 3 * M_PI_2,
+ 4 * M_PI_2,
+ 5 * M_PI_2
+};
+
+static const double invpio4_table[] = {
+ 0x0p+0,
+ 0x1.45f306cp+0,
+ 0x1.c9c882ap-28,
+ 0x1.4fe13a8p-58,
+ 0x1.f47d4dp-85,
+ 0x1.bb81b6cp-112,
+ 0x1.4acc9ep-142,
+ 0x1.0e4107cp-169
+};
+
+static const double ones[] = { 1.0, -1.0 };
+
+/* Compute the sine value using Chebyshev polynomials where
+ THETA is the range reduced absolute value of the input
+ and it is less than Pi/4,
+ N is calculated as trunc(|x|/(Pi/4)) + 1 and it is used to decide
+ whether a sine or cosine approximation is more accurate and
+ SIGNBIT is used to add the correct sign after the Chebyshev
+ polynomial is computed. */
+static inline float
+reduced_sin (const double theta, const unsigned int n,
+ const unsigned int signbit)
+{
+ double sx;
+ const double theta2 = theta * theta;
+ /* We are operating on |x|, so we need to add back the original
+ signbit for sinf. */
+ double sign;
+ /* Determine positive or negative primary interval. */
+ sign = ones[((n >> 2) & 1) ^ signbit];
+ /* Are we in the primary interval of sin or cos? */
+ if ((n & 2) == 0)
+ {
+ /* Here sinf() is calculated using sin Chebyshev polynomial:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ sx = S3 + theta2 * S4; /* S3+x^2*S4. */
+ sx = S2 + theta2 * sx; /* S2+x^2*(S3+x^2*S4). */
+ sx = S1 + theta2 * sx; /* S1+x^2*(S2+x^2*(S3+x^2*S4)). */
+ sx = S0 + theta2 * sx; /* S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4))). */
+ sx = theta + theta * theta2 * sx;
+ }
+ else
+ {
+ /* Here sinf() is calculated using cos Chebyshev polynomial:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+ sx = C3 + theta2 * C4; /* C3+x^2*C4. */
+ sx = C2 + theta2 * sx; /* C2+x^2*(C3+x^2*C4). */
+ sx = C1 + theta2 * sx; /* C1+x^2*(C2+x^2*(C3+x^2*C4)). */
+ sx = C0 + theta2 * sx; /* C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4))). */
+ sx = 1.0 + theta2 * sx;
+ }
+
+ /* Add in the signbit and assign the result. */
+ return sign * sx;
+}
+
+/* Compute the cosine value using Chebyshev polynomials where
+ THETA is the range reduced absolute value of the input
+ and it is less than Pi/4,
+ N is calculated as trunc(|x|/(Pi/4)) + 1 and it is used to decide
+ whether a sine or cosine approximation is more accurate and
+ the sign of the result. */
+static inline float
+reduced_cos (double theta, unsigned int n)
+{
+ double sign, cx;
+ const double theta2 = theta * theta;
+
+ /* Determine positive or negative primary interval. */
+ n += 2;
+ sign = ones[(n >> 2) & 1];
+
+ /* Are we in the primary interval of sin or cos? */
+ if ((n & 2) == 0)
+ {
+ /* Here cosf() is calculated using sin Chebyshev polynomial:
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ }
+ else
+ {
+ /* Here cosf() is calculated using cos Chebyshev polynomial:
+ 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))). */
+ cx = C3 + theta2 * C4;
+ cx = C2 + theta2 * cx;
+ cx = C1 + theta2 * cx;
+ cx = C0 + theta2 * cx;
+ cx = 1. + theta2 * cx;
+ }
+ return sign * cx;
+}
diff --git a/sysdeps/ieee754/flt-32/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c
index 916e345571..138e318dcc 100644
--- a/sysdeps/ieee754/flt-32/s_sinf.c
+++ b/sysdeps/ieee754/flt-32/s_sinf.c
@@ -1,25 +1,26 @@
-/* s_sinf.c -- float version of s_sin.c.
- * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
- */
+/* Compute sine of argument.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
-#endif
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
+#include "s_sincosf.h"
#ifndef SINF
# define SINF_FUNC __sinf
@@ -27,37 +28,129 @@ static char rcsid[] = "$NetBSD: s_sinf.c,v 1.4 1995/05/10 20:48:16 jtc Exp $";
# define SINF_FUNC SINF
#endif
-float SINF_FUNC(float x)
+float
+SINF_FUNC (float x)
{
- float y[2],z=0.0;
- int32_t n, ix;
-
- GET_FLOAT_WORD(ix,x);
-
- /* |x| ~< pi/4 */
- ix &= 0x7fffffff;
- if(ix <= 0x3f490fd8) return __kernel_sinf(x,z,0);
-
- /* sin(Inf or NaN) is NaN */
- else if (ix>=0x7f800000) {
- if (ix == 0x7f800000)
- __set_errno (EDOM);
- return x-x;
+ double cx;
+ double theta = x;
+ double abstheta = fabs (theta);
+ /* If |x|< Pi/4. */
+ if (isless (abstheta, M_PI_4))
+ {
+ if (abstheta >= 0x1p-5) /* |x| >= 2^-5. */
+ {
+ const double theta2 = theta * theta;
+ /* Chebyshev polynomial of the form for sin
+ x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))). */
+ cx = S3 + theta2 * S4;
+ cx = S2 + theta2 * cx;
+ cx = S1 + theta2 * cx;
+ cx = S0 + theta2 * cx;
+ cx = theta + theta * theta2 * cx;
+ return cx;
}
-
- /* argument reduction needed */
- else {
- n = __ieee754_rem_pio2f(x,y);
- switch(n&3) {
- case 0: return __kernel_sinf(y[0],y[1],1);
- case 1: return __kernel_cosf(y[0],y[1]);
- case 2: return -__kernel_sinf(y[0],y[1],1);
- default:
- return -__kernel_cosf(y[0],y[1]);
+ else if (abstheta >= 0x1p-27) /* |x| >= 2^-27. */
+ {
+ /* A simpler Chebyshev approximation is close enough for this range:
+ for sin: x+x^3*(SS0+x^2*SS1). */
+ const double theta2 = theta * theta;
+ cx = SS0 + theta2 * SS1;
+ cx = theta + theta * theta2 * cx;
+ return cx;
+ }
+ else
+ {
+ /* Handle some special cases. */
+ if (theta)
+ return theta - (theta * SMALL);
+ else
+ return theta;
+ }
+ }
+ else /* |x| >= Pi/4. */
+ {
+ unsigned int signbit = isless (x, 0);
+ if (isless (abstheta, 9 * M_PI_4)) /* |x| < 9*Pi/4. */
+ {
+ /* There are cases where FE_UPWARD rounding mode can
+ produce a result of abstheta * inv_PI_4 == 9,
+ where abstheta < 9pi/4, so the domain for
+ pio2_table must go to 5 (9 / 2 + 1). */
+ unsigned int n = (abstheta * inv_PI_4) + 1;
+ theta = abstheta - pio2_table[n / 2];
+ return reduced_sin (theta, n, signbit);
+ }
+ else if (isless (abstheta, INFINITY))
+ {
+ if (abstheta < 0x1p+23) /* |x| < 2^23. */
+ {
+ unsigned int n = ((unsigned int) (abstheta * inv_PI_4)) + 1;
+ double x = n / 2;
+ theta = (abstheta - x * PI_2_hi) - x * PI_2_lo;
+ /* Argument reduction needed. */
+ return reduced_sin (theta, n, signbit);
+ }
+ else /* |x| >= 2^23. */
+ {
+ x = fabsf (x);
+ int exponent;
+ GET_FLOAT_WORD (exponent, x);
+ exponent
+ = (exponent >> FLOAT_EXPONENT_SHIFT) - FLOAT_EXPONENT_BIAS;
+ exponent += 3;
+ exponent /= 28;
+ double a = invpio4_table[exponent] * x;
+ double b = invpio4_table[exponent + 1] * x;
+ double c = invpio4_table[exponent + 2] * x;
+ double d = invpio4_table[exponent + 3] * x;
+ uint64_t l = a;
+ l &= ~0x7;
+ a -= l;
+ double e = a + b;
+ l = e;
+ e = a - l;
+ if (l & 1)
+ {
+ e -= 1.0;
+ e += b;
+ e += c;
+ e += d;
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ else
+ {
+ e += b;
+ e += c;
+ e += d;
+ if (e <= 1.0)
+ {
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ else
+ {
+ l++;
+ e -= 2.0;
+ e *= M_PI_4;
+ return reduced_sin (e, l + 1, signbit);
+ }
+ }
}
}
+ else
+ {
+ int32_t ix;
+ /* High word of x. */
+ GET_FLOAT_WORD (ix, abstheta);
+ /* Sin(Inf or NaN) is NaN. */
+ if (ix == 0x7f800000)
+ __set_errno (EDOM);
+ return x - x;
+ }
+ }
}
#ifndef SINF
-weak_alias (__sinf, sinf)
+libm_alias_float (__sin, sin)
#endif
diff --git a/sysdeps/ieee754/flt-32/s_tanf.c b/sysdeps/ieee754/flt-32/s_tanf.c
index 685df8fa35..ba3af54913 100644
--- a/sysdeps/ieee754/flt-32/s_tanf.c
+++ b/sysdeps/ieee754/flt-32/s_tanf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: s_tanf.c,v 1.4 1995/05/10 20:48:20 jtc Exp $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float __tanf(float x)
{
@@ -46,4 +47,4 @@ float __tanf(float x)
-1 -- n odd */
}
}
-weak_alias (__tanf, tanf)
+libm_alias_float (__tan, tan)
diff --git a/sysdeps/ieee754/flt-32/s_tanhf.c b/sysdeps/ieee754/flt-32/s_tanhf.c
index f70702b29c..cc3d63d35d 100644
--- a/sysdeps/ieee754/flt-32/s_tanhf.c
+++ b/sysdeps/ieee754/flt-32/s_tanhf.c
@@ -20,6 +20,8 @@ static char rcsid[] = "$NetBSD: s_tanhf.c,v 1.4 1995/05/10 20:48:24 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-float.h>
static const float one=1.0, two=2.0, tiny = 1.0e-30;
@@ -59,4 +61,4 @@ float __tanhf(float x)
}
return (jx>=0)? z: -z;
}
-weak_alias (__tanhf, tanhf)
+libm_alias_float (__tanh, tanh)
diff --git a/sysdeps/ieee754/flt-32/s_totalorderf.c b/sysdeps/ieee754/flt-32/s_totalorderf.c
new file mode 100644
index 0000000000..928a8d6d8f
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalorderf.c
@@ -0,0 +1,48 @@
+/* Total order operation. flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorderf (float x, float y)
+{
+ int32_t ix, iy;
+ GET_FLOAT_WORD (ix, x);
+ GET_FLOAT_WORD (iy, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((ix & 0x7fffffff) > 0x7f800000 && (iy & 0x7fffffff) > 0x7f800000)
+ {
+ ix ^= 0x00400000;
+ iy ^= 0x00400000;
+ }
+#endif
+ uint32_t ix_sign = ix >> 31;
+ uint32_t iy_sign = iy >> 31;
+ ix ^= ix_sign >> 1;
+ iy ^= iy_sign >> 1;
+ return ix <= iy;
+}
+libm_alias_float (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/flt-32/s_totalordermagf.c b/sysdeps/ieee754/flt-32/s_totalordermagf.c
new file mode 100644
index 0000000000..0e383653a5
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_totalordermagf.c
@@ -0,0 +1,46 @@
+/* Total order operation on absolute values. flt-32 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-float.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagf (float x, float y)
+{
+ uint32_t ix, iy;
+ GET_FLOAT_WORD (ix, x);
+ GET_FLOAT_WORD (iy, y);
+ ix &= 0x7fffffff;
+ iy &= 0x7fffffff;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if (ix > 0x7f800000 && iy > 0x7f800000)
+ {
+ ix ^= 0x00400000;
+ iy ^= 0x00400000;
+ }
+#endif
+ return ix <= iy;
+}
+libm_alias_float (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/flt-32/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c
index 43d35c7f6a..2e1464aeac 100644
--- a/sysdeps/ieee754/flt-32/s_truncf.c
+++ b/sysdeps/ieee754/flt-32/s_truncf.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-float.h>
float
@@ -48,4 +49,6 @@ __truncf (float x)
return x;
}
-weak_alias (__truncf, truncf)
+#ifndef __truncf
+libm_alias_float (__trunc, trunc)
+#endif
diff --git a/sysdeps/ieee754/flt-32/s_ufromfpf.c b/sysdeps/ieee754/flt-32/s_ufromfpf.c
new file mode 100644
index 0000000000..0d2b4493a8
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_ufromfpf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpf
+#include <s_fromfpf_main.c>
+libm_alias_float (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/flt-32/s_ufromfpxf.c b/sysdeps/ieee754/flt-32/s_ufromfpxf.c
new file mode 100644
index 0000000000..81f56daf9d
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/s_ufromfpxf.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxf
+#include <s_fromfpf_main.c>
+libm_alias_float (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/flt-32/t_exp2f.h b/sysdeps/ieee754/flt-32/t_exp2f.h
deleted file mode 100644
index 3045b82cd1..0000000000
--- a/sysdeps/ieee754/flt-32/t_exp2f.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/* Accurate tables for exp2f().
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-/* This table has the property that, for all integers -128 <= i <= 127,
- exp(i/256.0 + __exp2f_deltatable[i-128]) == __exp2f_atable[i+128] + r
- for some -2^-35 < r < 2^-35 (abs(r) < 2^-36 if i <= 0); and that
- __exp2f_deltatable[i+128] == t * 2^-30
- for integer t so that abs(t) <= 43447 * 2^0. */
-
-#define W30 (9.31322575e-10)
-static const float __exp2f_deltatable[256] = {
- -810*W30, 283*W30, -1514*W30, 1304*W30,
- -1148*W30, -98*W30, -744*W30, -156*W30,
- -419*W30, -155*W30, 474*W30, 167*W30,
- -1984*W30, -826*W30, 692*W30, 781*W30,
- -578*W30, -411*W30, -129*W30, -1500*W30,
- 654*W30, -141*W30, -816*W30, -53*W30,
- 148*W30, 493*W30, -2214*W30, 760*W30,
- 260*W30, 750*W30, -1300*W30, 1424*W30,
- -1445*W30, -339*W30, -680*W30, -349*W30,
- -922*W30, 531*W30, 193*W30, -2892*W30,
- 290*W30, -2145*W30, -276*W30, 485*W30,
- -695*W30, 215*W30, -7093*W30, 412*W30,
- -4596*W30, 367*W30, 592*W30, -615*W30,
- -97*W30, -1066*W30, 972*W30, -226*W30,
- -625*W30, -374*W30, -5647*W30, -180*W30,
- 20349*W30, -447*W30, 111*W30, -4164*W30,
- -87*W30, -21*W30, -251*W30, 66*W30,
- -517*W30, 2093*W30, -263*W30, 182*W30,
- -601*W30, 475*W30, -483*W30, -1251*W30,
- -373*W30, 1471*W30, -92*W30, -215*W30,
- -97*W30, -190*W30, 0*W30, -290*W30,
- -2647*W30, 1940*W30, -582*W30, 28*W30,
- 833*W30, 1493*W30, 34*W30, 321*W30,
- 3327*W30, -35*W30, 177*W30, -135*W30,
- -796*W30, -428*W30, 129*W30, 9332*W30,
- -12*W30, -69*W30, -1743*W30, 6508*W30,
- -60*W30, 359*W30, 43447*W30, 15*W30,
- -23*W30, -305*W30, -375*W30, -652*W30,
- 667*W30, 269*W30, -1575*W30, 185*W30,
- -329*W30, 200*W30, 6002*W30, 163*W30,
- -647*W30, 19*W30, -603*W30, -755*W30,
- 742*W30, -438*W30, 3587*W30, 2560*W30,
- 0*W30, -520*W30, -241*W30, -299*W30,
- -1270*W30, -991*W30, -1138*W30, 255*W30,
- -1192*W30, 1722*W30, 1023*W30, 3700*W30,
- -1388*W30, -1551*W30, -2549*W30, 27*W30,
- 282*W30, 673*W30, 113*W30, 1561*W30,
- 72*W30, 873*W30, 87*W30, -395*W30,
- -433*W30, 629*W30, 3440*W30, -284*W30,
- -592*W30, -103*W30, -46*W30, -3844*W30,
- 1712*W30, 303*W30, 1555*W30, -631*W30,
- -1400*W30, -961*W30, -854*W30, -276*W30,
- 407*W30, 833*W30, -345*W30, -1501*W30,
- 121*W30, -1581*W30, 400*W30, 150*W30,
- 1224*W30, -139*W30, -563*W30, 879*W30,
- 933*W30, 2939*W30, 788*W30, 211*W30,
- 530*W30, -192*W30, 706*W30, -13347*W30,
- 1065*W30, 3*W30, 111*W30, -208*W30,
- -360*W30, -532*W30, -291*W30, 483*W30,
- 987*W30, -33*W30, -1373*W30, -166*W30,
- -1174*W30, -3955*W30, 1601*W30, -280*W30,
- 1405*W30, 600*W30, -1659*W30, -23*W30,
- 390*W30, 449*W30, 570*W30, -13143*W30,
- -9*W30, -1646*W30, 1201*W30, 294*W30,
- 2181*W30, -1173*W30, 1388*W30, -4504*W30,
- 190*W30, -2304*W30, 211*W30, 239*W30,
- 48*W30, -817*W30, 1018*W30, 1828*W30,
- -663*W30, 1408*W30, 408*W30, -36*W30,
- 1295*W30, -230*W30, 1341*W30, 9*W30,
- 40*W30, 705*W30, 186*W30, 376*W30,
- 557*W30, 5866*W30, 363*W30, -1558*W30,
- 718*W30, 669*W30, 1369*W30, -2972*W30,
- -468*W30, -121*W30, -219*W30, 667*W30,
- 29954*W30, 366*W30, 48*W30, -203*W30
-};
-
-static const float __exp2f_atable[256] /* __attribute__((mode(SF))) */ = {
- 0.707106411447, /* 0x0.b504ecfff */
- 0.709024071690, /* 0x0.b58299fff */
- 0.710945606239, /* 0x0.b60088000 */
- 0.712874472142, /* 0x0.b67ef1000 */
- 0.714806139464, /* 0x0.b6fd88fff */
- 0.716744661340, /* 0x0.b77c94000 */
- 0.718687653549, /* 0x0.b7fbea000 */
- 0.720636486992, /* 0x0.b87ba1fff */
- 0.722590208040, /* 0x0.b8fbabfff */
- 0.724549472323, /* 0x0.b97c12fff */
- 0.726514220228, /* 0x0.b9fcd5fff */
- 0.728483855735, /* 0x0.ba7deb000 */
- 0.730457961549, /* 0x0.baff4afff */
- 0.732438981522, /* 0x0.bb811efff */
- 0.734425544748, /* 0x0.bc0350000 */
- 0.736416816713, /* 0x0.bc85d0000 */
- 0.738412797450, /* 0x0.bd089efff */
- 0.740414917465, /* 0x0.bd8bd4fff */
- 0.742422521111, /* 0x0.be0f66fff */
- 0.744434773914, /* 0x0.be9346fff */
- 0.746454179287, /* 0x0.bf179f000 */
- 0.748477637755, /* 0x0.bf9c3afff */
- 0.750506639473, /* 0x0.c02133fff */
- 0.752541840064, /* 0x0.c0a694fff */
- 0.754582285889, /* 0x0.c12c4e000 */
- 0.756628334525, /* 0x0.c1b265000 */
- 0.758678436269, /* 0x0.c238bffff */
- 0.760736882681, /* 0x0.c2bfa6fff */
- 0.762799203401, /* 0x0.c346cf000 */
- 0.764867603790, /* 0x0.c3ce5d000 */
- 0.766940355298, /* 0x0.c45633fff */
- 0.769021093841, /* 0x0.c4de90fff */
- 0.771104693409, /* 0x0.c5671dfff */
- 0.773195922364, /* 0x0.c5f02afff */
- 0.775292098512, /* 0x0.c6798afff */
- 0.777394294745, /* 0x0.c70350000 */
- 0.779501736166, /* 0x0.c78d6d000 */
- 0.781615912910, /* 0x0.c817fafff */
- 0.783734917628, /* 0x0.c8a2d9fff */
- 0.785858273516, /* 0x0.c92e02000 */
- 0.787990570071, /* 0x0.c9b9c0000 */
- 0.790125787245, /* 0x0.ca45aefff */
- 0.792268991467, /* 0x0.cad223fff */
- 0.794417440881, /* 0x0.cb5ef0fff */
- 0.796570718287, /* 0x0.cbec0efff */
- 0.798730909811, /* 0x0.cc79a0fff */
- 0.800892710672, /* 0x0.cd074dfff */
- 0.803068041795, /* 0x0.cd95ddfff */
- 0.805242776881, /* 0x0.ce2464000 */
- 0.807428598393, /* 0x0.ceb3a3fff */
- 0.809617877002, /* 0x0.cf431dfff */
- 0.811812341211, /* 0x0.cfd2eefff */
- 0.814013659956, /* 0x0.d06333000 */
- 0.816220164311, /* 0x0.d0f3ce000 */
- 0.818434238424, /* 0x0.d184e7fff */
- 0.820652604094, /* 0x0.d21649fff */
- 0.822877407074, /* 0x0.d2a818000 */
- 0.825108587751, /* 0x0.d33a51000 */
- 0.827342867839, /* 0x0.d3ccbdfff */
- 0.829588949684, /* 0x0.d45ff1000 */
- 0.831849217401, /* 0x0.d4f411fff */
- 0.834093391880, /* 0x0.d58724fff */
- 0.836355149750, /* 0x0.d61b5f000 */
- 0.838620424257, /* 0x0.d6afd3fff */
- 0.840896368027, /* 0x0.d744fc000 */
- 0.843176305293, /* 0x0.d7da66fff */
- 0.845462262643, /* 0x0.d87037000 */
- 0.847754716864, /* 0x0.d90673fff */
- 0.850052893157, /* 0x0.d99d10fff */
- 0.852359056469, /* 0x0.da3433fff */
- 0.854668736446, /* 0x0.dacb91fff */
- 0.856986224651, /* 0x0.db6373000 */
- 0.859309315673, /* 0x0.dbfbb1fff */
- 0.861639738080, /* 0x0.dc946bfff */
- 0.863975346095, /* 0x0.dd2d7d000 */
- 0.866317391394, /* 0x0.ddc6f9fff */
- 0.868666708472, /* 0x0.de60f1000 */
- 0.871022939695, /* 0x0.defb5c000 */
- 0.873383641229, /* 0x0.df9611fff */
- 0.875751554968, /* 0x0.e03141000 */
- 0.878126025200, /* 0x0.e0ccde000 */
- 0.880506813521, /* 0x0.e168e4fff */
- 0.882894217966, /* 0x0.e2055afff */
- 0.885287821299, /* 0x0.e2a239000 */
- 0.887686729423, /* 0x0.e33f6ffff */
- 0.890096127973, /* 0x0.e3dd56fff */
- 0.892507970338, /* 0x0.e47b67000 */
- 0.894928157336, /* 0x0.e51a03000 */
- 0.897355020043, /* 0x0.e5b90efff */
- 0.899788379682, /* 0x0.e65888000 */
- 0.902227103705, /* 0x0.e6f85afff */
- 0.904673457151, /* 0x0.e798ae000 */
- 0.907128036008, /* 0x0.e8398afff */
- 0.909585535528, /* 0x0.e8da99000 */
- 0.912051796915, /* 0x0.e97c3a000 */
- 0.914524436003, /* 0x0.ea1e46000 */
- 0.917003571999, /* 0x0.eac0bf000 */
- 0.919490039339, /* 0x0.eb63b2fff */
- 0.921983361257, /* 0x0.ec071a000 */
- 0.924488604054, /* 0x0.ecab48fff */
- 0.926989555360, /* 0x0.ed4f30000 */
- 0.929502844812, /* 0x0.edf3e6000 */
- 0.932021975503, /* 0x0.ee98fdfff */
- 0.934553921208, /* 0x0.ef3eecfff */
- 0.937083780759, /* 0x0.efe4b8fff */
- 0.939624726786, /* 0x0.f08b3f000 */
- 0.942198514924, /* 0x0.f133ebfff */
- 0.944726586343, /* 0x0.f1d99a000 */
- 0.947287976728, /* 0x0.f28176fff */
- 0.949856162070, /* 0x0.f329c5fff */
- 0.952431440345, /* 0x0.f3d28bfff */
- 0.955013573175, /* 0x0.f47bc5000 */
- 0.957603693021, /* 0x0.f52584000 */
- 0.960199773321, /* 0x0.f5cfa7000 */
- 0.962801992906, /* 0x0.f67a31000 */
- 0.965413510788, /* 0x0.f72556fff */
- 0.968030691152, /* 0x0.f7d0dc000 */
- 0.970655620084, /* 0x0.f87ce2fff */
- 0.973290979849, /* 0x0.f92998fff */
- 0.975926160805, /* 0x0.f9d64bfff */
- 0.978571653370, /* 0x0.fa83ac000 */
- 0.981225252139, /* 0x0.fb3193fff */
- 0.983885228626, /* 0x0.fbdfe6fff */
- 0.986552715296, /* 0x0.fc8eb7fff */
- 0.989228487027, /* 0x0.fd3e14000 */
- 0.991909801964, /* 0x0.fdedcd000 */
- 0.994601726545, /* 0x0.fe9e38000 */
- 0.997297704209, /* 0x0.ff4ee6fff */
- 1.000000000000, /* 0x1.000000000 */
- 1.002710938457, /* 0x1.00b1aa000 */
- 1.005429744692, /* 0x1.0163d7ffe */
- 1.008155703526, /* 0x1.02167dffe */
- 1.010888457284, /* 0x1.02c995fff */
- 1.013629436498, /* 0x1.037d38000 */
- 1.016377568250, /* 0x1.043152000 */
- 1.019134163841, /* 0x1.04e5f9ffe */
- 1.021896362316, /* 0x1.059b00000 */
- 1.024668931945, /* 0x1.0650b3ffe */
- 1.027446627635, /* 0x1.0706be001 */
- 1.030234098408, /* 0x1.07bd6bffe */
- 1.033023953416, /* 0x1.087441ffe */
- 1.035824656494, /* 0x1.092bce000 */
- 1.038632392900, /* 0x1.09e3d0001 */
- 1.041450142840, /* 0x1.0a9c79ffe */
- 1.044273972530, /* 0x1.0b558a001 */
- 1.047105550795, /* 0x1.0c0f1c001 */
- 1.049944162390, /* 0x1.0cc924001 */
- 1.052791833895, /* 0x1.0d83c4001 */
- 1.055645227426, /* 0x1.0e3ec3fff */
- 1.058507919326, /* 0x1.0efa60001 */
- 1.061377286898, /* 0x1.0fb66bfff */
- 1.064254641510, /* 0x1.1072fdffe */
- 1.067140102389, /* 0x1.113018000 */
- 1.070034146304, /* 0x1.11edc1fff */
- 1.072937250162, /* 0x1.12ac04001 */
- 1.075843691823, /* 0x1.136a7dfff */
- 1.078760385496, /* 0x1.1429a3ffe */
- 1.081685543070, /* 0x1.14e958000 */
- 1.084618330005, /* 0x1.15a98c000 */
- 1.087556362176, /* 0x1.166a18001 */
- 1.090508937863, /* 0x1.172b98001 */
- 1.093464612954, /* 0x1.17ed4bfff */
- 1.096430182434, /* 0x1.18afa5ffe */
- 1.099401354802, /* 0x1.19725e000 */
- 1.102381587017, /* 0x1.1a35adfff */
- 1.105370759965, /* 0x1.1af994000 */
- 1.108367800686, /* 0x1.1bbdfdffe */
- 1.111373305331, /* 0x1.1c82f6000 */
- 1.114387035385, /* 0x1.1d4878001 */
- 1.117408752440, /* 0x1.1e0e7ffff */
- 1.120437502874, /* 0x1.1ed4fe000 */
- 1.123474478729, /* 0x1.1f9c06000 */
- 1.126521706601, /* 0x1.2063ba001 */
- 1.129574775716, /* 0x1.212bd0001 */
- 1.132638812065, /* 0x1.21f49e000 */
- 1.135709524130, /* 0x1.22bddbffe */
- 1.138789534565, /* 0x1.2387b5fff */
- 1.141876101508, /* 0x1.2451fe000 */
- 1.144971728301, /* 0x1.251cddffe */
- 1.148077130296, /* 0x1.25e861ffe */
- 1.151189923305, /* 0x1.26b462001 */
- 1.154312610610, /* 0x1.278107ffe */
- 1.157440662410, /* 0x1.284e08001 */
- 1.160578370109, /* 0x1.291baa001 */
- 1.163725256932, /* 0x1.29e9e6000 */
- 1.166879892324, /* 0x1.2ab8a3ffe */
- 1.170044302935, /* 0x1.2b8805fff */
- 1.173205971694, /* 0x1.2c5739ffe */
- 1.176397800428, /* 0x1.2d2867ffe */
- 1.179586529747, /* 0x1.2df962001 */
- 1.182784795737, /* 0x1.2ecafbffe */
- 1.185991406414, /* 0x1.2f9d21ffe */
- 1.189206838636, /* 0x1.306fdc001 */
- 1.192430973067, /* 0x1.314328000 */
- 1.195664167430, /* 0x1.32170c001 */
- 1.198906540890, /* 0x1.32eb8a001 */
- 1.202157497408, /* 0x1.33c098000 */
- 1.205416083326, /* 0x1.349625fff */
- 1.208683252332, /* 0x1.356c43fff */
- 1.211961269402, /* 0x1.364318001 */
- 1.215246438983, /* 0x1.371a64000 */
- 1.218539118740, /* 0x1.37f22dffe */
- 1.221847295770, /* 0x1.38cafc000 */
- 1.225158572187, /* 0x1.39a3fdfff */
- 1.228481650325, /* 0x1.3a7dc5ffe */
- 1.231811761846, /* 0x1.3b5803fff */
- 1.235149741144, /* 0x1.3c32c5ffe */
- 1.238499879811, /* 0x1.3d0e53ffe */
- 1.241858124726, /* 0x1.3dea69fff */
- 1.245225191102, /* 0x1.3ec713fff */
- 1.248601436624, /* 0x1.3fa458000 */
- 1.251975655584, /* 0x1.40817a001 */
- 1.255380749731, /* 0x1.4160a2001 */
- 1.258783102010, /* 0x1.423f9bffe */
- 1.262198328973, /* 0x1.431f6e000 */
- 1.265619754780, /* 0x1.43ffa7fff */
- 1.269052743928, /* 0x1.44e0a4001 */
- 1.272490739830, /* 0x1.45c1f4000 */
- 1.275942921659, /* 0x1.46a432001 */
- 1.279397487615, /* 0x1.478697ffe */
- 1.282870173427, /* 0x1.486a2dffe */
- 1.286346316319, /* 0x1.494dfdffe */
- 1.289836049094, /* 0x1.4a32b2001 */
- 1.293333172770, /* 0x1.4b17e1ffe */
- 1.296839594835, /* 0x1.4bfdadfff */
- 1.300354957560, /* 0x1.4ce40fffe */
- 1.303882122055, /* 0x1.4dcb38001 */
- 1.307417988757, /* 0x1.4eb2f1ffe */
- 1.310960650439, /* 0x1.4f9b1dfff */
- 1.314516782746, /* 0x1.50842bfff */
- 1.318079948424, /* 0x1.516daffff */
- 1.321653246888, /* 0x1.5257de000 */
- 1.325237751030, /* 0x1.5342c8001 */
- 1.328829526907, /* 0x1.542e2c000 */
- 1.332433700535, /* 0x1.551a5fffe */
- 1.336045145966, /* 0x1.56070dffe */
- 1.339667558645, /* 0x1.56f473ffe */
- 1.343300342533, /* 0x1.57e287ffe */
- 1.346941947961, /* 0x1.58d130001 */
- 1.350594043714, /* 0x1.59c087ffe */
- 1.354256033883, /* 0x1.5ab085fff */
- 1.357932448365, /* 0x1.5ba175ffe */
- 1.361609339707, /* 0x1.5c926dfff */
- 1.365299344044, /* 0x1.5d8441ffe */
- 1.369003057507, /* 0x1.5e76fc001 */
- 1.372714757920, /* 0x1.5f6a3c000 */
- 1.376437187179, /* 0x1.605e2fffe */
- 1.380165219333, /* 0x1.615282001 */
- 1.383909463864, /* 0x1.6247e3ffe */
- 1.387661933907, /* 0x1.633dd0000 */
- 1.391424179060, /* 0x1.64345fffe */
- 1.395197510706, /* 0x1.652ba9fff */
- 1.399006724329, /* 0x1.66254dffe */
- 1.402773022651, /* 0x1.671c22000 */
- 1.406576037403, /* 0x1.68155dfff */
- 1.410389423392, /* 0x1.690f48001 */
-};
diff --git a/sysdeps/ieee754/flt-32/w_exp2f.c b/sysdeps/ieee754/flt-32/w_exp2f.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_exp2f.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c
index ed1550972f..1cc8931700 100644
--- a/sysdeps/ieee754/flt-32/w_expf.c
+++ b/sysdeps/ieee754/flt-32/w_expf.c
@@ -1,34 +1 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <math.h>
-#include <math_private.h>
-
-/* wrapper expf */
-float
-__expf (float x)
-{
- float z = __ieee754_expf (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_f (x, x, 106 + !!signbit (x));
-
- return z;
-}
-hidden_def (__expf)
-weak_alias (__expf, expf)
+/* Not needed. */
diff --git a/sysdeps/ieee754/flt-32/w_log2f.c b/sysdeps/ieee754/flt-32/w_log2f.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_log2f.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ieee754/flt-32/w_logf.c b/sysdeps/ieee754/flt-32/w_logf.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_logf.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ieee754/flt-32/w_powf.c b/sysdeps/ieee754/flt-32/w_powf.c
new file mode 100644
index 0000000000..1cc8931700
--- /dev/null
+++ b/sysdeps/ieee754/flt-32/w_powf.c
@@ -0,0 +1 @@
+/* Not needed. */
diff --git a/sysdeps/ieee754/ieee754.h b/sysdeps/ieee754/ieee754.h
index e7a5e93610..7dfa9f0a21 100644
--- a/sysdeps/ieee754/ieee754.h
+++ b/sysdeps/ieee754/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index c8aebbff90..f74f9c712e 100644
--- a/sysdeps/ieee754/k_standard.c
+++ b/sysdeps/ieee754/k_standard.c
@@ -16,27 +16,30 @@ static char rcsid[] = "$NetBSD: k_standard.c,v 1.6 1995/05/10 20:46:35 jtc Exp $
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <errno.h>
#include <assert.h>
-#ifndef _USE_WRITE
-#include <stdio.h> /* fputs(), stderr */
-#define WRITE2(u,v) fputs(u, stderr)
-#else /* !defined(_USE_WRITE) */
-#include <unistd.h> /* write */
-#define WRITE2(u,v) write(2, u, v)
-#undef fflush
-#endif /* !defined(_USE_WRITE) */
+#if LIBM_SVID_COMPAT
+
+# ifndef _USE_WRITE
+# include <stdio.h> /* fputs(), stderr */
+# define WRITE2(u,v) fputs(u, stderr)
+# else /* !defined(_USE_WRITE) */
+# include <unistd.h> /* write */
+# define WRITE2(u,v) write(2, u, v)
+# undef fflush
+# endif /* !defined(_USE_WRITE) */
/* XXX gcc versions until now don't delay the 0.0/0.0 division until
runtime but produce NaN at compile time. This is wrong since the
exceptions are not set correctly. */
-#if 0
+# if 0
static const double zero = 0.0; /* used as const */
-#else
+# else
static double zero = 0.0; /* used as const */
-#endif
+# endif
/*
* Standard conformance (non-IEEE) on exception cases.
@@ -60,7 +63,6 @@ static double zero = 0.0; /* used as const */
* 17-- log(x<0)
* 18-- log10(0)
* 19-- log10(x<0)
- * 20-- pow(0.0,0.0)
* 21-- pow(x,y) overflow
* 22-- pow(x,y) underflow
* 23-- pow(0,negative)
@@ -82,7 +84,6 @@ static double zero = 0.0; /* used as const */
* 39-- yn(x>X_TLOSS, n)
* 40-- tgamma(finite) overflow
* 41-- tgamma(-integer)
- * 42-- pow(NaN,0.0)
* 43-- +0**neg
* 44-- exp2 overflow
* 45-- exp2 underflow
@@ -98,21 +99,21 @@ double
__kernel_standard(double x, double y, int type)
{
struct exception exc;
-#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
-#define HUGE_VAL inf
+# ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
+# define HUGE_VAL inf
double inf = 0.0;
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
-#endif
+# endif
/* The SVID struct exception uses a field "char *name;". */
-#define CSTR(func) ((char *) (type < 100 \
+# define CSTR(func) ((char *) (type < 100 \
? func \
: (type < 200 ? func "f" : func "l")))
-#ifdef _USE_WRITE
+# ifdef _USE_WRITE
(void) fflush(stdout);
-#endif
+# endif
exc.arg1 = x;
exc.arg2 = y;
switch(type) {
@@ -461,20 +462,6 @@ __kernel_standard(double x, double y, int type)
__set_errno (EDOM);
}
break;
- case 20:
- case 120:
- case 220:
- /* pow(0.0,0.0) */
- /* error only if _LIB_VERSION == _SVID_ */
- exc.type = DOMAIN;
- exc.name = CSTR ("pow");
- exc.retval = zero;
- if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- (void) WRITE2("pow(0,0): DOMAIN error\n", 23);
- __set_errno (EDOM);
- }
- break;
case 21:
case 121:
case 221:
@@ -845,20 +832,6 @@ __kernel_standard(double x, double y, int type)
__set_errno (EDOM);
}
break;
- case 42:
- case 142:
- case 242:
- /* pow(NaN,0.0) */
- /* error only if _LIB_VERSION == _SVID_ & _XOPEN_ */
- exc.type = DOMAIN;
- exc.name = CSTR ("pow");
- exc.retval = x;
- if (_LIB_VERSION == _IEEE_ ||
- _LIB_VERSION == _POSIX_) exc.retval = 1.0;
- else if (!matherr(&exc)) {
- __set_errno (EDOM);
- }
- break;
case 44:
case 144:
@@ -968,6 +941,10 @@ __kernel_standard(double x, double y, int type)
break;
/* #### Last used is 50/150/250 ### */
+
+ default:
+ __builtin_unreachable ();
}
return exc.retval;
}
+#endif
diff --git a/sysdeps/ieee754/k_standardf.c b/sysdeps/ieee754/k_standardf.c
index 2b9c1bddb5..b790ad266d 100644
--- a/sysdeps/ieee754/k_standardf.c
+++ b/sysdeps/ieee754/k_standardf.c
@@ -1,5 +1,5 @@
/* Implement __kernel_standard_f.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,10 @@
#include <math.h>
#include <math_private.h>
+#include <math-svid-compat.h>
+#if LIBM_SVID_COMPAT
/* Handle errors for a libm function as specified by TYPE (see
comments in k_standard.c for details), with arguments X and Y,
returning the appropriate return value for that function. */
@@ -29,3 +31,4 @@ __kernel_standard_f (float x, float y, int type)
{
return __kernel_standard (x, y, type);
}
+#endif
diff --git a/sysdeps/ieee754/k_standardl.c b/sysdeps/ieee754/k_standardl.c
index d2d6f7466e..58abc22b6e 100644
--- a/sysdeps/ieee754/k_standardl.c
+++ b/sysdeps/ieee754/k_standardl.c
@@ -1,5 +1,5 @@
/* Implement __kernel_standard_l.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,12 +31,16 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-svid-compat.h>
#include <fenv.h>
#include <float.h>
#include <errno.h>
+#if LIBM_SVID_COMPAT
+
static double zero = 0.0;
/* Handle errors for a libm function as specified by TYPE (see
@@ -105,3 +109,4 @@ __kernel_standard_l (long double x, long double y, int type)
return __kernel_standard (dx, dy, type);
}
}
+#endif
diff --git a/sysdeps/ieee754/ldbl-128/Makeconfig b/sysdeps/ieee754/ldbl-128/Makeconfig
new file mode 100644
index 0000000000..ca17c1b12a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/Makeconfig
@@ -0,0 +1,4 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-alias-fcts = yes
+float64x-alias-fcts = yes
diff --git a/sysdeps/ieee754/ldbl-128/bits/floatn.h b/sysdeps/ieee754/ldbl-128/bits/floatn.h
new file mode 100644
index 0000000000..1d21ccee24
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h
@@ -0,0 +1,97 @@
+/* Macros to control TS 18661-3 glibc features on ldbl-128 platforms.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BITS_FLOATN_H
+#define _BITS_FLOATN_H
+
+#include <features.h>
+#include <bits/long-double.h>
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the IEEE 754 binary128 format, and this
+ glibc includes corresponding *f128 interfaces for it. */
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __HAVE_FLOAT128 1
+#else
+/* glibc does not support _Float128 for platforms where long double is
+ normally binary128 when building with long double as binary64.
+ GCC's default for supported scalar modes does not support it either
+ in that case. */
+# define __HAVE_FLOAT128 0
+#endif
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+ from the default float, double and long double types in this glibc. */
+#define __HAVE_DISTINCT_FLOAT128 0
+
+/* Defined to 1 if the current compiler invocation provides a
+ floating-point type with the right format for _Float64x, and this
+ glibc includes corresponding *f64x interfaces for it. */
+#define __HAVE_FLOAT64X __HAVE_FLOAT128
+
+/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
+ of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
+ the format of _Float128, which must be different from that of long
+ double. */
+#define __HAVE_FLOAT64X_LONG_DOUBLE __HAVE_FLOAT128
+
+#ifndef __ASSEMBLER__
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+ types, if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The literal suffix f128 exists only since GCC 7.0. */
+# define __f128(x) x##l
+# else
+# define __f128(x) x##f128
+# endif
+# endif
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
+# if __HAVE_FLOAT128
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+# define __CFLOAT128 _Complex long double
+# else
+# define __CFLOAT128 _Complex _Float128
+# endif
+# endif
+
+/* The remaining of this file provides support for older compilers. */
+# if __HAVE_FLOAT128
+
+/* The type _Float128 exists only since GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+typedef long double _Float128;
+# endif
+
+/* Various built-in functions do not exist before GCC 7.0. */
+# if !__GNUC_PREREQ (7, 0)
+# define __builtin_huge_valf128() (__builtin_huge_vall ())
+# define __builtin_inff128() (__builtin_infl ())
+# define __builtin_nanf128(x) (__builtin_nanl (x))
+# define __builtin_nansf128(x) (__builtin_nansl (x))
+# endif
+
+# endif
+
+#endif /* !__ASSEMBLER__. */
+
+#include <bits/floatn-common.h>
+
+#endif /* _BITS_FLOATN_H */
diff --git a/sysdeps/ieee754/ldbl-128/bits/long-double.h b/sysdeps/ieee754/ldbl-128/bits/long-double.h
new file mode 100644
index 0000000000..3d6e1139f8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/bits/long-double.h
@@ -0,0 +1,20 @@
+/* Properties of long double type. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* long double is distinct from double, so there is nothing to
+ define here. */
diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c
index 6234289e1e..c292759ac6 100644
--- a/sysdeps/ieee754/ldbl-128/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c
@@ -30,15 +30,15 @@
#include <math.h>
#include <math_private.h>
-static const long double
+static const _Float128
one = 1.0,
-ln2 = 0.6931471805599453094172321214581766L;
+ln2 = L(0.6931471805599453094172321214581766);
-long double
-__ieee754_acoshl(long double x)
+_Float128
+__ieee754_acoshl(_Float128 x)
{
- long double t;
- u_int64_t lx;
+ _Float128 t;
+ uint64_t lx;
int64_t hx;
GET_LDOUBLE_WORDS64(hx,lx,x);
if(hx<0x3fff000000000000LL) { /* x < 1 */
@@ -49,13 +49,13 @@ __ieee754_acoshl(long double x)
} else
return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */
} else if(((hx-0x3fff000000000000LL)|lx)==0) {
- return 0.0L; /* acosh(1) = 0 */
+ return 0; /* acosh(1) = 0 */
} else if (hx > 0x4000000000000000LL) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0L*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__sqrtl(2.0L*t+t*t));
+ return __log1pl(t+sqrtl(2*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_acosl.c b/sysdeps/ieee754/ldbl-128/e_acosl.c
index 8c8ec93339..0dc23dee2b 100644
--- a/sysdeps/ieee754/ldbl-128/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128/e_acosl.c
@@ -51,107 +51,107 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
*/
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- pio2_hi = 1.5707963267948966192313216916397514420986L,
- pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
+static const _Float128
+ one = 1,
+ pio2_hi = L(1.5707963267948966192313216916397514420986),
+ pio2_lo = L(4.3359050650618905123985220130216759843812E-35),
/* acos(0.5625 + x) = acos(0.5625) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 3.3e-35 */
- rS0 = 5.619049346208901520945464704848780243887E0L,
- rS1 = -4.460504162777731472539175700169871920352E1L,
- rS2 = 1.317669505315409261479577040530751477488E2L,
- rS3 = -1.626532582423661989632442410808596009227E2L,
- rS4 = 3.144806644195158614904369445440583873264E1L,
- rS5 = 9.806674443470740708765165604769099559553E1L,
- rS6 = -5.708468492052010816555762842394927806920E1L,
- rS7 = -1.396540499232262112248553357962639431922E1L,
- rS8 = 1.126243289311910363001762058295832610344E1L,
- rS9 = 4.956179821329901954211277873774472383512E-1L,
- rS10 = -3.313227657082367169241333738391762525780E-1L,
+ rS0 = L(5.619049346208901520945464704848780243887E0),
+ rS1 = L(-4.460504162777731472539175700169871920352E1),
+ rS2 = L(1.317669505315409261479577040530751477488E2),
+ rS3 = L(-1.626532582423661989632442410808596009227E2),
+ rS4 = L(3.144806644195158614904369445440583873264E1),
+ rS5 = L(9.806674443470740708765165604769099559553E1),
+ rS6 = L(-5.708468492052010816555762842394927806920E1),
+ rS7 = L(-1.396540499232262112248553357962639431922E1),
+ rS8 = L(1.126243289311910363001762058295832610344E1),
+ rS9 = L(4.956179821329901954211277873774472383512E-1),
+ rS10 = L(-3.313227657082367169241333738391762525780E-1),
- sS0 = -4.645814742084009935700221277307007679325E0L,
- sS1 = 3.879074822457694323970438316317961918430E1L,
- sS2 = -1.221986588013474694623973554726201001066E2L,
- sS3 = 1.658821150347718105012079876756201905822E2L,
- sS4 = -4.804379630977558197953176474426239748977E1L,
- sS5 = -1.004296417397316948114344573811562952793E2L,
- sS6 = 7.530281592861320234941101403870010111138E1L,
- sS7 = 1.270735595411673647119592092304357226607E1L,
- sS8 = -1.815144839646376500705105967064792930282E1L,
- sS9 = -7.821597334910963922204235247786840828217E-2L,
+ sS0 = L(-4.645814742084009935700221277307007679325E0),
+ sS1 = L(3.879074822457694323970438316317961918430E1),
+ sS2 = L(-1.221986588013474694623973554726201001066E2),
+ sS3 = L(1.658821150347718105012079876756201905822E2),
+ sS4 = L(-4.804379630977558197953176474426239748977E1),
+ sS5 = L(-1.004296417397316948114344573811562952793E2),
+ sS6 = L(7.530281592861320234941101403870010111138E1),
+ sS7 = L(1.270735595411673647119592092304357226607E1),
+ sS8 = L(-1.815144839646376500705105967064792930282E1),
+ sS9 = L(-7.821597334910963922204235247786840828217E-2),
/* 1.000000000000000000000000000000000000000E0 */
- acosr5625 = 9.7338991014954640492751132535550279812151E-1L,
- pimacosr5625 = 2.1682027434402468335351320579240000860757E0L,
+ acosr5625 = L(9.7338991014954640492751132535550279812151E-1),
+ pimacosr5625 = L(2.1682027434402468335351320579240000860757E0),
/* acos(0.4375 + x) = acos(0.4375) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 2.1e-35 */
- P0 = 2.177690192235413635229046633751390484892E0L,
- P1 = -2.848698225706605746657192566166142909573E1L,
- P2 = 1.040076477655245590871244795403659880304E2L,
- P3 = -1.400087608918906358323551402881238180553E2L,
- P4 = 2.221047917671449176051896400503615543757E1L,
- P5 = 9.643714856395587663736110523917499638702E1L,
- P6 = -5.158406639829833829027457284942389079196E1L,
- P7 = -1.578651828337585944715290382181219741813E1L,
- P8 = 1.093632715903802870546857764647931045906E1L,
- P9 = 5.448925479898460003048760932274085300103E-1L,
- P10 = -3.315886001095605268470690485170092986337E-1L,
- Q0 = -1.958219113487162405143608843774587557016E0L,
- Q1 = 2.614577866876185080678907676023269360520E1L,
- Q2 = -9.990858606464150981009763389881793660938E1L,
- Q3 = 1.443958741356995763628660823395334281596E2L,
- Q4 = -3.206441012484232867657763518369723873129E1L,
- Q5 = -1.048560885341833443564920145642588991492E2L,
- Q6 = 6.745883931909770880159915641984874746358E1L,
- Q7 = 1.806809656342804436118449982647641392951E1L,
- Q8 = -1.770150690652438294290020775359580915464E1L,
- Q9 = -5.659156469628629327045433069052560211164E-1L,
+ P0 = L(2.177690192235413635229046633751390484892E0),
+ P1 = L(-2.848698225706605746657192566166142909573E1),
+ P2 = L(1.040076477655245590871244795403659880304E2),
+ P3 = L(-1.400087608918906358323551402881238180553E2),
+ P4 = L(2.221047917671449176051896400503615543757E1),
+ P5 = L(9.643714856395587663736110523917499638702E1),
+ P6 = L(-5.158406639829833829027457284942389079196E1),
+ P7 = L(-1.578651828337585944715290382181219741813E1),
+ P8 = L(1.093632715903802870546857764647931045906E1),
+ P9 = L(5.448925479898460003048760932274085300103E-1),
+ P10 = L(-3.315886001095605268470690485170092986337E-1),
+ Q0 = L(-1.958219113487162405143608843774587557016E0),
+ Q1 = L(2.614577866876185080678907676023269360520E1),
+ Q2 = L(-9.990858606464150981009763389881793660938E1),
+ Q3 = L(1.443958741356995763628660823395334281596E2),
+ Q4 = L(-3.206441012484232867657763518369723873129E1),
+ Q5 = L(-1.048560885341833443564920145642588991492E2),
+ Q6 = L(6.745883931909770880159915641984874746358E1),
+ Q7 = L(1.806809656342804436118449982647641392951E1),
+ Q8 = L(-1.770150690652438294290020775359580915464E1),
+ Q9 = L(-5.659156469628629327045433069052560211164E-1),
/* 1.000000000000000000000000000000000000000E0 */
- acosr4375 = 1.1179797320499710475919903296900511518755E0L,
- pimacosr4375 = 2.0236129215398221908706530535894517323217E0L,
+ acosr4375 = L(1.1179797320499710475919903296900511518755E0),
+ pimacosr4375 = L(2.0236129215398221908706530535894517323217E0),
/* asin(x) = x + x^3 pS(x^2) / qS(x^2)
0 <= x <= 0.5
peak relative error 1.9e-35 */
- pS0 = -8.358099012470680544198472400254596543711E2L,
- pS1 = 3.674973957689619490312782828051860366493E3L,
- pS2 = -6.730729094812979665807581609853656623219E3L,
- pS3 = 6.643843795209060298375552684423454077633E3L,
- pS4 = -3.817341990928606692235481812252049415993E3L,
- pS5 = 1.284635388402653715636722822195716476156E3L,
- pS6 = -2.410736125231549204856567737329112037867E2L,
- pS7 = 2.219191969382402856557594215833622156220E1L,
- pS8 = -7.249056260830627156600112195061001036533E-1L,
- pS9 = 1.055923570937755300061509030361395604448E-3L,
+ pS0 = L(-8.358099012470680544198472400254596543711E2),
+ pS1 = L(3.674973957689619490312782828051860366493E3),
+ pS2 = L(-6.730729094812979665807581609853656623219E3),
+ pS3 = L(6.643843795209060298375552684423454077633E3),
+ pS4 = L(-3.817341990928606692235481812252049415993E3),
+ pS5 = L(1.284635388402653715636722822195716476156E3),
+ pS6 = L(-2.410736125231549204856567737329112037867E2),
+ pS7 = L(2.219191969382402856557594215833622156220E1),
+ pS8 = L(-7.249056260830627156600112195061001036533E-1),
+ pS9 = L(1.055923570937755300061509030361395604448E-3),
- qS0 = -5.014859407482408326519083440151745519205E3L,
- qS1 = 2.430653047950480068881028451580393430537E4L,
- qS2 = -4.997904737193653607449250593976069726962E4L,
- qS3 = 5.675712336110456923807959930107347511086E4L,
- qS4 = -3.881523118339661268482937768522572588022E4L,
- qS5 = 1.634202194895541569749717032234510811216E4L,
- qS6 = -4.151452662440709301601820849901296953752E3L,
- qS7 = 5.956050864057192019085175976175695342168E2L,
- qS8 = -4.175375777334867025769346564600396877176E1L;
+ qS0 = L(-5.014859407482408326519083440151745519205E3),
+ qS1 = L(2.430653047950480068881028451580393430537E4),
+ qS2 = L(-4.997904737193653607449250593976069726962E4),
+ qS3 = L(5.675712336110456923807959930107347511086E4),
+ qS4 = L(-3.881523118339661268482937768522572588022E4),
+ qS5 = L(1.634202194895541569749717032234510811216E4),
+ qS6 = L(-4.151452662440709301601820849901296953752E3),
+ qS7 = L(5.956050864057192019085175976175695342168E2),
+ qS8 = L(-4.175375777334867025769346564600396877176E1);
/* 1.000000000000000000000000000000000000000E0 */
-long double
-__ieee754_acosl (long double x)
+_Float128
+__ieee754_acosl (_Float128 x)
{
- long double z, r, w, p, q, s, t, f2;
+ _Float128 z, r, w, p, q, s, t, f2;
int32_t ix, sign;
ieee854_long_double_shape_type u;
@@ -204,7 +204,7 @@ __ieee754_acosl (long double x)
return z;
}
/* .4375 <= |x| < .5 */
- t = u.value - 0.4375L;
+ t = u.value - L(0.4375);
p = ((((((((((P10 * t
+ P9) * t
+ P8) * t
@@ -237,7 +237,7 @@ __ieee754_acosl (long double x)
}
else if (ix < 0x3ffe4000) /* |x| < 0.625 */
{
- t = u.value - 0.5625L;
+ t = u.value - L(0.5625);
p = ((((((((((rS10 * t
+ rS9) * t
+ rS8) * t
@@ -270,7 +270,7 @@ __ieee754_acosl (long double x)
else
{ /* |x| >= .625 */
z = (one - u.value) * 0.5;
- s = __ieee754_sqrtl (z);
+ s = sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
The change w from s to the improved value is
diff --git a/sysdeps/ieee754/ldbl-128/e_asinl.c b/sysdeps/ieee754/ldbl-128/e_asinl.c
index 5a0e473ef0..4835962db4 100644
--- a/sysdeps/ieee754/ldbl-128/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128/e_asinl.c
@@ -61,78 +61,79 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-long double sqrtl (long double);
+#include <math-underflow.h>
-static const long double
- one = 1.0L,
- huge = 1.0e+4932L,
- pio2_hi = 1.5707963267948966192313216916397514420986L,
- pio2_lo = 4.3359050650618905123985220130216759843812E-35L,
- pio4_hi = 7.8539816339744830961566084581987569936977E-1L,
+static const _Float128
+ one = 1,
+ huge = L(1.0e+4932),
+ pio2_hi = L(1.5707963267948966192313216916397514420986),
+ pio2_lo = L(4.3359050650618905123985220130216759843812E-35),
+ pio4_hi = L(7.8539816339744830961566084581987569936977E-1),
/* coefficient for R(x^2) */
/* asin(x) = x + x^3 pS(x^2) / qS(x^2)
0 <= x <= 0.5
peak relative error 1.9e-35 */
- pS0 = -8.358099012470680544198472400254596543711E2L,
- pS1 = 3.674973957689619490312782828051860366493E3L,
- pS2 = -6.730729094812979665807581609853656623219E3L,
- pS3 = 6.643843795209060298375552684423454077633E3L,
- pS4 = -3.817341990928606692235481812252049415993E3L,
- pS5 = 1.284635388402653715636722822195716476156E3L,
- pS6 = -2.410736125231549204856567737329112037867E2L,
- pS7 = 2.219191969382402856557594215833622156220E1L,
- pS8 = -7.249056260830627156600112195061001036533E-1L,
- pS9 = 1.055923570937755300061509030361395604448E-3L,
+ pS0 = L(-8.358099012470680544198472400254596543711E2),
+ pS1 = L(3.674973957689619490312782828051860366493E3),
+ pS2 = L(-6.730729094812979665807581609853656623219E3),
+ pS3 = L(6.643843795209060298375552684423454077633E3),
+ pS4 = L(-3.817341990928606692235481812252049415993E3),
+ pS5 = L(1.284635388402653715636722822195716476156E3),
+ pS6 = L(-2.410736125231549204856567737329112037867E2),
+ pS7 = L(2.219191969382402856557594215833622156220E1),
+ pS8 = L(-7.249056260830627156600112195061001036533E-1),
+ pS9 = L(1.055923570937755300061509030361395604448E-3),
- qS0 = -5.014859407482408326519083440151745519205E3L,
- qS1 = 2.430653047950480068881028451580393430537E4L,
- qS2 = -4.997904737193653607449250593976069726962E4L,
- qS3 = 5.675712336110456923807959930107347511086E4L,
- qS4 = -3.881523118339661268482937768522572588022E4L,
- qS5 = 1.634202194895541569749717032234510811216E4L,
- qS6 = -4.151452662440709301601820849901296953752E3L,
- qS7 = 5.956050864057192019085175976175695342168E2L,
- qS8 = -4.175375777334867025769346564600396877176E1L,
+ qS0 = L(-5.014859407482408326519083440151745519205E3),
+ qS1 = L(2.430653047950480068881028451580393430537E4),
+ qS2 = L(-4.997904737193653607449250593976069726962E4),
+ qS3 = L(5.675712336110456923807959930107347511086E4),
+ qS4 = L(-3.881523118339661268482937768522572588022E4),
+ qS5 = L(1.634202194895541569749717032234510811216E4),
+ qS6 = L(-4.151452662440709301601820849901296953752E3),
+ qS7 = L(5.956050864057192019085175976175695342168E2),
+ qS8 = L(-4.175375777334867025769346564600396877176E1),
/* 1.000000000000000000000000000000000000000E0 */
/* asin(0.5625 + x) = asin(0.5625) + x rS(x) / sS(x)
-0.0625 <= x <= 0.0625
peak relative error 3.3e-35 */
- rS0 = -5.619049346208901520945464704848780243887E0L,
- rS1 = 4.460504162777731472539175700169871920352E1L,
- rS2 = -1.317669505315409261479577040530751477488E2L,
- rS3 = 1.626532582423661989632442410808596009227E2L,
- rS4 = -3.144806644195158614904369445440583873264E1L,
- rS5 = -9.806674443470740708765165604769099559553E1L,
- rS6 = 5.708468492052010816555762842394927806920E1L,
- rS7 = 1.396540499232262112248553357962639431922E1L,
- rS8 = -1.126243289311910363001762058295832610344E1L,
- rS9 = -4.956179821329901954211277873774472383512E-1L,
- rS10 = 3.313227657082367169241333738391762525780E-1L,
+ rS0 = L(-5.619049346208901520945464704848780243887E0),
+ rS1 = L(4.460504162777731472539175700169871920352E1),
+ rS2 = L(-1.317669505315409261479577040530751477488E2),
+ rS3 = L(1.626532582423661989632442410808596009227E2),
+ rS4 = L(-3.144806644195158614904369445440583873264E1),
+ rS5 = L(-9.806674443470740708765165604769099559553E1),
+ rS6 = L(5.708468492052010816555762842394927806920E1),
+ rS7 = L(1.396540499232262112248553357962639431922E1),
+ rS8 = L(-1.126243289311910363001762058295832610344E1),
+ rS9 = L(-4.956179821329901954211277873774472383512E-1),
+ rS10 = L(3.313227657082367169241333738391762525780E-1),
- sS0 = -4.645814742084009935700221277307007679325E0L,
- sS1 = 3.879074822457694323970438316317961918430E1L,
- sS2 = -1.221986588013474694623973554726201001066E2L,
- sS3 = 1.658821150347718105012079876756201905822E2L,
- sS4 = -4.804379630977558197953176474426239748977E1L,
- sS5 = -1.004296417397316948114344573811562952793E2L,
- sS6 = 7.530281592861320234941101403870010111138E1L,
- sS7 = 1.270735595411673647119592092304357226607E1L,
- sS8 = -1.815144839646376500705105967064792930282E1L,
- sS9 = -7.821597334910963922204235247786840828217E-2L,
+ sS0 = L(-4.645814742084009935700221277307007679325E0),
+ sS1 = L(3.879074822457694323970438316317961918430E1),
+ sS2 = L(-1.221986588013474694623973554726201001066E2),
+ sS3 = L(1.658821150347718105012079876756201905822E2),
+ sS4 = L(-4.804379630977558197953176474426239748977E1),
+ sS5 = L(-1.004296417397316948114344573811562952793E2),
+ sS6 = L(7.530281592861320234941101403870010111138E1),
+ sS7 = L(1.270735595411673647119592092304357226607E1),
+ sS8 = L(-1.815144839646376500705105967064792930282E1),
+ sS9 = L(-7.821597334910963922204235247786840828217E-2),
/* 1.000000000000000000000000000000000000000E0 */
- asinr5625 = 5.9740641664535021430381036628424864397707E-1L;
+ asinr5625 = L(5.9740641664535021430381036628424864397707E-1);
-long double
-__ieee754_asinl (long double x)
+_Float128
+__ieee754_asinl (_Float128 x)
{
- long double t, w, p, q, c, r, s;
+ _Float128 t, w, p, q, c, r, s;
int32_t ix, sign, flag;
ieee854_long_double_shape_type u;
@@ -154,7 +155,7 @@ __ieee754_asinl (long double x)
if (ix < 0x3fc60000) /* |x| < 2**-57 */
{
math_check_force_underflow (x);
- long double force_inexact = huge + x;
+ _Float128 force_inexact = huge + x;
math_force_eval (force_inexact);
return x; /* return x with inexact if x!=0 */
}
@@ -232,7 +233,7 @@ __ieee754_asinl (long double x)
return x + x * w;
}
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (ix >= 0x3ffef333) /* |x| > 0.975 */
{
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-128/e_atan2l.c b/sysdeps/ieee754/ldbl-128/e_atan2l.c
index d31ee70dbd..8b4afa4bd5 100644
--- a/sysdeps/ieee754/ldbl-128/e_atan2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_atan2l.c
@@ -43,20 +43,20 @@
#include <math.h>
#include <math_private.h>
-static const long double
-tiny = 1.0e-4900L,
+static const _Float128
+tiny = L(1.0e-4900),
zero = 0.0,
-pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */
-pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898cc51701b8 */
-pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */
-pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */
+pi_o_4 = L(7.85398163397448309615660845819875699e-01), /* 3ffe921fb54442d18469898cc51701b8 */
+pi_o_2 = L(1.57079632679489661923132169163975140e+00), /* 3fff921fb54442d18469898cc51701b8 */
+pi = L(3.14159265358979323846264338327950280e+00), /* 4000921fb54442d18469898cc51701b8 */
+pi_lo = L(8.67181013012378102479704402604335225e-35); /* 3f8dcd129024e088a67cc74020bbea64 */
-long double
-__ieee754_atan2l(long double y, long double x)
+_Float128
+__ieee754_atan2l(_Float128 y, _Float128 x)
{
- long double z;
+ _Float128 z;
int64_t k,m,hx,hy,ix,iy;
- u_int64_t lx,ly;
+ uint64_t lx,ly;
GET_LDOUBLE_WORDS64(hx,lx,x);
ix = hx&0x7fffffffffffffffLL;
@@ -86,8 +86,8 @@ __ieee754_atan2l(long double y, long double x)
switch(m) {
case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */
case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
- case 2: return 3.0L*pi_o_4+tiny;/*atan(+INF,-INF)*/
- case 3: return -3.0L*pi_o_4-tiny;/*atan(-INF,-INF)*/
+ case 2: return 3*pi_o_4+tiny;/*atan(+INF,-INF)*/
+ case 3: return -3*pi_o_4-tiny;/*atan(-INF,-INF)*/
}
} else {
switch(m) {
@@ -103,13 +103,13 @@ __ieee754_atan2l(long double y, long double x)
/* compute y/x */
k = (iy-ix)>>48;
- if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */
- else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */
+ if(k > 120) z=pi_o_2+L(0.5)*pi_lo; /* |y/x| > 2**120 */
+ else if(hx<0&&k<-120) z=0; /* |y|/x < -2**120 */
else z=__atanl(fabsl(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: {
- u_int64_t zh;
+ uint64_t zh;
GET_LDOUBLE_MSW64(zh,z);
SET_LDOUBLE_MSW64(z,zh ^ 0x8000000000000000ULL);
}
diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c
index 7fa53ef436..13b7683e17 100644
--- a/sysdeps/ieee754/ldbl-128/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c
@@ -35,16 +35,17 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-static const long double one = 1.0L, huge = 1e4900L;
+static const _Float128 one = 1, huge = L(1e4900);
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__ieee754_atanhl(long double x)
+_Float128
+__ieee754_atanhl(_Float128 x)
{
- long double t;
- u_int32_t jx, ix;
+ _Float128 t;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
u.value = x;
diff --git a/sysdeps/ieee754/ldbl-128/e_coshl.c b/sysdeps/ieee754/ldbl-128/e_coshl.c
index 488c318d27..70a2fe3e84 100644
--- a/sysdeps/ieee754/ldbl-128/e_coshl.c
+++ b/sysdeps/ieee754/ldbl-128/e_coshl.c
@@ -54,13 +54,13 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, half = 0.5, huge = L(1.0e4900),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
-long double
-__ieee754_coshl (long double x)
+_Float128
+__ieee754_coshl (_Float128 x)
{
- long double t, w;
+ _Float128 t, w;
int32_t ex;
ieee854_long_double_shape_type u;
diff --git a/sysdeps/ieee754/ldbl-128/e_exp10l.c b/sysdeps/ieee754/ldbl-128/e_exp10l.c
index 987002567a..9b1ff9d821 100644
--- a/sysdeps/ieee754/ldbl-128/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,15 +19,15 @@
#include <math_private.h>
#include <float.h>
-static const long double log10_high = 0x2.4d763776aaa2bp0L;
-static const long double log10_low = 0x5.ba95b58ae0b4c28a38a3fb3e7698p-60L;
+static const _Float128 log10_high = L(0x2.4d763776aaa2bp0);
+static const _Float128 log10_low = L(0x5.ba95b58ae0b4c28a38a3fb3e7698p-60);
-long double
-__ieee754_exp10l (long double arg)
+_Float128
+__ieee754_exp10l (_Float128 arg)
{
ieee854_long_double_shape_type u;
- long double arg_high, arg_low;
- long double exp_high, exp_low;
+ _Float128 arg_high, arg_low;
+ _Float128 exp_high, exp_low;
if (!isfinite (arg))
return __ieee754_expl (arg);
@@ -35,8 +35,8 @@ __ieee754_exp10l (long double arg)
return LDBL_MIN * LDBL_MIN;
else if (arg > LDBL_MAX_10_EXP + 1)
return LDBL_MAX * LDBL_MAX;
- else if (fabsl (arg) < 0x1p-116L)
- return 1.0L;
+ else if (fabsl (arg) < L(0x1p-116))
+ return 1;
u.value = arg;
u.parts64.lsw &= 0xfe00000000000000LL;
diff --git a/sysdeps/ieee754/ldbl-128/e_expl.c b/sysdeps/ieee754/ldbl-128/e_expl.c
index 7b71e644be..b4b21c4957 100644
--- a/sysdeps/ieee754/ldbl-128/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -64,58 +64,60 @@
#include <math.h>
#include <fenv.h>
#include <inttypes.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <stdlib.h>
#include "t_expl.h"
-static const long double C[] = {
+static const _Float128 C[] = {
/* Smallest integer x for which e^x overflows. */
#define himark C[0]
- 11356.523406294143949491931077970765L,
+ L(11356.523406294143949491931077970765),
/* Largest integer x for which e^x underflows. */
#define lomark C[1]
--11433.4627433362978788372438434526231L,
+L(-11433.4627433362978788372438434526231),
/* 3x2^96 */
#define THREEp96 C[2]
- 59421121885698253195157962752.0L,
+ L(59421121885698253195157962752.0),
/* 3x2^103 */
#define THREEp103 C[3]
- 30423614405477505635920876929024.0L,
+ L(30423614405477505635920876929024.0),
/* 3x2^111 */
#define THREEp111 C[4]
- 7788445287802241442795744493830144.0L,
+ L(7788445287802241442795744493830144.0),
/* 1/ln(2) */
#define M_1_LN2 C[5]
- 1.44269504088896340735992468100189204L,
+ L(1.44269504088896340735992468100189204),
/* first 93 bits of ln(2) */
#define M_LN2_0 C[6]
- 0.693147180559945309417232121457981864L,
+ L(0.693147180559945309417232121457981864),
/* ln2_0 - ln(2) */
#define M_LN2_1 C[7]
--1.94704509238074995158795957333327386E-31L,
+L(-1.94704509238074995158795957333327386E-31),
/* very small number */
#define TINY C[8]
- 1.0e-4900L,
+ L(1.0e-4900),
/* 2^16383 */
#define TWO16383 C[9]
- 5.94865747678615882542879663314003565E+4931L,
+ L(5.94865747678615882542879663314003565E+4931),
/* 256 */
#define TWO8 C[10]
- 256.0L,
+ 256,
/* 32768 */
#define TWO15 C[11]
- 32768.0L,
+ 32768,
/* Chebyshev polynom coefficients for (exp(x)-1)/x */
#define P1 C[12]
@@ -124,22 +126,22 @@ static const long double C[] = {
#define P4 C[15]
#define P5 C[16]
#define P6 C[17]
- 0.5L,
- 1.66666666666666666666666666666666683E-01L,
- 4.16666666666666666666654902320001674E-02L,
- 8.33333333333333333333314659767198461E-03L,
- 1.38888888889899438565058018857254025E-03L,
- 1.98412698413981650382436541785404286E-04L,
+ L(0.5),
+ L(1.66666666666666666666666666666666683E-01),
+ L(4.16666666666666666666654902320001674E-02),
+ L(8.33333333333333333333314659767198461E-03),
+ L(1.38888888889899438565058018857254025E-03),
+ L(1.98412698413981650382436541785404286E-04),
};
-long double
-__ieee754_expl (long double x)
+_Float128
+__ieee754_expl (_Float128 x)
{
/* Check for usual case. */
if (isless (x, himark) && isgreater (x, lomark))
{
int tval1, tval2, unsafe, n_i;
- long double x22, n, t, result, xl;
+ _Float128 x22, n, t, result, xl;
union ieee854_long_double ex2_u, scale_u;
fenv_t oldenv;
@@ -185,13 +187,14 @@ __ieee754_expl (long double x)
ex2_u.ieee.exponent += n_i >> unsafe;
/* Compute scale = 2^n_1. */
- scale_u.d = 1.0L;
+ scale_u.d = 1;
scale_u.ieee.exponent += n_i - (n_i >> unsafe);
/* Approximate e^x2 - 1, using a seventh-degree polynomial,
with maximum error in [-2^-16-2^-53,2^-16+2^-53]
less than 4.8e-39. */
x22 = x + x*x*(P1+x*(P2+x*(P3+x*(P4+x*(P5+x*P6)))));
+ math_force_eval (x22);
/* Return result. */
fesetenv (&oldenv);
diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c
index 33280030f1..73465126b4 100644
--- a/sysdeps/ieee754/ldbl-128/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c
@@ -21,13 +21,13 @@
#include <math.h>
#include <math_private.h>
-static const long double one = 1.0, Zero[] = {0.0, -0.0,};
+static const _Float128 one = 1.0, Zero[] = {0.0, -0.0,};
-long double
-__ieee754_fmodl (long double x, long double y)
+_Float128
+__ieee754_fmodl (_Float128 x, _Float128 y)
{
int64_t n,hx,hy,hz,ix,iy,sx,i;
- u_int64_t lx,ly,lz;
+ uint64_t lx,ly,lz;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -42,7 +42,7 @@ __ieee754_fmodl (long double x, long double y)
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
if(lx==ly)
- return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
+ return Zero[(uint64_t)sx>>63]; /* |x|=|y| return x*0*/
}
/* determine ix = ilogb(x) */
@@ -96,7 +96,7 @@ __ieee754_fmodl (long double x, long double y)
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
@@ -105,7 +105,7 @@ __ieee754_fmodl (long double x, long double y)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -116,7 +116,7 @@ __ieee754_fmodl (long double x, long double y)
} else { /* subnormal output */
n = -16382 - iy;
if(n<=48) {
- lx = (lx>>n)|((u_int64_t)hx<<(64-n));
+ lx = (lx>>n)|((uint64_t)hx<<(64-n));
hx >>= n;
} else if (n<=63) {
lx = (hx<<(64-n))|(lx>>n); hx = sx;
diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index d0286e31eb..e2730b8fc2 100644
--- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -20,27 +20,28 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
approximation to gamma function. */
-static const long double gamma_coeff[] =
+static const _Float128 gamma_coeff[] =
{
- 0x1.5555555555555555555555555555p-4L,
- -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
- 0x3.4034034034034034034034034034p-12L,
- -0x2.7027027027027027027027027028p-12L,
- 0x3.72a3c5631fe46ae1d4e700dca8f2p-12L,
- -0x7.daac36664f1f207daac36664f1f4p-12L,
- 0x1.a41a41a41a41a41a41a41a41a41ap-8L,
- -0x7.90a1b2c3d4e5f708192a3b4c5d7p-8L,
- 0x2.dfd2c703c0cfff430edfd2c703cp-4L,
- -0x1.6476701181f39edbdb9ce625987dp+0L,
- 0xd.672219167002d3a7a9c886459cp+0L,
- -0x9.cd9292e6660d55b3f712eb9e07c8p+4L,
- 0x8.911a740da740da740da740da741p+8L,
- -0x8.d0cc570e255bf59ff6eec24b49p+12L,
+ L(0x1.5555555555555555555555555555p-4),
+ L(-0xb.60b60b60b60b60b60b60b60b60b8p-12),
+ L(0x3.4034034034034034034034034034p-12),
+ L(-0x2.7027027027027027027027027028p-12),
+ L(0x3.72a3c5631fe46ae1d4e700dca8f2p-12),
+ L(-0x7.daac36664f1f207daac36664f1f4p-12),
+ L(0x1.a41a41a41a41a41a41a41a41a41ap-8),
+ L(-0x7.90a1b2c3d4e5f708192a3b4c5d7p-8),
+ L(0x2.dfd2c703c0cfff430edfd2c703cp-4),
+ L(-0x1.6476701181f39edbdb9ce625987dp+0),
+ L(0xd.672219167002d3a7a9c886459cp+0),
+ L(-0x9.cd9292e6660d55b3f712eb9e07c8p+4),
+ L(0x8.911a740da740da740da740da741p+8),
+ L(-0x8.d0cc570e255bf59ff6eec24b49p+12),
};
#define NCOEFF (sizeof (gamma_coeff) / sizeof (gamma_coeff[0]))
@@ -49,42 +50,42 @@ static const long double gamma_coeff[] =
2^(*EXP2_ADJ), where R is the return value and *EXP2_ADJ is set to
avoid overflow or underflow in intermediate calculations. */
-static long double
-gammal_positive (long double x, int *exp2_adj)
+static _Float128
+gammal_positive (_Float128 x, int *exp2_adj)
{
int local_signgam;
- if (x < 0.5L)
+ if (x < L(0.5))
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x + 1, &local_signgam)) / x;
}
- else if (x <= 1.5L)
+ else if (x <= L(1.5))
{
*exp2_adj = 0;
return __ieee754_expl (__ieee754_lgammal_r (x, &local_signgam));
}
- else if (x < 12.5L)
+ else if (x < L(12.5))
{
/* Adjust into the range for using exp (lgamma). */
*exp2_adj = 0;
- long double n = __ceill (x - 1.5L);
- long double x_adj = x - n;
- long double eps;
- long double prod = __gamma_productl (x_adj, 0, n, &eps);
+ _Float128 n = __ceill (x - L(1.5));
+ _Float128 x_adj = x - n;
+ _Float128 eps;
+ _Float128 prod = __gamma_productl (x_adj, 0, n, &eps);
return (__ieee754_expl (__ieee754_lgammal_r (x_adj, &local_signgam))
- * prod * (1.0L + eps));
+ * prod * (1 + eps));
}
else
{
- long double eps = 0;
- long double x_eps = 0;
- long double x_adj = x;
- long double prod = 1;
- if (x < 24.0L)
+ _Float128 eps = 0;
+ _Float128 x_eps = 0;
+ _Float128 x_adj = x;
+ _Float128 prod = 1;
+ if (x < 24)
{
/* Adjust into the range for applying Stirling's
approximation. */
- long double n = __ceill (24.0L - x);
+ _Float128 n = __ceill (24 - x);
x_adj = x + n;
x_eps = (x - (x_adj - n));
prod = __gamma_productl (x_adj - n, x_eps, n, &eps);
@@ -93,25 +94,25 @@ gammal_positive (long double x, int *exp2_adj)
Compute gamma (X_ADJ + X_EPS) using Stirling's approximation,
starting by computing pow (X_ADJ, X_ADJ) with a power of 2
factored out. */
- long double exp_adj = -eps;
- long double x_adj_int = __roundl (x_adj);
- long double x_adj_frac = x_adj - x_adj_int;
+ _Float128 exp_adj = -eps;
+ _Float128 x_adj_int = __roundl (x_adj);
+ _Float128 x_adj_frac = x_adj - x_adj_int;
int x_adj_log2;
- long double x_adj_mant = __frexpl (x_adj, &x_adj_log2);
+ _Float128 x_adj_mant = __frexpl (x_adj, &x_adj_log2);
if (x_adj_mant < M_SQRT1_2l)
{
x_adj_log2--;
- x_adj_mant *= 2.0L;
+ x_adj_mant *= 2;
}
*exp2_adj = x_adj_log2 * (int) x_adj_int;
- long double ret = (__ieee754_powl (x_adj_mant, x_adj)
- * __ieee754_exp2l (x_adj_log2 * x_adj_frac)
- * __ieee754_expl (-x_adj)
- * __ieee754_sqrtl (2 * M_PIl / x_adj)
- / prod);
+ _Float128 ret = (__ieee754_powl (x_adj_mant, x_adj)
+ * __ieee754_exp2l (x_adj_log2 * x_adj_frac)
+ * __ieee754_expl (-x_adj)
+ * sqrtl (2 * M_PIl / x_adj)
+ / prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
- long double bsum = gamma_coeff[NCOEFF - 1];
- long double x_adj2 = x_adj * x_adj;
+ _Float128 bsum = gamma_coeff[NCOEFF - 1];
+ _Float128 x_adj2 = x_adj * x_adj;
for (size_t i = 1; i <= NCOEFF - 1; i++)
bsum = bsum / x_adj2 + gamma_coeff[NCOEFF - 1 - i];
exp_adj += bsum / x_adj;
@@ -119,12 +120,12 @@ gammal_positive (long double x, int *exp2_adj)
}
}
-long double
-__ieee754_gammal_r (long double x, int *signgamp)
+_Float128
+__ieee754_gammal_r (_Float128 x, int *signgamp)
{
int64_t hx;
- u_int64_t lx;
- long double ret;
+ uint64_t lx;
+ _Float128 ret;
GET_LDOUBLE_WORDS64 (hx, lx, x);
@@ -134,7 +135,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int64_t) hx < 0xffff000000000000ULL && __rintl (x) == x)
+ if (hx < 0 && (uint64_t) hx < 0xffff000000000000ULL && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
@@ -154,7 +155,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
return x + x;
}
- if (x >= 1756.0L)
+ if (x >= 1756)
{
/* Overflow. */
*signgamp = 0;
@@ -163,33 +164,33 @@ __ieee754_gammal_r (long double x, int *signgamp)
else
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- if (x > 0.0L)
+ if (x > 0)
{
*signgamp = 0;
int exp2_adj;
ret = gammal_positive (x, &exp2_adj);
ret = __scalbnl (ret, exp2_adj);
}
- else if (x >= -LDBL_EPSILON / 4.0L)
+ else if (x >= -LDBL_EPSILON / 4)
{
*signgamp = 0;
- ret = 1.0L / x;
+ ret = 1 / x;
}
else
{
- long double tx = __truncl (x);
- *signgamp = (tx == 2.0L * __truncl (tx / 2.0L)) ? -1 : 1;
- if (x <= -1775.0L)
+ _Float128 tx = __truncl (x);
+ *signgamp = (tx == 2 * __truncl (tx / 2)) ? -1 : 1;
+ if (x <= -1775)
/* Underflow. */
ret = LDBL_MIN * LDBL_MIN;
else
{
- long double frac = tx - x;
- if (frac > 0.5L)
- frac = 1.0L - frac;
- long double sinpix = (frac <= 0.25L
- ? __sinl (M_PIl * frac)
- : __cosl (M_PIl * (0.5L - frac)));
+ _Float128 frac = tx - x;
+ if (frac > L(0.5))
+ frac = 1 - frac;
+ _Float128 sinpix = (frac <= L(0.25)
+ ? __sinl (M_PIl * frac)
+ : __cosl (M_PIl * (L(0.5) - frac)));
int exp2_adj;
ret = M_PIl / (-x * sinpix
* gammal_positive (-x, &exp2_adj));
diff --git a/sysdeps/ieee754/ldbl-128/e_hypotl.c b/sysdeps/ieee754/ldbl-128/e_hypotl.c
index 80e5e38c72..7bafd4ae29 100644
--- a/sysdeps/ieee754/ldbl-128/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c
@@ -47,11 +47,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-long double
-__ieee754_hypotl(long double x, long double y)
+_Float128
+__ieee754_hypotl(_Float128 x, _Float128 y)
{
- long double a,b,t1,t2,y1,y2,w;
+ _Float128 a,b,t1,t2,y1,y2,w;
int64_t j,k,ha,hb;
GET_LDOUBLE_MSW64(ha,x);
@@ -65,8 +66,10 @@ __ieee754_hypotl(long double x, long double y)
k=0;
if(ha > 0x5f3f000000000000LL) { /* a>2**8000 */
if(ha >= 0x7fff000000000000LL) { /* Inf or NaN */
- u_int64_t low;
+ uint64_t low;
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LDOUBLE_LSW64(low,a);
if(((ha&0xffffffffffffLL)|low)==0) w = a;
GET_LDOUBLE_LSW64(low,b);
@@ -81,7 +84,7 @@ __ieee754_hypotl(long double x, long double y)
}
if(hb < 0x20bf000000000000LL) { /* b < 2**-8000 */
if(hb <= 0x0000ffffffffffffLL) { /* subnormal b or 0 */
- u_int64_t low;
+ uint64_t low;
GET_LDOUBLE_LSW64(low,b);
if((hb|low)==0) return a;
t1=0;
@@ -114,7 +117,7 @@ __ieee754_hypotl(long double x, long double y)
t1 = 0;
SET_LDOUBLE_MSW64(t1,ha);
t2 = a-t1;
- w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
+ w = sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
a = a+a;
y1 = 0;
@@ -123,11 +126,11 @@ __ieee754_hypotl(long double x, long double y)
t1 = 0;
SET_LDOUBLE_MSW64(t1,ha+0x0001000000000000LL);
t2 = a - t1;
- w = __ieee754_sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+ w = sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int64_t high;
- t1 = 1.0L;
+ uint64_t high;
+ t1 = 1;
GET_LDOUBLE_MSW64(high,t1);
SET_LDOUBLE_MSW64(t1,high+(k<<48));
w *= t1;
diff --git a/sysdeps/ieee754/ldbl-128/e_ilogbl.c b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
index 0a476492d6..9effe6386a 100644
--- a/sysdeps/ieee754/ldbl-128/e_ilogbl.c
+++ b/sysdeps/ieee754/ldbl-128/e_ilogbl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __ieee754_ilogbl (long double x)
+int __ieee754_ilogbl (_Float128 x)
{
int64_t hx,lx;
int ix;
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index c208916a79..5c699956b6 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -96,33 +96,33 @@
#include <float.h>
/* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
/* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
/* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
Peak relative error 3.4e-37
0 <= x <= 2 */
#define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
- 3.133239376997663645548490085151484674892E16L,
- -5.479944965767990821079467311839107722107E14L,
- 6.290828903904724265980249871997551894090E12L,
- -3.633750176832769659849028554429106299915E10L,
- 1.207743757532429576399485415069244807022E8L,
- -2.107485999925074577174305650549367415465E5L,
- 1.562826808020631846245296572935547005859E2L,
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+ L(3.133239376997663645548490085151484674892E16),
+ L(-5.479944965767990821079467311839107722107E14),
+ L(6.290828903904724265980249871997551894090E12),
+ L(-3.633750176832769659849028554429106299915E10),
+ L(1.207743757532429576399485415069244807022E8),
+ L(-2.107485999925074577174305650549367415465E5),
+ L(1.562826808020631846245296572935547005859E2),
};
#define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
- 2.005273201278504733151033654496928968261E18L,
- 2.063038558793221244373123294054149790864E16L,
- 1.053350447931127971406896594022010524994E14L,
- 3.496556557558702583143527876385508882310E11L,
- 8.249114511878616075860654484367133976306E8L,
- 1.402965782449571800199759247964242790589E6L,
- 1.619910762853439600957801751815074787351E3L,
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+ L(2.005273201278504733151033654496928968261E18),
+ L(2.063038558793221244373123294054149790864E16),
+ L(1.053350447931127971406896594022010524994E14),
+ L(3.496556557558702583143527876385508882310E11),
+ L(8.249114511878616075860654484367133976306E8),
+ L(1.402965782449571800199759247964242790589E6),
+ L(1.619910762853439600957801751815074787351E3),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -130,30 +130,30 @@ static const long double J0_2D[NJ0_2D + 1] = {
0 <= 1/x <= .0625
Peak relative error 3.3e-36 */
#define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
- -1.901689868258117463979611259731176301065E-16L,
- -1.798743043824071514483008340803573980931E-13L,
- -6.481746687115262291873324132944647438959E-11L,
- -1.150651553745409037257197798528294248012E-8L,
- -1.088408467297401082271185599507222695995E-6L,
- -5.551996725183495852661022587879817546508E-5L,
- -1.477286941214245433866838787454880214736E-3L,
- -1.882877976157714592017345347609200402472E-2L,
- -9.620983176855405325086530374317855880515E-2L,
- -1.271468546258855781530458854476627766233E-1L,
+static const _Float128 P16_IN[NP16_IN + 1] = {
+ L(-1.901689868258117463979611259731176301065E-16),
+ L(-1.798743043824071514483008340803573980931E-13),
+ L(-6.481746687115262291873324132944647438959E-11),
+ L(-1.150651553745409037257197798528294248012E-8),
+ L(-1.088408467297401082271185599507222695995E-6),
+ L(-5.551996725183495852661022587879817546508E-5),
+ L(-1.477286941214245433866838787454880214736E-3),
+ L(-1.882877976157714592017345347609200402472E-2),
+ L(-9.620983176855405325086530374317855880515E-2),
+ L(-1.271468546258855781530458854476627766233E-1),
};
#define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
- 2.704625590411544837659891569420764475007E-15L,
- 2.562526347676857624104306349421985403573E-12L,
- 9.259137589952741054108665570122085036246E-10L,
- 1.651044705794378365237454962653430805272E-7L,
- 1.573561544138733044977714063100859136660E-5L,
- 8.134482112334882274688298469629884804056E-4L,
- 2.219259239404080863919375103673593571689E-2L,
- 2.976990606226596289580242451096393862792E-1L,
- 1.713895630454693931742734911930937246254E0L,
- 3.231552290717904041465898249160757368855E0L,
+static const _Float128 P16_ID[NP16_ID + 1] = {
+ L(2.704625590411544837659891569420764475007E-15),
+ L(2.562526347676857624104306349421985403573E-12),
+ L(9.259137589952741054108665570122085036246E-10),
+ L(1.651044705794378365237454962653430805272E-7),
+ L(1.573561544138733044977714063100859136660E-5),
+ L(8.134482112334882274688298469629884804056E-4),
+ L(2.219259239404080863919375103673593571689E-2),
+ L(2.976990606226596289580242451096393862792E-1),
+ L(1.713895630454693931742734911930937246254E0),
+ L(3.231552290717904041465898249160757368855E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -161,32 +161,32 @@ static const long double P16_ID[NP16_ID + 1] = {
0.0625 <= 1/x <= 0.125
Peak relative error 2.4e-35 */
#define NP8_16N 10
-static const long double P8_16N[NP8_16N + 1] = {
- -2.335166846111159458466553806683579003632E-15L,
- -1.382763674252402720401020004169367089975E-12L,
- -3.192160804534716696058987967592784857907E-10L,
- -3.744199606283752333686144670572632116899E-8L,
- -2.439161236879511162078619292571922772224E-6L,
- -9.068436986859420951664151060267045346549E-5L,
- -1.905407090637058116299757292660002697359E-3L,
- -2.164456143936718388053842376884252978872E-2L,
- -1.212178415116411222341491717748696499966E-1L,
- -2.782433626588541494473277445959593334494E-1L,
- -1.670703190068873186016102289227646035035E-1L,
+static const _Float128 P8_16N[NP8_16N + 1] = {
+ L(-2.335166846111159458466553806683579003632E-15),
+ L(-1.382763674252402720401020004169367089975E-12),
+ L(-3.192160804534716696058987967592784857907E-10),
+ L(-3.744199606283752333686144670572632116899E-8),
+ L(-2.439161236879511162078619292571922772224E-6),
+ L(-9.068436986859420951664151060267045346549E-5),
+ L(-1.905407090637058116299757292660002697359E-3),
+ L(-2.164456143936718388053842376884252978872E-2),
+ L(-1.212178415116411222341491717748696499966E-1),
+ L(-2.782433626588541494473277445959593334494E-1),
+ L(-1.670703190068873186016102289227646035035E-1),
};
#define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
- 3.321126181135871232648331450082662856743E-14L,
- 1.971894594837650840586859228510007703641E-11L,
- 4.571144364787008285981633719513897281690E-9L,
- 5.396419143536287457142904742849052402103E-7L,
- 3.551548222385845912370226756036899901549E-5L,
- 1.342353874566932014705609788054598013516E-3L,
- 2.899133293006771317589357444614157734385E-2L,
- 3.455374978185770197704507681491574261545E-1L,
- 2.116616964297512311314454834712634820514E0L,
- 5.850768316827915470087758636881584174432E0L,
- 5.655273858938766830855753983631132928968E0L,
+static const _Float128 P8_16D[NP8_16D + 1] = {
+ L(3.321126181135871232648331450082662856743E-14),
+ L(1.971894594837650840586859228510007703641E-11),
+ L(4.571144364787008285981633719513897281690E-9),
+ L(5.396419143536287457142904742849052402103E-7),
+ L(3.551548222385845912370226756036899901549E-5),
+ L(1.342353874566932014705609788054598013516E-3),
+ L(2.899133293006771317589357444614157734385E-2),
+ L(3.455374978185770197704507681491574261545E-1),
+ L(2.116616964297512311314454834712634820514E0),
+ L(5.850768316827915470087758636881584174432E0),
+ L(5.655273858938766830855753983631132928968E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -194,31 +194,31 @@ static const long double P8_16D[NP8_16D + 1] = {
0.125 <= 1/x <= 0.1875
Peak relative error 2.7e-35 */
#define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
- -1.270478335089770355749591358934012019596E-12L,
- -4.007588712145412921057254992155810347245E-10L,
- -4.815187822989597568124520080486652009281E-8L,
- -2.867070063972764880024598300408284868021E-6L,
- -9.218742195161302204046454768106063638006E-5L,
- -1.635746821447052827526320629828043529997E-3L,
- -1.570376886640308408247709616497261011707E-2L,
- -7.656484795303305596941813361786219477807E-2L,
- -1.659371030767513274944805479908858628053E-1L,
- -1.185340550030955660015841796219919804915E-1L,
- -8.920026499909994671248893388013790366712E-3L,
+static const _Float128 P5_8N[NP5_8N + 1] = {
+ L(-1.270478335089770355749591358934012019596E-12),
+ L(-4.007588712145412921057254992155810347245E-10),
+ L(-4.815187822989597568124520080486652009281E-8),
+ L(-2.867070063972764880024598300408284868021E-6),
+ L(-9.218742195161302204046454768106063638006E-5),
+ L(-1.635746821447052827526320629828043529997E-3),
+ L(-1.570376886640308408247709616497261011707E-2),
+ L(-7.656484795303305596941813361786219477807E-2),
+ L(-1.659371030767513274944805479908858628053E-1),
+ L(-1.185340550030955660015841796219919804915E-1),
+ L(-8.920026499909994671248893388013790366712E-3),
};
#define NP5_8D 9
-static const long double P5_8D[NP5_8D + 1] = {
- 1.806902521016705225778045904631543990314E-11L,
- 5.728502760243502431663549179135868966031E-9L,
- 6.938168504826004255287618819550667978450E-7L,
- 4.183769964807453250763325026573037785902E-5L,
- 1.372660678476925468014882230851637878587E-3L,
- 2.516452105242920335873286419212708961771E-2L,
- 2.550502712902647803796267951846557316182E-1L,
- 1.365861559418983216913629123778747617072E0L,
- 3.523825618308783966723472468855042541407E0L,
- 3.656365803506136165615111349150536282434E0L,
+static const _Float128 P5_8D[NP5_8D + 1] = {
+ L(1.806902521016705225778045904631543990314E-11),
+ L(5.728502760243502431663549179135868966031E-9),
+ L(6.938168504826004255287618819550667978450E-7),
+ L(4.183769964807453250763325026573037785902E-5),
+ L(1.372660678476925468014882230851637878587E-3),
+ L(2.516452105242920335873286419212708961771E-2),
+ L(2.550502712902647803796267951846557316182E-1),
+ L(1.365861559418983216913629123778747617072E0),
+ L(3.523825618308783966723472468855042541407E0),
+ L(3.656365803506136165615111349150536282434E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -226,30 +226,30 @@ static const long double P5_8D[NP5_8D + 1] = {
Peak relative error 3.5e-35
0.1875 <= 1/x <= 0.25 */
#define NP4_5N 9
-static const long double P4_5N[NP4_5N + 1] = {
- -9.791405771694098960254468859195175708252E-10L,
- -1.917193059944531970421626610188102836352E-7L,
- -1.393597539508855262243816152893982002084E-5L,
- -4.881863490846771259880606911667479860077E-4L,
- -8.946571245022470127331892085881699269853E-3L,
- -8.707474232568097513415336886103899434251E-2L,
- -4.362042697474650737898551272505525973766E-1L,
- -1.032712171267523975431451359962375617386E0L,
- -9.630502683169895107062182070514713702346E-1L,
- -2.251804386252969656586810309252357233320E-1L,
+static const _Float128 P4_5N[NP4_5N + 1] = {
+ L(-9.791405771694098960254468859195175708252E-10),
+ L(-1.917193059944531970421626610188102836352E-7),
+ L(-1.393597539508855262243816152893982002084E-5),
+ L(-4.881863490846771259880606911667479860077E-4),
+ L(-8.946571245022470127331892085881699269853E-3),
+ L(-8.707474232568097513415336886103899434251E-2),
+ L(-4.362042697474650737898551272505525973766E-1),
+ L(-1.032712171267523975431451359962375617386E0),
+ L(-9.630502683169895107062182070514713702346E-1),
+ L(-2.251804386252969656586810309252357233320E-1),
};
#define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
- 1.392555487577717669739688337895791213139E-8L,
- 2.748886559120659027172816051276451376854E-6L,
- 2.024717710644378047477189849678576659290E-4L,
- 7.244868609350416002930624752604670292469E-3L,
- 1.373631762292244371102989739300382152416E-1L,
- 1.412298581400224267910294815260613240668E0L,
- 7.742495637843445079276397723849017617210E0L,
- 2.138429269198406512028307045259503811861E1L,
- 2.651547684548423476506826951831712762610E1L,
- 1.167499382465291931571685222882909166935E1L,
+static const _Float128 P4_5D[NP4_5D + 1] = {
+ L(1.392555487577717669739688337895791213139E-8),
+ L(2.748886559120659027172816051276451376854E-6),
+ L(2.024717710644378047477189849678576659290E-4),
+ L(7.244868609350416002930624752604670292469E-3),
+ L(1.373631762292244371102989739300382152416E-1),
+ L(1.412298581400224267910294815260613240668E0),
+ L(7.742495637843445079276397723849017617210E0),
+ L(2.138429269198406512028307045259503811861E1),
+ L(2.651547684548423476506826951831712762610E1),
+ L(1.167499382465291931571685222882909166935E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -257,30 +257,30 @@ static const long double P4_5D[NP4_5D + 1] = {
Peak relative error 2.3e-36
0.25 <= 1/x <= 0.3125 */
#define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
- -2.589155123706348361249809342508270121788E-8L,
- -3.746254369796115441118148490849195516593E-6L,
- -1.985595497390808544622893738135529701062E-4L,
- -5.008253705202932091290132760394976551426E-3L,
- -6.529469780539591572179155511840853077232E-2L,
- -4.468736064761814602927408833818990271514E-1L,
- -1.556391252586395038089729428444444823380E0L,
- -2.533135309840530224072920725976994981638E0L,
- -1.605509621731068453869408718565392869560E0L,
- -2.518966692256192789269859830255724429375E-1L,
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+ L(-2.589155123706348361249809342508270121788E-8),
+ L(-3.746254369796115441118148490849195516593E-6),
+ L(-1.985595497390808544622893738135529701062E-4),
+ L(-5.008253705202932091290132760394976551426E-3),
+ L(-6.529469780539591572179155511840853077232E-2),
+ L(-4.468736064761814602927408833818990271514E-1),
+ L(-1.556391252586395038089729428444444823380E0),
+ L(-2.533135309840530224072920725976994981638E0),
+ L(-1.605509621731068453869408718565392869560E0),
+ L(-2.518966692256192789269859830255724429375E-1),
};
#define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
- 3.682353957237979993646169732962573930237E-7L,
- 5.386741661883067824698973455566332102029E-5L,
- 2.906881154171822780345134853794241037053E-3L,
- 7.545832595801289519475806339863492074126E-2L,
- 1.029405357245594877344360389469584526654E0L,
- 7.565706120589873131187989560509757626725E0L,
- 2.951172890699569545357692207898667665796E1L,
- 5.785723537170311456298467310529815457536E1L,
- 5.095621464598267889126015412522773474467E1L,
- 1.602958484169953109437547474953308401442E1L,
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+ L(3.682353957237979993646169732962573930237E-7),
+ L(5.386741661883067824698973455566332102029E-5),
+ L(2.906881154171822780345134853794241037053E-3),
+ L(7.545832595801289519475806339863492074126E-2),
+ L(1.029405357245594877344360389469584526654E0),
+ L(7.565706120589873131187989560509757626725E0),
+ L(2.951172890699569545357692207898667665796E1),
+ L(5.785723537170311456298467310529815457536E1),
+ L(5.095621464598267889126015412522773474467E1),
+ L(1.602958484169953109437547474953308401442E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -288,29 +288,29 @@ static const long double P3r2_4D[NP3r2_4D + 1] = {
Peak relative error 1.0e-35
0.3125 <= 1/x <= 0.375 */
#define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
- -1.917322340814391131073820537027234322550E-7L,
- -1.966595744473227183846019639723259011906E-5L,
- -7.177081163619679403212623526632690465290E-4L,
- -1.206467373860974695661544653741899755695E-2L,
- -1.008656452188539812154551482286328107316E-1L,
- -4.216016116408810856620947307438823892707E-1L,
- -8.378631013025721741744285026537009814161E-1L,
- -6.973895635309960850033762745957946272579E-1L,
- -1.797864718878320770670740413285763554812E-1L,
- -4.098025357743657347681137871388402849581E-3L,
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+ L(-1.917322340814391131073820537027234322550E-7),
+ L(-1.966595744473227183846019639723259011906E-5),
+ L(-7.177081163619679403212623526632690465290E-4),
+ L(-1.206467373860974695661544653741899755695E-2),
+ L(-1.008656452188539812154551482286328107316E-1),
+ L(-4.216016116408810856620947307438823892707E-1),
+ L(-8.378631013025721741744285026537009814161E-1),
+ L(-6.973895635309960850033762745957946272579E-1),
+ L(-1.797864718878320770670740413285763554812E-1),
+ L(-4.098025357743657347681137871388402849581E-3),
};
#define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
- 2.726858489303036441686496086962545034018E-6L,
- 2.840430827557109238386808968234848081424E-4L,
- 1.063826772041781947891481054529454088832E-2L,
- 1.864775537138364773178044431045514405468E-1L,
- 1.665660052857205170440952607701728254211E0L,
- 7.723745889544331153080842168958348568395E0L,
- 1.810726427571829798856428548102077799835E1L,
- 1.986460672157794440666187503833545388527E1L,
- 8.645503204552282306364296517220055815488E0L,
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+ L(2.726858489303036441686496086962545034018E-6),
+ L(2.840430827557109238386808968234848081424E-4),
+ L(1.063826772041781947891481054529454088832E-2),
+ L(1.864775537138364773178044431045514405468E-1),
+ L(1.665660052857205170440952607701728254211E0),
+ L(7.723745889544331153080842168958348568395E0),
+ L(1.810726427571829798856428548102077799835E1),
+ L(1.986460672157794440666187503833545388527E1),
+ L(8.645503204552282306364296517220055815488E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -318,29 +318,29 @@ static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
Peak relative error 1.3e-36
0.3125 <= 1/x <= 0.4375 */
#define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
- -1.594642785584856746358609622003310312622E-6L,
- -1.323238196302221554194031733595194539794E-4L,
- -3.856087818696874802689922536987100372345E-3L,
- -5.113241710697777193011470733601522047399E-2L,
- -3.334229537209911914449990372942022350558E-1L,
- -1.075703518198127096179198549659283422832E0L,
- -1.634174803414062725476343124267110981807E0L,
- -1.030133247434119595616826842367268304880E0L,
- -1.989811539080358501229347481000707289391E-1L,
- -3.246859189246653459359775001466924610236E-3L,
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+ L(-1.594642785584856746358609622003310312622E-6),
+ L(-1.323238196302221554194031733595194539794E-4),
+ L(-3.856087818696874802689922536987100372345E-3),
+ L(-5.113241710697777193011470733601522047399E-2),
+ L(-3.334229537209911914449990372942022350558E-1),
+ L(-1.075703518198127096179198549659283422832E0),
+ L(-1.634174803414062725476343124267110981807E0),
+ L(-1.030133247434119595616826842367268304880E0),
+ L(-1.989811539080358501229347481000707289391E-1),
+ L(-3.246859189246653459359775001466924610236E-3),
};
#define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
- 2.267936634217251403663034189684284173018E-5L,
- 1.918112982168673386858072491437971732237E-3L,
- 5.771704085468423159125856786653868219522E-2L,
- 8.056124451167969333717642810661498890507E-1L,
- 5.687897967531010276788680634413789328776E0L,
- 2.072596760717695491085444438270778394421E1L,
- 3.801722099819929988585197088613160496684E1L,
- 3.254620235902912339534998592085115836829E1L,
- 1.104847772130720331801884344645060675036E1L,
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+ L(2.267936634217251403663034189684284173018E-5),
+ L(1.918112982168673386858072491437971732237E-3),
+ L(5.771704085468423159125856786653868219522E-2),
+ L(8.056124451167969333717642810661498890507E-1),
+ L(5.687897967531010276788680634413789328776E0),
+ L(2.072596760717695491085444438270778394421E1),
+ L(3.801722099819929988585197088613160496684E1),
+ L(3.254620235902912339534998592085115836829E1),
+ L(1.104847772130720331801884344645060675036E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -348,28 +348,28 @@ static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
Peak relative error 1.2e-35
0.4375 <= 1/x <= 0.5 */
#define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
- -1.001042324337684297465071506097365389123E-4L,
- -6.289034524673365824853547252689991418981E-3L,
- -1.346527918018624234373664526930736205806E-1L,
- -1.268808313614288355444506172560463315102E0L,
- -5.654126123607146048354132115649177406163E0L,
- -1.186649511267312652171775803270911971693E1L,
- -1.094032424931998612551588246779200724257E1L,
- -3.728792136814520055025256353193674625267E0L,
- -3.000348318524471807839934764596331810608E-1L,
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+ L(-1.001042324337684297465071506097365389123E-4),
+ L(-6.289034524673365824853547252689991418981E-3),
+ L(-1.346527918018624234373664526930736205806E-1),
+ L(-1.268808313614288355444506172560463315102E0),
+ L(-5.654126123607146048354132115649177406163E0),
+ L(-1.186649511267312652171775803270911971693E1),
+ L(-1.094032424931998612551588246779200724257E1),
+ L(-3.728792136814520055025256353193674625267E0),
+ L(-3.000348318524471807839934764596331810608E-1),
};
#define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
- 1.423705538269770974803901422532055612980E-3L,
- 9.171476630091439978533535167485230575894E-2L,
- 2.049776318166637248868444600215942828537E0L,
- 2.068970329743769804547326701946144899583E1L,
- 1.025103500560831035592731539565060347709E2L,
- 2.528088049697570728252145557167066708284E2L,
- 2.992160327587558573740271294804830114205E2L,
- 1.540193761146551025832707739468679973036E2L,
- 2.779516701986912132637672140709452502650E1L,
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+ L(1.423705538269770974803901422532055612980E-3),
+ L(9.171476630091439978533535167485230575894E-2),
+ L(2.049776318166637248868444600215942828537E0),
+ L(2.068970329743769804547326701946144899583E1),
+ L(1.025103500560831035592731539565060347709E2),
+ L(2.528088049697570728252145557167066708284E2),
+ L(2.992160327587558573740271294804830114205E2),
+ L(1.540193761146551025832707739468679973036E2),
+ L(2.779516701986912132637672140709452502650E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -378,31 +378,31 @@ static const long double P2_2r3D[NP2_2r3D + 1] = {
Peak relative error 2.2e-35
0 <= 1/x <= .0625 */
#define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
- 2.343640834407975740545326632205999437469E-18L,
- 2.667978112927811452221176781536278257448E-15L,
- 1.178415018484555397390098879501969116536E-12L,
- 2.622049767502719728905924701288614016597E-10L,
- 3.196908059607618864801313380896308968673E-8L,
- 2.179466154171673958770030655199434798494E-6L,
- 8.139959091628545225221976413795645177291E-5L,
- 1.563900725721039825236927137885747138654E-3L,
- 1.355172364265825167113562519307194840307E-2L,
- 3.928058355906967977269780046844768588532E-2L,
- 1.107891967702173292405380993183694932208E-2L,
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+ L(2.343640834407975740545326632205999437469E-18),
+ L(2.667978112927811452221176781536278257448E-15),
+ L(1.178415018484555397390098879501969116536E-12),
+ L(2.622049767502719728905924701288614016597E-10),
+ L(3.196908059607618864801313380896308968673E-8),
+ L(2.179466154171673958770030655199434798494E-6),
+ L(8.139959091628545225221976413795645177291E-5),
+ L(1.563900725721039825236927137885747138654E-3),
+ L(1.355172364265825167113562519307194840307E-2),
+ L(3.928058355906967977269780046844768588532E-2),
+ L(1.107891967702173292405380993183694932208E-2),
};
#define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
- 3.199850952578356211091219295199301766718E-17L,
- 3.652601488020654842194486058637953363918E-14L,
- 1.620179741394865258354608590461839031281E-11L,
- 3.629359209474609630056463248923684371426E-9L,
- 4.473680923894354600193264347733477363305E-7L,
- 3.106368086644715743265603656011050476736E-5L,
- 1.198239259946770604954664925153424252622E-3L,
- 2.446041004004283102372887804475767568272E-2L,
- 2.403235525011860603014707768815113698768E-1L,
- 9.491006790682158612266270665136910927149E-1L,
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+ L(3.199850952578356211091219295199301766718E-17),
+ L(3.652601488020654842194486058637953363918E-14),
+ L(1.620179741394865258354608590461839031281E-11),
+ L(3.629359209474609630056463248923684371426E-9),
+ L(4.473680923894354600193264347733477363305E-7),
+ L(3.106368086644715743265603656011050476736E-5),
+ L(1.198239259946770604954664925153424252622E-3),
+ L(2.446041004004283102372887804475767568272E-2),
+ L(2.403235525011860603014707768815113698768E-1),
+ L(9.491006790682158612266270665136910927149E-1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -411,34 +411,34 @@ static const long double Q16_ID[NQ16_ID + 1] = {
Peak relative error 5.1e-36
0.0625 <= 1/x <= 0.125 */
#define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
- 1.001954266485599464105669390693597125904E-17L,
- 7.545499865295034556206475956620160007849E-15L,
- 2.267838684785673931024792538193202559922E-12L,
- 3.561909705814420373609574999542459912419E-10L,
- 3.216201422768092505214730633842924944671E-8L,
- 1.731194793857907454569364622452058554314E-6L,
- 5.576944613034537050396518509871004586039E-5L,
- 1.051787760316848982655967052985391418146E-3L,
- 1.102852974036687441600678598019883746959E-2L,
- 5.834647019292460494254225988766702933571E-2L,
- 1.290281921604364618912425380717127576529E-1L,
- 7.598886310387075708640370806458926458301E-2L,
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+ L(1.001954266485599464105669390693597125904E-17),
+ L(7.545499865295034556206475956620160007849E-15),
+ L(2.267838684785673931024792538193202559922E-12),
+ L(3.561909705814420373609574999542459912419E-10),
+ L(3.216201422768092505214730633842924944671E-8),
+ L(1.731194793857907454569364622452058554314E-6),
+ L(5.576944613034537050396518509871004586039E-5),
+ L(1.051787760316848982655967052985391418146E-3),
+ L(1.102852974036687441600678598019883746959E-2),
+ L(5.834647019292460494254225988766702933571E-2),
+ L(1.290281921604364618912425380717127576529E-1),
+ L(7.598886310387075708640370806458926458301E-2),
};
#define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
- 1.368001558508338469503329967729951830843E-16L,
- 1.034454121857542147020549303317348297289E-13L,
- 3.128109209247090744354764050629381674436E-11L,
- 4.957795214328501986562102573522064468671E-9L,
- 4.537872468606711261992676606899273588899E-7L,
- 2.493639207101727713192687060517509774182E-5L,
- 8.294957278145328349785532236663051405805E-4L,
- 1.646471258966713577374948205279380115839E-2L,
- 1.878910092770966718491814497982191447073E-1L,
- 1.152641605706170353727903052525652504075E0L,
- 3.383550240669773485412333679367792932235E0L,
- 3.823875252882035706910024716609908473970E0L,
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+ L(1.368001558508338469503329967729951830843E-16),
+ L(1.034454121857542147020549303317348297289E-13),
+ L(3.128109209247090744354764050629381674436E-11),
+ L(4.957795214328501986562102573522064468671E-9),
+ L(4.537872468606711261992676606899273588899E-7),
+ L(2.493639207101727713192687060517509774182E-5),
+ L(8.294957278145328349785532236663051405805E-4),
+ L(1.646471258966713577374948205279380115839E-2),
+ L(1.878910092770966718491814497982191447073E-1),
+ L(1.152641605706170353727903052525652504075E0),
+ L(3.383550240669773485412333679367792932235E0),
+ L(3.823875252882035706910024716609908473970E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -447,32 +447,32 @@ static const long double Q8_16D[NQ8_16D + 1] = {
Peak relative error 3.9e-35
0.125 <= 1/x <= 0.1875 */
#define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
- 1.750399094021293722243426623211733898747E-13L,
- 6.483426211748008735242909236490115050294E-11L,
- 9.279430665656575457141747875716899958373E-9L,
- 6.696634968526907231258534757736576340266E-7L,
- 2.666560823798895649685231292142838188061E-5L,
- 6.025087697259436271271562769707550594540E-4L,
- 7.652807734168613251901945778921336353485E-3L,
- 5.226269002589406461622551452343519078905E-2L,
- 1.748390159751117658969324896330142895079E-1L,
- 2.378188719097006494782174902213083589660E-1L,
- 8.383984859679804095463699702165659216831E-2L,
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+ L(1.750399094021293722243426623211733898747E-13),
+ L(6.483426211748008735242909236490115050294E-11),
+ L(9.279430665656575457141747875716899958373E-9),
+ L(6.696634968526907231258534757736576340266E-7),
+ L(2.666560823798895649685231292142838188061E-5),
+ L(6.025087697259436271271562769707550594540E-4),
+ L(7.652807734168613251901945778921336353485E-3),
+ L(5.226269002589406461622551452343519078905E-2),
+ L(1.748390159751117658969324896330142895079E-1),
+ L(2.378188719097006494782174902213083589660E-1),
+ L(8.383984859679804095463699702165659216831E-2),
};
#define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
- 2.389878229704327939008104855942987615715E-12L,
- 8.926142817142546018703814194987786425099E-10L,
- 1.294065862406745901206588525833274399038E-7L,
- 9.524139899457666250828752185212769682191E-6L,
- 3.908332488377770886091936221573123353489E-4L,
- 9.250427033957236609624199884089916836748E-3L,
- 1.263420066165922645975830877751588421451E-1L,
- 9.692527053860420229711317379861733180654E-1L,
- 3.937813834630430172221329298841520707954E0L,
- 7.603126427436356534498908111445191312181E0L,
- 5.670677653334105479259958485084550934305E0L,
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+ L(2.389878229704327939008104855942987615715E-12),
+ L(8.926142817142546018703814194987786425099E-10),
+ L(1.294065862406745901206588525833274399038E-7),
+ L(9.524139899457666250828752185212769682191E-6),
+ L(3.908332488377770886091936221573123353489E-4),
+ L(9.250427033957236609624199884089916836748E-3),
+ L(1.263420066165922645975830877751588421451E-1),
+ L(9.692527053860420229711317379861733180654E-1),
+ L(3.937813834630430172221329298841520707954E0),
+ L(7.603126427436356534498908111445191312181E0),
+ L(5.670677653334105479259958485084550934305E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -481,31 +481,31 @@ static const long double Q5_8D[NQ5_8D + 1] = {
Peak relative error 3.2e-35
0.1875 <= 1/x <= 0.25 */
#define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
- 2.233870042925895644234072357400122854086E-11L,
- 5.146223225761993222808463878999151699792E-9L,
- 4.459114531468296461688753521109797474523E-7L,
- 1.891397692931537975547242165291668056276E-5L,
- 4.279519145911541776938964806470674565504E-4L,
- 5.275239415656560634702073291768904783989E-3L,
- 3.468698403240744801278238473898432608887E-2L,
- 1.138773146337708415188856882915457888274E-1L,
- 1.622717518946443013587108598334636458955E-1L,
- 7.249040006390586123760992346453034628227E-2L,
- 1.941595365256460232175236758506411486667E-3L,
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+ L(2.233870042925895644234072357400122854086E-11),
+ L(5.146223225761993222808463878999151699792E-9),
+ L(4.459114531468296461688753521109797474523E-7),
+ L(1.891397692931537975547242165291668056276E-5),
+ L(4.279519145911541776938964806470674565504E-4),
+ L(5.275239415656560634702073291768904783989E-3),
+ L(3.468698403240744801278238473898432608887E-2),
+ L(1.138773146337708415188856882915457888274E-1),
+ L(1.622717518946443013587108598334636458955E-1),
+ L(7.249040006390586123760992346453034628227E-2),
+ L(1.941595365256460232175236758506411486667E-3),
};
#define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
- 3.049977232266999249626430127217988047453E-10L,
- 7.120883230531035857746096928889676144099E-8L,
- 6.301786064753734446784637919554359588859E-6L,
- 2.762010530095069598480766869426308077192E-4L,
- 6.572163250572867859316828886203406361251E-3L,
- 8.752566114841221958200215255461843397776E-2L,
- 6.487654992874805093499285311075289932664E-1L,
- 2.576550017826654579451615283022812801435E0L,
- 5.056392229924022835364779562707348096036E0L,
- 4.179770081068251464907531367859072157773E0L,
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+ L(3.049977232266999249626430127217988047453E-10),
+ L(7.120883230531035857746096928889676144099E-8),
+ L(6.301786064753734446784637919554359588859E-6),
+ L(2.762010530095069598480766869426308077192E-4),
+ L(6.572163250572867859316828886203406361251E-3),
+ L(8.752566114841221958200215255461843397776E-2),
+ L(6.487654992874805093499285311075289932664E-1),
+ L(2.576550017826654579451615283022812801435E0),
+ L(5.056392229924022835364779562707348096036E0),
+ L(4.179770081068251464907531367859072157773E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -514,31 +514,31 @@ static const long double Q4_5D[NQ4_5D + 1] = {
Peak relative error 1.4e-36
0.25 <= 1/x <= 0.3125 */
#define NQ3r2_4N 10
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
- 6.126167301024815034423262653066023684411E-10L,
- 1.043969327113173261820028225053598975128E-7L,
- 6.592927270288697027757438170153763220190E-6L,
- 2.009103660938497963095652951912071336730E-4L,
- 3.220543385492643525985862356352195896964E-3L,
- 2.774405975730545157543417650436941650990E-2L,
- 1.258114008023826384487378016636555041129E-1L,
- 2.811724258266902502344701449984698323860E-1L,
- 2.691837665193548059322831687432415014067E-1L,
- 7.949087384900985370683770525312735605034E-2L,
- 1.229509543620976530030153018986910810747E-3L,
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+ L(6.126167301024815034423262653066023684411E-10),
+ L(1.043969327113173261820028225053598975128E-7),
+ L(6.592927270288697027757438170153763220190E-6),
+ L(2.009103660938497963095652951912071336730E-4),
+ L(3.220543385492643525985862356352195896964E-3),
+ L(2.774405975730545157543417650436941650990E-2),
+ L(1.258114008023826384487378016636555041129E-1),
+ L(2.811724258266902502344701449984698323860E-1),
+ L(2.691837665193548059322831687432415014067E-1),
+ L(7.949087384900985370683770525312735605034E-2),
+ L(1.229509543620976530030153018986910810747E-3),
};
#define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
- 8.364260446128475461539941389210166156568E-9L,
- 1.451301850638956578622154585560759862764E-6L,
- 9.431830010924603664244578867057141839463E-5L,
- 3.004105101667433434196388593004526182741E-3L,
- 5.148157397848271739710011717102773780221E-2L,
- 4.901089301726939576055285374953887874895E-1L,
- 2.581760991981709901216967665934142240346E0L,
- 7.257105880775059281391729708630912791847E0L,
- 1.006014717326362868007913423810737369312E1L,
- 5.879416600465399514404064187445293212470E0L,
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+ L(8.364260446128475461539941389210166156568E-9),
+ L(1.451301850638956578622154585560759862764E-6),
+ L(9.431830010924603664244578867057141839463E-5),
+ L(3.004105101667433434196388593004526182741E-3),
+ L(5.148157397848271739710011717102773780221E-2),
+ L(4.901089301726939576055285374953887874895E-1),
+ L(2.581760991981709901216967665934142240346E0),
+ L(7.257105880775059281391729708630912791847E0),
+ L(1.006014717326362868007913423810737369312E1),
+ L(5.879416600465399514404064187445293212470E0),
/* 1.000000000000000000000000000000000000000E0*/
};
@@ -547,30 +547,30 @@ static const long double Q3r2_4D[NQ3r2_4D + 1] = {
Peak relative error 3.8e-36
0.3125 <= 1/x <= 0.375 */
#define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
- 7.584861620402450302063691901886141875454E-8L,
- 9.300939338814216296064659459966041794591E-6L,
- 4.112108906197521696032158235392604947895E-4L,
- 8.515168851578898791897038357239630654431E-3L,
- 8.971286321017307400142720556749573229058E-2L,
- 4.885856732902956303343015636331874194498E-1L,
- 1.334506268733103291656253500506406045846E0L,
- 1.681207956863028164179042145803851824654E0L,
- 8.165042692571721959157677701625853772271E-1L,
- 9.805848115375053300608712721986235900715E-2L,
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ L(7.584861620402450302063691901886141875454E-8),
+ L(9.300939338814216296064659459966041794591E-6),
+ L(4.112108906197521696032158235392604947895E-4),
+ L(8.515168851578898791897038357239630654431E-3),
+ L(8.971286321017307400142720556749573229058E-2),
+ L(4.885856732902956303343015636331874194498E-1),
+ L(1.334506268733103291656253500506406045846E0),
+ L(1.681207956863028164179042145803851824654E0),
+ L(8.165042692571721959157677701625853772271E-1),
+ L(9.805848115375053300608712721986235900715E-2),
};
#define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
- 1.035586492113036586458163971239438078160E-6L,
- 1.301999337731768381683593636500979713689E-4L,
- 5.993695702564527062553071126719088859654E-3L,
- 1.321184892887881883489141186815457808785E-1L,
- 1.528766555485015021144963194165165083312E0L,
- 9.561463309176490874525827051566494939295E0L,
- 3.203719484883967351729513662089163356911E1L,
- 5.497294687660930446641539152123568668447E1L,
- 4.391158169390578768508675452986948391118E1L,
- 1.347836630730048077907818943625789418378E1L,
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ L(1.035586492113036586458163971239438078160E-6),
+ L(1.301999337731768381683593636500979713689E-4),
+ L(5.993695702564527062553071126719088859654E-3),
+ L(1.321184892887881883489141186815457808785E-1),
+ L(1.528766555485015021144963194165165083312E0),
+ L(9.561463309176490874525827051566494939295E0),
+ L(3.203719484883967351729513662089163356911E1),
+ L(5.497294687660930446641539152123568668447E1),
+ L(4.391158169390578768508675452986948391118E1),
+ L(1.347836630730048077907818943625789418378E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -579,29 +579,29 @@ static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
Peak relative error 2.2e-35
0.375 <= 1/x <= 0.4375 */
#define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
- 4.455027774980750211349941766420190722088E-7L,
- 4.031998274578520170631601850866780366466E-5L,
- 1.273987274325947007856695677491340636339E-3L,
- 1.818754543377448509897226554179659122873E-2L,
- 1.266748858326568264126353051352269875352E-1L,
- 4.327578594728723821137731555139472880414E-1L,
- 6.892532471436503074928194969154192615359E-1L,
- 4.490775818438716873422163588640262036506E-1L,
- 8.649615949297322440032000346117031581572E-2L,
- 7.261345286655345047417257611469066147561E-4L,
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ L(4.455027774980750211349941766420190722088E-7),
+ L(4.031998274578520170631601850866780366466E-5),
+ L(1.273987274325947007856695677491340636339E-3),
+ L(1.818754543377448509897226554179659122873E-2),
+ L(1.266748858326568264126353051352269875352E-1),
+ L(4.327578594728723821137731555139472880414E-1),
+ L(6.892532471436503074928194969154192615359E-1),
+ L(4.490775818438716873422163588640262036506E-1),
+ L(8.649615949297322440032000346117031581572E-2),
+ L(7.261345286655345047417257611469066147561E-4),
};
#define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
- 6.082600739680555266312417978064954793142E-6L,
- 5.693622538165494742945717226571441747567E-4L,
- 1.901625907009092204458328768129666975975E-2L,
- 2.958689532697857335456896889409923371570E-1L,
- 2.343124711045660081603809437993368799568E0L,
- 9.665894032187458293568704885528192804376E0L,
- 2.035273104990617136065743426322454881353E1L,
- 2.044102010478792896815088858740075165531E1L,
- 8.445937177863155827844146643468706599304E0L,
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ L(6.082600739680555266312417978064954793142E-6),
+ L(5.693622538165494742945717226571441747567E-4),
+ L(1.901625907009092204458328768129666975975E-2),
+ L(2.958689532697857335456896889409923371570E-1),
+ L(2.343124711045660081603809437993368799568E0),
+ L(9.665894032187458293568704885528192804376E0),
+ L(2.035273104990617136065743426322454881353E1),
+ L(2.044102010478792896815088858740075165531E1),
+ L(8.445937177863155827844146643468706599304E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -610,39 +610,39 @@ static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
Peak relative error 3.1e-36
0.4375 <= 1/x <= 0.5 */
#define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
- 2.817566786579768804844367382809101929314E-6L,
- 2.122772176396691634147024348373539744935E-4L,
- 5.501378031780457828919593905395747517585E-3L,
- 6.355374424341762686099147452020466524659E-2L,
- 3.539652320122661637429658698954748337223E-1L,
- 9.571721066119617436343740541777014319695E-1L,
- 1.196258777828426399432550698612171955305E0L,
- 6.069388659458926158392384709893753793967E-1L,
- 9.026746127269713176512359976978248763621E-2L,
- 5.317668723070450235320878117210807236375E-4L,
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+ L(2.817566786579768804844367382809101929314E-6),
+ L(2.122772176396691634147024348373539744935E-4),
+ L(5.501378031780457828919593905395747517585E-3),
+ L(6.355374424341762686099147452020466524659E-2),
+ L(3.539652320122661637429658698954748337223E-1),
+ L(9.571721066119617436343740541777014319695E-1),
+ L(1.196258777828426399432550698612171955305E0),
+ L(6.069388659458926158392384709893753793967E-1),
+ L(9.026746127269713176512359976978248763621E-2),
+ L(5.317668723070450235320878117210807236375E-4),
};
#define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
- 3.846924354014260866793741072933159380158E-5L,
- 3.017562820057704325510067178327449946763E-3L,
- 8.356305620686867949798885808540444210935E-2L,
- 1.068314930499906838814019619594424586273E0L,
- 6.900279623894821067017966573640732685233E0L,
- 2.307667390886377924509090271780839563141E1L,
- 3.921043465412723970791036825401273528513E1L,
- 3.167569478939719383241775717095729233436E1L,
- 1.051023841699200920276198346301543665909E1L,
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+ L(3.846924354014260866793741072933159380158E-5),
+ L(3.017562820057704325510067178327449946763E-3),
+ L(8.356305620686867949798885808540444210935E-2),
+ L(1.068314930499906838814019619594424586273E0),
+ L(6.900279623894821067017966573640732685233E0),
+ L(2.307667390886377924509090271780839563141E1),
+ L(3.921043465412723970791036825401273528513E1),
+ L(3.167569478939719383241775717095729233436E1),
+ L(1.051023841699200920276198346301543665909E1),
/* 1.000000000000000000000000000000000000000E0*/
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -657,10 +657,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -675,31 +675,31 @@ deval (long double x, const long double *p, int n)
/* Bessel function of the first kind, order zero. */
-long double
-__ieee754_j0l (long double x)
+_Float128
+__ieee754_j0l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x == 0.0L)
- return 1.0L;
+ if (x == 0)
+ return 1;
xx = fabsl (x);
- if (xx <= 2.0L)
+ if (xx <= 2)
{
- if (xx < 0x1p-57L)
- return 1.0L;
+ if (xx < L(0x1p-57))
+ return 1;
/* 0 <= x <= 2 */
z = xx * xx;
p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
- p -= 0.25L * z;
- p += 1.0L;
+ p -= L(0.25) * z;
+ p += 1;
return p;
}
@@ -713,7 +713,7 @@ __ieee754_j0l (long double x)
__sincosl (xx, &s, &c);
ss = s - c;
cc = s + c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = -__cosl (xx + xx);
if ((s * c) < 0)
@@ -722,10 +722,10 @@ __ieee754_j0l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
- return ONEOSQPI * cc / __ieee754_sqrtl (xx);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * cc / sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -783,10 +783,10 @@ __ieee754_j0l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * xinv * q;
- q = q - 0.125L * xinv;
- z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+ q = q - L(0.125) * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
return z;
}
strong_alias (__ieee754_j0l, __j0l_finite)
@@ -796,55 +796,50 @@ strong_alias (__ieee754_j0l, __j0l_finite)
Peak absolute error 1.7e-36 (relative where Y0 > 1)
0 <= x <= 2 */
#define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
- -1.062023609591350692692296993537002558155E19L,
- 2.542000883190248639104127452714966858866E19L,
- -1.984190771278515324281415820316054696545E18L,
- 4.982586044371592942465373274440222033891E16L,
- -5.529326354780295177243773419090123407550E14L,
- 3.013431465522152289279088265336861140391E12L,
- -7.959436160727126750732203098982718347785E9L,
- 8.230845651379566339707130644134372793322E6L,
+static const _Float128 Y0_2N[NY0_2N + 1] = {
+ L(-1.062023609591350692692296993537002558155E19),
+ L(2.542000883190248639104127452714966858866E19),
+ L(-1.984190771278515324281415820316054696545E18),
+ L(4.982586044371592942465373274440222033891E16),
+ L(-5.529326354780295177243773419090123407550E14),
+ L(3.013431465522152289279088265336861140391E12),
+ L(-7.959436160727126750732203098982718347785E9),
+ L(8.230845651379566339707130644134372793322E6),
};
#define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
- 1.438972634353286978700329883122253752192E20L,
- 1.856409101981569254247700169486907405500E18L,
- 1.219693352678218589553725579802986255614E16L,
- 5.389428943282838648918475915779958097958E13L,
- 1.774125762108874864433872173544743051653E11L,
- 4.522104832545149534808218252434693007036E8L,
- 8.872187401232943927082914504125234454930E5L,
- 1.251945613186787532055610876304669413955E3L,
+static const _Float128 Y0_2D[NY0_2D + 1] = {
+ L(1.438972634353286978700329883122253752192E20),
+ L(1.856409101981569254247700169486907405500E18),
+ L(1.219693352678218589553725579802986255614E16),
+ L(5.389428943282838648918475915779958097958E13),
+ L(1.774125762108874864433872173544743051653E11),
+ L(4.522104832545149534808218252434693007036E8),
+ L(8.872187401232943927082914504125234454930E5),
+ L(1.251945613186787532055610876304669413955E3),
/* 1.000000000000000000000000000000000000000E0 */
};
-static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+static const _Float128 U0 = L(-7.3804295108687225274343927948483016310862e-02);
/* Bessel function of the second kind, order zero. */
-long double
- __ieee754_y0l(long double x)
+_Float128
+ __ieee754_y0l(_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
{
- if (x != x)
- return x;
- else
- return 0.0L;
- }
- if (x <= 0.0L)
- {
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
- return -HUGE_VALL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
}
xx = fabsl (x);
if (xx <= 0x1p-57)
return U0 + TWOOPI * __ieee754_logl (x);
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
z = xx * xx;
@@ -863,7 +858,7 @@ long double
__sincosl (x, &s, &c);
ss = s - c;
cc = s + c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = -__cosl (x + x);
if ((s * c) < 0)
@@ -872,10 +867,10 @@ long double
ss = z / cc;
}
- if (xx > 0x1p256L)
- return ONEOSQPI * ss / __ieee754_sqrtl (x);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * ss / sqrtl (x);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -933,10 +928,10 @@ long double
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * xinv * q;
- q = q - 0.125L * xinv;
- z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
+ q = q - L(0.125) * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
return z;
}
strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index f5b04c073d..e6f46f52e9 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -98,36 +98,37 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* 1 / sqrt(pi) */
-static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
/* 2 / pi */
-static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
-static const long double zero = 0.0L;
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
/* J1(x) = .5x + x x^2 R(x^2)
Peak relative error 1.9e-35
0 <= x <= 2 */
#define NJ0_2N 6
-static const long double J0_2N[NJ0_2N + 1] = {
- -5.943799577386942855938508697619735179660E16L,
- 1.812087021305009192259946997014044074711E15L,
- -2.761698314264509665075127515729146460895E13L,
- 2.091089497823600978949389109350658815972E11L,
- -8.546413231387036372945453565654130054307E8L,
- 1.797229225249742247475464052741320612261E6L,
- -1.559552840946694171346552770008812083969E3L
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+ L(-5.943799577386942855938508697619735179660E16),
+ L(1.812087021305009192259946997014044074711E15),
+ L(-2.761698314264509665075127515729146460895E13),
+ L(2.091089497823600978949389109350658815972E11),
+ L(-8.546413231387036372945453565654130054307E8),
+ L(1.797229225249742247475464052741320612261E6),
+ L(-1.559552840946694171346552770008812083969E3)
};
#define NJ0_2D 6
-static const long double J0_2D[NJ0_2D + 1] = {
- 9.510079323819108569501613916191477479397E17L,
- 1.063193817503280529676423936545854693915E16L,
- 5.934143516050192600795972192791775226920E13L,
- 2.168000911950620999091479265214368352883E11L,
- 5.673775894803172808323058205986256928794E8L,
- 1.080329960080981204840966206372671147224E6L,
- 1.411951256636576283942477881535283304912E3L,
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+ L(9.510079323819108569501613916191477479397E17),
+ L(1.063193817503280529676423936545854693915E16),
+ L(5.934143516050192600795972192791775226920E13),
+ L(2.168000911950620999091479265214368352883E11),
+ L(5.673775894803172808323058205986256928794E8),
+ L(1.080329960080981204840966206372671147224E6),
+ L(1.411951256636576283942477881535283304912E3),
/* 1.000000000000000000000000000000000000000E0L */
};
@@ -135,30 +136,30 @@ static const long double J0_2D[NJ0_2D + 1] = {
0 <= 1/x <= .0625
Peak relative error 3.6e-36 */
#define NP16_IN 9
-static const long double P16_IN[NP16_IN + 1] = {
- 5.143674369359646114999545149085139822905E-16L,
- 4.836645664124562546056389268546233577376E-13L,
- 1.730945562285804805325011561498453013673E-10L,
- 3.047976856147077889834905908605310585810E-8L,
- 2.855227609107969710407464739188141162386E-6L,
- 1.439362407936705484122143713643023998457E-4L,
- 3.774489768532936551500999699815873422073E-3L,
- 4.723962172984642566142399678920790598426E-2L,
- 2.359289678988743939925017240478818248735E-1L,
- 3.032580002220628812728954785118117124520E-1L,
+static const _Float128 P16_IN[NP16_IN + 1] = {
+ L(5.143674369359646114999545149085139822905E-16),
+ L(4.836645664124562546056389268546233577376E-13),
+ L(1.730945562285804805325011561498453013673E-10),
+ L(3.047976856147077889834905908605310585810E-8),
+ L(2.855227609107969710407464739188141162386E-6),
+ L(1.439362407936705484122143713643023998457E-4),
+ L(3.774489768532936551500999699815873422073E-3),
+ L(4.723962172984642566142399678920790598426E-2),
+ L(2.359289678988743939925017240478818248735E-1),
+ L(3.032580002220628812728954785118117124520E-1),
};
#define NP16_ID 9
-static const long double P16_ID[NP16_ID + 1] = {
- 4.389268795186898018132945193912677177553E-15L,
- 4.132671824807454334388868363256830961655E-12L,
- 1.482133328179508835835963635130894413136E-9L,
- 2.618941412861122118906353737117067376236E-7L,
- 2.467854246740858470815714426201888034270E-5L,
- 1.257192927368839847825938545925340230490E-3L,
- 3.362739031941574274949719324644120720341E-2L,
- 4.384458231338934105875343439265370178858E-1L,
- 2.412830809841095249170909628197264854651E0L,
- 4.176078204111348059102962617368214856874E0L,
+static const _Float128 P16_ID[NP16_ID + 1] = {
+ L(4.389268795186898018132945193912677177553E-15),
+ L(4.132671824807454334388868363256830961655E-12),
+ L(1.482133328179508835835963635130894413136E-9),
+ L(2.618941412861122118906353737117067376236E-7),
+ L(2.467854246740858470815714426201888034270E-5),
+ L(1.257192927368839847825938545925340230490E-3),
+ L(3.362739031941574274949719324644120720341E-2),
+ L(4.384458231338934105875343439265370178858E-1),
+ L(2.412830809841095249170909628197264854651E0),
+ L(4.176078204111348059102962617368214856874E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -166,33 +167,33 @@ static const long double P16_ID[NP16_ID + 1] = {
0.0625 <= 1/x <= 0.125
Peak relative error 1.9e-36 */
#define NP8_16N 11
-static const long double P8_16N[NP8_16N + 1] = {
- 2.984612480763362345647303274082071598135E-16L,
- 1.923651877544126103941232173085475682334E-13L,
- 4.881258879388869396043760693256024307743E-11L,
- 6.368866572475045408480898921866869811889E-9L,
- 4.684818344104910450523906967821090796737E-7L,
- 2.005177298271593587095982211091300382796E-5L,
- 4.979808067163957634120681477207147536182E-4L,
- 6.946005761642579085284689047091173581127E-3L,
- 5.074601112955765012750207555985299026204E-2L,
- 1.698599455896180893191766195194231825379E-1L,
- 1.957536905259237627737222775573623779638E-1L,
- 2.991314703282528370270179989044994319374E-2L,
+static const _Float128 P8_16N[NP8_16N + 1] = {
+ L(2.984612480763362345647303274082071598135E-16),
+ L(1.923651877544126103941232173085475682334E-13),
+ L(4.881258879388869396043760693256024307743E-11),
+ L(6.368866572475045408480898921866869811889E-9),
+ L(4.684818344104910450523906967821090796737E-7),
+ L(2.005177298271593587095982211091300382796E-5),
+ L(4.979808067163957634120681477207147536182E-4),
+ L(6.946005761642579085284689047091173581127E-3),
+ L(5.074601112955765012750207555985299026204E-2),
+ L(1.698599455896180893191766195194231825379E-1),
+ L(1.957536905259237627737222775573623779638E-1),
+ L(2.991314703282528370270179989044994319374E-2),
};
#define NP8_16D 10
-static const long double P8_16D[NP8_16D + 1] = {
- 2.546869316918069202079580939942463010937E-15L,
- 1.644650111942455804019788382157745229955E-12L,
- 4.185430770291694079925607420808011147173E-10L,
- 5.485331966975218025368698195861074143153E-8L,
- 4.062884421686912042335466327098932678905E-6L,
- 1.758139661060905948870523641319556816772E-4L,
- 4.445143889306356207566032244985607493096E-3L,
- 6.391901016293512632765621532571159071158E-2L,
- 4.933040207519900471177016015718145795434E-1L,
- 1.839144086168947712971630337250761842976E0L,
- 2.715120873995490920415616716916149586579E0L,
+static const _Float128 P8_16D[NP8_16D + 1] = {
+ L(2.546869316918069202079580939942463010937E-15),
+ L(1.644650111942455804019788382157745229955E-12),
+ L(4.185430770291694079925607420808011147173E-10),
+ L(5.485331966975218025368698195861074143153E-8),
+ L(4.062884421686912042335466327098932678905E-6),
+ L(1.758139661060905948870523641319556816772E-4),
+ L(4.445143889306356207566032244985607493096E-3),
+ L(6.391901016293512632765621532571159071158E-2),
+ L(4.933040207519900471177016015718145795434E-1),
+ L(1.839144086168947712971630337250761842976E0),
+ L(2.715120873995490920415616716916149586579E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -200,32 +201,32 @@ static const long double P8_16D[NP8_16D + 1] = {
0.125 <= 1/x <= 0.1875
Peak relative error 1.3e-36 */
#define NP5_8N 10
-static const long double P5_8N[NP5_8N + 1] = {
- 2.837678373978003452653763806968237227234E-12L,
- 9.726641165590364928442128579282742354806E-10L,
- 1.284408003604131382028112171490633956539E-7L,
- 8.524624695868291291250573339272194285008E-6L,
- 3.111516908953172249853673787748841282846E-4L,
- 6.423175156126364104172801983096596409176E-3L,
- 7.430220589989104581004416356260692450652E-2L,
- 4.608315409833682489016656279567605536619E-1L,
- 1.396870223510964882676225042258855977512E0L,
- 1.718500293904122365894630460672081526236E0L,
- 5.465927698800862172307352821870223855365E-1L
+static const _Float128 P5_8N[NP5_8N + 1] = {
+ L(2.837678373978003452653763806968237227234E-12),
+ L(9.726641165590364928442128579282742354806E-10),
+ L(1.284408003604131382028112171490633956539E-7),
+ L(8.524624695868291291250573339272194285008E-6),
+ L(3.111516908953172249853673787748841282846E-4),
+ L(6.423175156126364104172801983096596409176E-3),
+ L(7.430220589989104581004416356260692450652E-2),
+ L(4.608315409833682489016656279567605536619E-1),
+ L(1.396870223510964882676225042258855977512E0),
+ L(1.718500293904122365894630460672081526236E0),
+ L(5.465927698800862172307352821870223855365E-1)
};
#define NP5_8D 10
-static const long double P5_8D[NP5_8D + 1] = {
- 2.421485545794616609951168511612060482715E-11L,
- 8.329862750896452929030058039752327232310E-9L,
- 1.106137992233383429630592081375289010720E-6L,
- 7.405786153760681090127497796448503306939E-5L,
- 2.740364785433195322492093333127633465227E-3L,
- 5.781246470403095224872243564165254652198E-2L,
- 6.927711353039742469918754111511109983546E-1L,
- 4.558679283460430281188304515922826156690E0L,
- 1.534468499844879487013168065728837900009E1L,
- 2.313927430889218597919624843161569422745E1L,
- 1.194506341319498844336768473218382828637E1L,
+static const _Float128 P5_8D[NP5_8D + 1] = {
+ L(2.421485545794616609951168511612060482715E-11),
+ L(8.329862750896452929030058039752327232310E-9),
+ L(1.106137992233383429630592081375289010720E-6),
+ L(7.405786153760681090127497796448503306939E-5),
+ L(2.740364785433195322492093333127633465227E-3),
+ L(5.781246470403095224872243564165254652198E-2),
+ L(6.927711353039742469918754111511109983546E-1),
+ L(4.558679283460430281188304515922826156690E0),
+ L(1.534468499844879487013168065728837900009E1),
+ L(2.313927430889218597919624843161569422745E1),
+ L(1.194506341319498844336768473218382828637E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -233,31 +234,31 @@ static const long double P5_8D[NP5_8D + 1] = {
Peak relative error 1.4e-36
0.1875 <= 1/x <= 0.25 */
#define NP4_5N 10
-static const long double P4_5N[NP4_5N + 1] = {
- 1.846029078268368685834261260420933914621E-10L,
- 3.916295939611376119377869680335444207768E-8L,
- 3.122158792018920627984597530935323997312E-6L,
- 1.218073444893078303994045653603392272450E-4L,
- 2.536420827983485448140477159977981844883E-3L,
- 2.883011322006690823959367922241169171315E-2L,
- 1.755255190734902907438042414495469810830E-1L,
- 5.379317079922628599870898285488723736599E-1L,
- 7.284904050194300773890303361501726561938E-1L,
- 3.270110346613085348094396323925000362813E-1L,
- 1.804473805689725610052078464951722064757E-2L,
+static const _Float128 P4_5N[NP4_5N + 1] = {
+ L(1.846029078268368685834261260420933914621E-10),
+ L(3.916295939611376119377869680335444207768E-8),
+ L(3.122158792018920627984597530935323997312E-6),
+ L(1.218073444893078303994045653603392272450E-4),
+ L(2.536420827983485448140477159977981844883E-3),
+ L(2.883011322006690823959367922241169171315E-2),
+ L(1.755255190734902907438042414495469810830E-1),
+ L(5.379317079922628599870898285488723736599E-1),
+ L(7.284904050194300773890303361501726561938E-1),
+ L(3.270110346613085348094396323925000362813E-1),
+ L(1.804473805689725610052078464951722064757E-2),
};
#define NP4_5D 9
-static const long double P4_5D[NP4_5D + 1] = {
- 1.575278146806816970152174364308980863569E-9L,
- 3.361289173657099516191331123405675054321E-7L,
- 2.704692281550877810424745289838790693708E-5L,
- 1.070854930483999749316546199273521063543E-3L,
- 2.282373093495295842598097265627962125411E-2L,
- 2.692025460665354148328762368240343249830E-1L,
- 1.739892942593664447220951225734811133759E0L,
- 5.890727576752230385342377570386657229324E0L,
- 9.517442287057841500750256954117735128153E0L,
- 6.100616353935338240775363403030137736013E0L,
+static const _Float128 P4_5D[NP4_5D + 1] = {
+ L(1.575278146806816970152174364308980863569E-9),
+ L(3.361289173657099516191331123405675054321E-7),
+ L(2.704692281550877810424745289838790693708E-5),
+ L(1.070854930483999749316546199273521063543E-3),
+ L(2.282373093495295842598097265627962125411E-2),
+ L(2.692025460665354148328762368240343249830E-1),
+ L(1.739892942593664447220951225734811133759E0),
+ L(5.890727576752230385342377570386657229324E0),
+ L(9.517442287057841500750256954117735128153E0),
+ L(6.100616353935338240775363403030137736013E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -265,30 +266,30 @@ static const long double P4_5D[NP4_5D + 1] = {
Peak relative error 3.0e-36
0.25 <= 1/x <= 0.3125 */
#define NP3r2_4N 9
-static const long double P3r2_4N[NP3r2_4N + 1] = {
- 8.240803130988044478595580300846665863782E-8L,
- 1.179418958381961224222969866406483744580E-5L,
- 6.179787320956386624336959112503824397755E-4L,
- 1.540270833608687596420595830747166658383E-2L,
- 1.983904219491512618376375619598837355076E-1L,
- 1.341465722692038870390470651608301155565E0L,
- 4.617865326696612898792238245990854646057E0L,
- 7.435574801812346424460233180412308000587E0L,
- 4.671327027414635292514599201278557680420E0L,
- 7.299530852495776936690976966995187714739E-1L,
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+ L(8.240803130988044478595580300846665863782E-8),
+ L(1.179418958381961224222969866406483744580E-5),
+ L(6.179787320956386624336959112503824397755E-4),
+ L(1.540270833608687596420595830747166658383E-2),
+ L(1.983904219491512618376375619598837355076E-1),
+ L(1.341465722692038870390470651608301155565E0),
+ L(4.617865326696612898792238245990854646057E0),
+ L(7.435574801812346424460233180412308000587E0),
+ L(4.671327027414635292514599201278557680420E0),
+ L(7.299530852495776936690976966995187714739E-1),
};
#define NP3r2_4D 9
-static const long double P3r2_4D[NP3r2_4D + 1] = {
- 7.032152009675729604487575753279187576521E-7L,
- 1.015090352324577615777511269928856742848E-4L,
- 5.394262184808448484302067955186308730620E-3L,
- 1.375291438480256110455809354836988584325E-1L,
- 1.836247144461106304788160919310404376670E0L,
- 1.314378564254376655001094503090935880349E1L,
- 4.957184590465712006934452500894672343488E1L,
- 9.287394244300647738855415178790263465398E1L,
- 7.652563275535900609085229286020552768399E1L,
- 2.147042473003074533150718117770093209096E1L,
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+ L(7.032152009675729604487575753279187576521E-7),
+ L(1.015090352324577615777511269928856742848E-4),
+ L(5.394262184808448484302067955186308730620E-3),
+ L(1.375291438480256110455809354836988584325E-1),
+ L(1.836247144461106304788160919310404376670E0),
+ L(1.314378564254376655001094503090935880349E1),
+ L(4.957184590465712006934452500894672343488E1),
+ L(9.287394244300647738855415178790263465398E1),
+ L(7.652563275535900609085229286020552768399E1),
+ L(2.147042473003074533150718117770093209096E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -296,29 +297,29 @@ static const long double P3r2_4D[NP3r2_4D + 1] = {
Peak relative error 1.0e-35
0.3125 <= 1/x <= 0.375 */
#define NP2r7_3r2N 9
-static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
- 4.599033469240421554219816935160627085991E-7L,
- 4.665724440345003914596647144630893997284E-5L,
- 1.684348845667764271596142716944374892756E-3L,
- 2.802446446884455707845985913454440176223E-2L,
- 2.321937586453963310008279956042545173930E-1L,
- 9.640277413988055668692438709376437553804E-1L,
- 1.911021064710270904508663334033003246028E0L,
- 1.600811610164341450262992138893970224971E0L,
- 4.266299218652587901171386591543457861138E-1L,
- 1.316470424456061252962568223251247207325E-2L,
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+ L(4.599033469240421554219816935160627085991E-7),
+ L(4.665724440345003914596647144630893997284E-5),
+ L(1.684348845667764271596142716944374892756E-3),
+ L(2.802446446884455707845985913454440176223E-2),
+ L(2.321937586453963310008279956042545173930E-1),
+ L(9.640277413988055668692438709376437553804E-1),
+ L(1.911021064710270904508663334033003246028E0),
+ L(1.600811610164341450262992138893970224971E0),
+ L(4.266299218652587901171386591543457861138E-1),
+ L(1.316470424456061252962568223251247207325E-2),
};
#define NP2r7_3r2D 8
-static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
- 3.924508608545520758883457108453520099610E-6L,
- 4.029707889408829273226495756222078039823E-4L,
- 1.484629715787703260797886463307469600219E-2L,
- 2.553136379967180865331706538897231588685E-1L,
- 2.229457223891676394409880026887106228740E0L,
- 1.005708903856384091956550845198392117318E1L,
- 2.277082659664386953166629360352385889558E1L,
- 2.384726835193630788249826630376533988245E1L,
- 9.700989749041320895890113781610939632410E0L,
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+ L(3.924508608545520758883457108453520099610E-6),
+ L(4.029707889408829273226495756222078039823E-4),
+ L(1.484629715787703260797886463307469600219E-2),
+ L(2.553136379967180865331706538897231588685E-1),
+ L(2.229457223891676394409880026887106228740E0),
+ L(1.005708903856384091956550845198392117318E1),
+ L(2.277082659664386953166629360352385889558E1),
+ L(2.384726835193630788249826630376533988245E1),
+ L(9.700989749041320895890113781610939632410E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -326,29 +327,29 @@ static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
Peak relative error 1.7e-36
0.3125 <= 1/x <= 0.4375 */
#define NP2r3_2r7N 9
-static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
- 3.916766777108274628543759603786857387402E-6L,
- 3.212176636756546217390661984304645137013E-4L,
- 9.255768488524816445220126081207248947118E-3L,
- 1.214853146369078277453080641911700735354E-1L,
- 7.855163309847214136198449861311404633665E-1L,
- 2.520058073282978403655488662066019816540E0L,
- 3.825136484837545257209234285382183711466E0L,
- 2.432569427554248006229715163865569506873E0L,
- 4.877934835018231178495030117729800489743E-1L,
- 1.109902737860249670981355149101343427885E-2L,
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+ L(3.916766777108274628543759603786857387402E-6),
+ L(3.212176636756546217390661984304645137013E-4),
+ L(9.255768488524816445220126081207248947118E-3),
+ L(1.214853146369078277453080641911700735354E-1),
+ L(7.855163309847214136198449861311404633665E-1),
+ L(2.520058073282978403655488662066019816540E0),
+ L(3.825136484837545257209234285382183711466E0),
+ L(2.432569427554248006229715163865569506873E0),
+ L(4.877934835018231178495030117729800489743E-1),
+ L(1.109902737860249670981355149101343427885E-2),
};
#define NP2r3_2r7D 8
-static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
- 3.342307880794065640312646341190547184461E-5L,
- 2.782182891138893201544978009012096558265E-3L,
- 8.221304931614200702142049236141249929207E-2L,
- 1.123728246291165812392918571987858010949E0L,
- 7.740482453652715577233858317133423434590E0L,
- 2.737624677567945952953322566311201919139E1L,
- 4.837181477096062403118304137851260715475E1L,
- 3.941098643468580791437772701093795299274E1L,
- 1.245821247166544627558323920382547533630E1L,
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+ L(3.342307880794065640312646341190547184461E-5),
+ L(2.782182891138893201544978009012096558265E-3),
+ L(8.221304931614200702142049236141249929207E-2),
+ L(1.123728246291165812392918571987858010949E0),
+ L(7.740482453652715577233858317133423434590E0),
+ L(2.737624677567945952953322566311201919139E1),
+ L(4.837181477096062403118304137851260715475E1),
+ L(3.941098643468580791437772701093795299274E1),
+ L(1.245821247166544627558323920382547533630E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -356,28 +357,28 @@ static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
Peak relative error 1.7e-35
0.4375 <= 1/x <= 0.5 */
#define NP2_2r3N 8
-static const long double P2_2r3N[NP2_2r3N + 1] = {
- 3.397930802851248553545191160608731940751E-4L,
- 2.104020902735482418784312825637833698217E-2L,
- 4.442291771608095963935342749477836181939E-1L,
- 4.131797328716583282869183304291833754967E0L,
- 1.819920169779026500146134832455189917589E1L,
- 3.781779616522937565300309684282401791291E1L,
- 3.459605449728864218972931220783543410347E1L,
- 1.173594248397603882049066603238568316561E1L,
- 9.455702270242780642835086549285560316461E-1L,
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+ L(3.397930802851248553545191160608731940751E-4),
+ L(2.104020902735482418784312825637833698217E-2),
+ L(4.442291771608095963935342749477836181939E-1),
+ L(4.131797328716583282869183304291833754967E0),
+ L(1.819920169779026500146134832455189917589E1),
+ L(3.781779616522937565300309684282401791291E1),
+ L(3.459605449728864218972931220783543410347E1),
+ L(1.173594248397603882049066603238568316561E1),
+ L(9.455702270242780642835086549285560316461E-1),
};
#define NP2_2r3D 8
-static const long double P2_2r3D[NP2_2r3D + 1] = {
- 2.899568897241432883079888249845707400614E-3L,
- 1.831107138190848460767699919531132426356E-1L,
- 3.999350044057883839080258832758908825165E0L,
- 3.929041535867957938340569419874195303712E1L,
- 1.884245613422523323068802689915538908291E2L,
- 4.461469948819229734353852978424629815929E2L,
- 5.004998753999796821224085972610636347903E2L,
- 2.386342520092608513170837883757163414100E2L,
- 3.791322528149347975999851588922424189957E1L,
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+ L(2.899568897241432883079888249845707400614E-3),
+ L(1.831107138190848460767699919531132426356E-1),
+ L(3.999350044057883839080258832758908825165E0),
+ L(3.929041535867957938340569419874195303712E1),
+ L(1.884245613422523323068802689915538908291E2),
+ L(4.461469948819229734353852978424629815929E2),
+ L(5.004998753999796821224085972610636347903E2),
+ L(2.386342520092608513170837883757163414100E2),
+ L(3.791322528149347975999851588922424189957E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -386,31 +387,31 @@ static const long double P2_2r3D[NP2_2r3D + 1] = {
Peak relative error 8.0e-36
0 <= 1/x <= .0625 */
#define NQ16_IN 10
-static const long double Q16_IN[NQ16_IN + 1] = {
- -3.917420835712508001321875734030357393421E-18L,
- -4.440311387483014485304387406538069930457E-15L,
- -1.951635424076926487780929645954007139616E-12L,
- -4.318256438421012555040546775651612810513E-10L,
- -5.231244131926180765270446557146989238020E-8L,
- -3.540072702902043752460711989234732357653E-6L,
- -1.311017536555269966928228052917534882984E-4L,
- -2.495184669674631806622008769674827575088E-3L,
- -2.141868222987209028118086708697998506716E-2L,
- -6.184031415202148901863605871197272650090E-2L,
- -1.922298704033332356899546792898156493887E-2L,
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+ L(-3.917420835712508001321875734030357393421E-18),
+ L(-4.440311387483014485304387406538069930457E-15),
+ L(-1.951635424076926487780929645954007139616E-12),
+ L(-4.318256438421012555040546775651612810513E-10),
+ L(-5.231244131926180765270446557146989238020E-8),
+ L(-3.540072702902043752460711989234732357653E-6),
+ L(-1.311017536555269966928228052917534882984E-4),
+ L(-2.495184669674631806622008769674827575088E-3),
+ L(-2.141868222987209028118086708697998506716E-2),
+ L(-6.184031415202148901863605871197272650090E-2),
+ L(-1.922298704033332356899546792898156493887E-2),
};
#define NQ16_ID 9
-static const long double Q16_ID[NQ16_ID + 1] = {
- 3.820418034066293517479619763498400162314E-17L,
- 4.340702810799239909648911373329149354911E-14L,
- 1.914985356383416140706179933075303538524E-11L,
- 4.262333682610888819476498617261895474330E-9L,
- 5.213481314722233980346462747902942182792E-7L,
- 3.585741697694069399299005316809954590558E-5L,
- 1.366513429642842006385029778105539457546E-3L,
- 2.745282599850704662726337474371355160594E-2L,
- 2.637644521611867647651200098449903330074E-1L,
- 1.006953426110765984590782655598680488746E0L,
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+ L(3.820418034066293517479619763498400162314E-17),
+ L(4.340702810799239909648911373329149354911E-14),
+ L(1.914985356383416140706179933075303538524E-11),
+ L(4.262333682610888819476498617261895474330E-9),
+ L(5.213481314722233980346462747902942182792E-7),
+ L(3.585741697694069399299005316809954590558E-5),
+ L(1.366513429642842006385029778105539457546E-3),
+ L(2.745282599850704662726337474371355160594E-2),
+ L(2.637644521611867647651200098449903330074E-1),
+ L(1.006953426110765984590782655598680488746E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -419,34 +420,34 @@ static const long double Q16_ID[NQ16_ID + 1] = {
Peak relative error 1.9e-36
0.0625 <= 1/x <= 0.125 */
#define NQ8_16N 11
-static const long double Q8_16N[NQ8_16N + 1] = {
- -2.028630366670228670781362543615221542291E-17L,
- -1.519634620380959966438130374006858864624E-14L,
- -4.540596528116104986388796594639405114524E-12L,
- -7.085151756671466559280490913558388648274E-10L,
- -6.351062671323970823761883833531546885452E-8L,
- -3.390817171111032905297982523519503522491E-6L,
- -1.082340897018886970282138836861233213972E-4L,
- -2.020120801187226444822977006648252379508E-3L,
- -2.093169910981725694937457070649605557555E-2L,
- -1.092176538874275712359269481414448063393E-1L,
- -2.374790947854765809203590474789108718733E-1L,
- -1.365364204556573800719985118029601401323E-1L,
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+ L(-2.028630366670228670781362543615221542291E-17),
+ L(-1.519634620380959966438130374006858864624E-14),
+ L(-4.540596528116104986388796594639405114524E-12),
+ L(-7.085151756671466559280490913558388648274E-10),
+ L(-6.351062671323970823761883833531546885452E-8),
+ L(-3.390817171111032905297982523519503522491E-6),
+ L(-1.082340897018886970282138836861233213972E-4),
+ L(-2.020120801187226444822977006648252379508E-3),
+ L(-2.093169910981725694937457070649605557555E-2),
+ L(-1.092176538874275712359269481414448063393E-1),
+ L(-2.374790947854765809203590474789108718733E-1),
+ L(-1.365364204556573800719985118029601401323E-1),
};
#define NQ8_16D 11
-static const long double Q8_16D[NQ8_16D + 1] = {
- 1.978397614733632533581207058069628242280E-16L,
- 1.487361156806202736877009608336766720560E-13L,
- 4.468041406888412086042576067133365913456E-11L,
- 7.027822074821007443672290507210594648877E-9L,
- 6.375740580686101224127290062867976007374E-7L,
- 3.466887658320002225888644977076410421940E-5L,
- 1.138625640905289601186353909213719596986E-3L,
- 2.224470799470414663443449818235008486439E-2L,
- 2.487052928527244907490589787691478482358E-1L,
- 1.483927406564349124649083853892380899217E0L,
- 4.182773513276056975777258788903489507705E0L,
- 4.419665392573449746043880892524360870944E0L,
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+ L(1.978397614733632533581207058069628242280E-16),
+ L(1.487361156806202736877009608336766720560E-13),
+ L(4.468041406888412086042576067133365913456E-11),
+ L(7.027822074821007443672290507210594648877E-9),
+ L(6.375740580686101224127290062867976007374E-7),
+ L(3.466887658320002225888644977076410421940E-5),
+ L(1.138625640905289601186353909213719596986E-3),
+ L(2.224470799470414663443449818235008486439E-2),
+ L(2.487052928527244907490589787691478482358E-1),
+ L(1.483927406564349124649083853892380899217E0),
+ L(4.182773513276056975777258788903489507705E0),
+ L(4.419665392573449746043880892524360870944E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -455,32 +456,32 @@ static const long double Q8_16D[NQ8_16D + 1] = {
Peak relative error 1.5e-35
0.125 <= 1/x <= 0.1875 */
#define NQ5_8N 10
-static const long double Q5_8N[NQ5_8N + 1] = {
- -3.656082407740970534915918390488336879763E-13L,
- -1.344660308497244804752334556734121771023E-10L,
- -1.909765035234071738548629788698150760791E-8L,
- -1.366668038160120210269389551283666716453E-6L,
- -5.392327355984269366895210704976314135683E-5L,
- -1.206268245713024564674432357634540343884E-3L,
- -1.515456784370354374066417703736088291287E-2L,
- -1.022454301137286306933217746545237098518E-1L,
- -3.373438906472495080504907858424251082240E-1L,
- -4.510782522110845697262323973549178453405E-1L,
- -1.549000892545288676809660828213589804884E-1L,
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+ L(-3.656082407740970534915918390488336879763E-13),
+ L(-1.344660308497244804752334556734121771023E-10),
+ L(-1.909765035234071738548629788698150760791E-8),
+ L(-1.366668038160120210269389551283666716453E-6),
+ L(-5.392327355984269366895210704976314135683E-5),
+ L(-1.206268245713024564674432357634540343884E-3),
+ L(-1.515456784370354374066417703736088291287E-2),
+ L(-1.022454301137286306933217746545237098518E-1),
+ L(-3.373438906472495080504907858424251082240E-1),
+ L(-4.510782522110845697262323973549178453405E-1),
+ L(-1.549000892545288676809660828213589804884E-1),
};
#define NQ5_8D 10
-static const long double Q5_8D[NQ5_8D + 1] = {
- 3.565550843359501079050699598913828460036E-12L,
- 1.321016015556560621591847454285330528045E-9L,
- 1.897542728662346479999969679234270605975E-7L,
- 1.381720283068706710298734234287456219474E-5L,
- 5.599248147286524662305325795203422873725E-4L,
- 1.305442352653121436697064782499122164843E-2L,
- 1.750234079626943298160445750078631894985E-1L,
- 1.311420542073436520965439883806946678491E0L,
- 5.162757689856842406744504211089724926650E0L,
- 9.527760296384704425618556332087850581308E0L,
- 6.604648207463236667912921642545100248584E0L,
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+ L(3.565550843359501079050699598913828460036E-12),
+ L(1.321016015556560621591847454285330528045E-9),
+ L(1.897542728662346479999969679234270605975E-7),
+ L(1.381720283068706710298734234287456219474E-5),
+ L(5.599248147286524662305325795203422873725E-4),
+ L(1.305442352653121436697064782499122164843E-2),
+ L(1.750234079626943298160445750078631894985E-1),
+ L(1.311420542073436520965439883806946678491E0),
+ L(5.162757689856842406744504211089724926650E0),
+ L(9.527760296384704425618556332087850581308E0),
+ L(6.604648207463236667912921642545100248584E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -489,31 +490,31 @@ static const long double Q5_8D[NQ5_8D + 1] = {
Peak relative error 1.3e-35
0.1875 <= 1/x <= 0.25 */
#define NQ4_5N 10
-static const long double Q4_5N[NQ4_5N + 1] = {
- -4.079513568708891749424783046520200903755E-11L,
- -9.326548104106791766891812583019664893311E-9L,
- -8.016795121318423066292906123815687003356E-7L,
- -3.372350544043594415609295225664186750995E-5L,
- -7.566238665947967882207277686375417983917E-4L,
- -9.248861580055565402130441618521591282617E-3L,
- -6.033106131055851432267702948850231270338E-2L,
- -1.966908754799996793730369265431584303447E-1L,
- -2.791062741179964150755788226623462207560E-1L,
- -1.255478605849190549914610121863534191666E-1L,
- -4.320429862021265463213168186061696944062E-3L,
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+ L(-4.079513568708891749424783046520200903755E-11),
+ L(-9.326548104106791766891812583019664893311E-9),
+ L(-8.016795121318423066292906123815687003356E-7),
+ L(-3.372350544043594415609295225664186750995E-5),
+ L(-7.566238665947967882207277686375417983917E-4),
+ L(-9.248861580055565402130441618521591282617E-3),
+ L(-6.033106131055851432267702948850231270338E-2),
+ L(-1.966908754799996793730369265431584303447E-1),
+ L(-2.791062741179964150755788226623462207560E-1),
+ L(-1.255478605849190549914610121863534191666E-1),
+ L(-4.320429862021265463213168186061696944062E-3),
};
#define NQ4_5D 9
-static const long double Q4_5D[NQ4_5D + 1] = {
- 3.978497042580921479003851216297330701056E-10L,
- 9.203304163828145809278568906420772246666E-8L,
- 8.059685467088175644915010485174545743798E-6L,
- 3.490187375993956409171098277561669167446E-4L,
- 8.189109654456872150100501732073810028829E-3L,
- 1.072572867311023640958725265762483033769E-1L,
- 7.790606862409960053675717185714576937994E-1L,
- 3.016049768232011196434185423512777656328E0L,
- 5.722963851442769787733717162314477949360E0L,
- 4.510527838428473279647251350931380867663E0L,
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+ L(3.978497042580921479003851216297330701056E-10),
+ L(9.203304163828145809278568906420772246666E-8),
+ L(8.059685467088175644915010485174545743798E-6),
+ L(3.490187375993956409171098277561669167446E-4),
+ L(8.189109654456872150100501732073810028829E-3),
+ L(1.072572867311023640958725265762483033769E-1),
+ L(7.790606862409960053675717185714576937994E-1),
+ L(3.016049768232011196434185423512777656328E0),
+ L(5.722963851442769787733717162314477949360E0),
+ L(4.510527838428473279647251350931380867663E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -522,30 +523,30 @@ static const long double Q4_5D[NQ4_5D + 1] = {
Peak relative error 2.1e-35
0.25 <= 1/x <= 0.3125 */
#define NQ3r2_4N 9
-static const long double Q3r2_4N[NQ3r2_4N + 1] = {
- -1.087480809271383885936921889040388133627E-8L,
- -1.690067828697463740906962973479310170932E-6L,
- -9.608064416995105532790745641974762550982E-5L,
- -2.594198839156517191858208513873961837410E-3L,
- -3.610954144421543968160459863048062977822E-2L,
- -2.629866798251843212210482269563961685666E-1L,
- -9.709186825881775885917984975685752956660E-1L,
- -1.667521829918185121727268867619982417317E0L,
- -1.109255082925540057138766105229900943501E0L,
- -1.812932453006641348145049323713469043328E-1L,
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+ L(-1.087480809271383885936921889040388133627E-8),
+ L(-1.690067828697463740906962973479310170932E-6),
+ L(-9.608064416995105532790745641974762550982E-5),
+ L(-2.594198839156517191858208513873961837410E-3),
+ L(-3.610954144421543968160459863048062977822E-2),
+ L(-2.629866798251843212210482269563961685666E-1),
+ L(-9.709186825881775885917984975685752956660E-1),
+ L(-1.667521829918185121727268867619982417317E0),
+ L(-1.109255082925540057138766105229900943501E0),
+ L(-1.812932453006641348145049323713469043328E-1),
};
#define NQ3r2_4D 9
-static const long double Q3r2_4D[NQ3r2_4D + 1] = {
- 1.060552717496912381388763753841473407026E-7L,
- 1.676928002024920520786883649102388708024E-5L,
- 9.803481712245420839301400601140812255737E-4L,
- 2.765559874262309494758505158089249012930E-2L,
- 4.117921827792571791298862613287549140706E-1L,
- 3.323769515244751267093378361930279161413E0L,
- 1.436602494405814164724810151689705353670E1L,
- 3.163087869617098638064881410646782408297E1L,
- 3.198181264977021649489103980298349589419E1L,
- 1.203649258862068431199471076202897823272E1L,
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+ L(1.060552717496912381388763753841473407026E-7),
+ L(1.676928002024920520786883649102388708024E-5),
+ L(9.803481712245420839301400601140812255737E-4),
+ L(2.765559874262309494758505158089249012930E-2),
+ L(4.117921827792571791298862613287549140706E-1),
+ L(3.323769515244751267093378361930279161413E0),
+ L(1.436602494405814164724810151689705353670E1),
+ L(3.163087869617098638064881410646782408297E1),
+ L(3.198181264977021649489103980298349589419E1),
+ L(1.203649258862068431199471076202897823272E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -554,30 +555,30 @@ static const long double Q3r2_4D[NQ3r2_4D + 1] = {
Peak relative error 1.6e-36
0.3125 <= 1/x <= 0.375 */
#define NQ2r7_3r2N 9
-static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
- -1.723405393982209853244278760171643219530E-7L,
- -2.090508758514655456365709712333460087442E-5L,
- -9.140104013370974823232873472192719263019E-4L,
- -1.871349499990714843332742160292474780128E-2L,
- -1.948930738119938669637865956162512983416E-1L,
- -1.048764684978978127908439526343174139788E0L,
- -2.827714929925679500237476105843643064698E0L,
- -3.508761569156476114276988181329773987314E0L,
- -1.669332202790211090973255098624488308989E0L,
- -1.930796319299022954013840684651016077770E-1L,
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ L(-1.723405393982209853244278760171643219530E-7),
+ L(-2.090508758514655456365709712333460087442E-5),
+ L(-9.140104013370974823232873472192719263019E-4),
+ L(-1.871349499990714843332742160292474780128E-2),
+ L(-1.948930738119938669637865956162512983416E-1),
+ L(-1.048764684978978127908439526343174139788E0),
+ L(-2.827714929925679500237476105843643064698E0),
+ L(-3.508761569156476114276988181329773987314E0),
+ L(-1.669332202790211090973255098624488308989E0),
+ L(-1.930796319299022954013840684651016077770E-1),
};
#define NQ2r7_3r2D 9
-static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
- 1.680730662300831976234547482334347983474E-6L,
- 2.084241442440551016475972218719621841120E-4L,
- 9.445316642108367479043541702688736295579E-3L,
- 2.044637889456631896650179477133252184672E-1L,
- 2.316091982244297350829522534435350078205E0L,
- 1.412031891783015085196708811890448488865E1L,
- 4.583830154673223384837091077279595496149E1L,
- 7.549520609270909439885998474045974122261E1L,
- 5.697605832808113367197494052388203310638E1L,
- 1.601496240876192444526383314589371686234E1L,
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ L(1.680730662300831976234547482334347983474E-6),
+ L(2.084241442440551016475972218719621841120E-4),
+ L(9.445316642108367479043541702688736295579E-3),
+ L(2.044637889456631896650179477133252184672E-1),
+ L(2.316091982244297350829522534435350078205E0),
+ L(1.412031891783015085196708811890448488865E1),
+ L(4.583830154673223384837091077279595496149E1),
+ L(7.549520609270909439885998474045974122261E1),
+ L(5.697605832808113367197494052388203310638E1),
+ L(1.601496240876192444526383314589371686234E1),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -586,29 +587,29 @@ static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
Peak relative error 9.5e-36
0.375 <= 1/x <= 0.4375 */
#define NQ2r3_2r7N 9
-static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
- -8.603042076329122085722385914954878953775E-7L,
- -7.701746260451647874214968882605186675720E-5L,
- -2.407932004380727587382493696877569654271E-3L,
- -3.403434217607634279028110636919987224188E-2L,
- -2.348707332185238159192422084985713102877E-1L,
- -7.957498841538254916147095255700637463207E-1L,
- -1.258469078442635106431098063707934348577E0L,
- -8.162415474676345812459353639449971369890E-1L,
- -1.581783890269379690141513949609572806898E-1L,
- -1.890595651683552228232308756569450822905E-3L,
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ L(-8.603042076329122085722385914954878953775E-7),
+ L(-7.701746260451647874214968882605186675720E-5),
+ L(-2.407932004380727587382493696877569654271E-3),
+ L(-3.403434217607634279028110636919987224188E-2),
+ L(-2.348707332185238159192422084985713102877E-1),
+ L(-7.957498841538254916147095255700637463207E-1),
+ L(-1.258469078442635106431098063707934348577E0),
+ L(-8.162415474676345812459353639449971369890E-1),
+ L(-1.581783890269379690141513949609572806898E-1),
+ L(-1.890595651683552228232308756569450822905E-3),
};
#define NQ2r3_2r7D 8
-static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
- 8.390017524798316921170710533381568175665E-6L,
- 7.738148683730826286477254659973968763659E-4L,
- 2.541480810958665794368759558791634341779E-2L,
- 3.878879789711276799058486068562386244873E-1L,
- 3.003783779325811292142957336802456109333E0L,
- 1.206480374773322029883039064575464497400E1L,
- 2.458414064785315978408974662900438351782E1L,
- 2.367237826273668567199042088835448715228E1L,
- 9.231451197519171090875569102116321676763E0L,
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ L(8.390017524798316921170710533381568175665E-6),
+ L(7.738148683730826286477254659973968763659E-4),
+ L(2.541480810958665794368759558791634341779E-2),
+ L(3.878879789711276799058486068562386244873E-1),
+ L(3.003783779325811292142957336802456109333E0),
+ L(1.206480374773322029883039064575464497400E1),
+ L(2.458414064785315978408974662900438351782E1),
+ L(2.367237826273668567199042088835448715228E1),
+ L(9.231451197519171090875569102116321676763E0),
/* 1.000000000000000000000000000000000000000E0 */
};
@@ -617,39 +618,39 @@ static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
Peak relative error 1.4e-36
0.4375 <= 1/x <= 0.5 */
#define NQ2_2r3N 9
-static const long double Q2_2r3N[NQ2_2r3N + 1] = {
- -5.552507516089087822166822364590806076174E-6L,
- -4.135067659799500521040944087433752970297E-4L,
- -1.059928728869218962607068840646564457980E-2L,
- -1.212070036005832342565792241385459023801E-1L,
- -6.688350110633603958684302153362735625156E-1L,
- -1.793587878197360221340277951304429821582E0L,
- -2.225407682237197485644647380483725045326E0L,
- -1.123402135458940189438898496348239744403E0L,
- -1.679187241566347077204805190763597299805E-1L,
- -1.458550613639093752909985189067233504148E-3L,
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+ L(-5.552507516089087822166822364590806076174E-6),
+ L(-4.135067659799500521040944087433752970297E-4),
+ L(-1.059928728869218962607068840646564457980E-2),
+ L(-1.212070036005832342565792241385459023801E-1),
+ L(-6.688350110633603958684302153362735625156E-1),
+ L(-1.793587878197360221340277951304429821582E0),
+ L(-2.225407682237197485644647380483725045326E0),
+ L(-1.123402135458940189438898496348239744403E0),
+ L(-1.679187241566347077204805190763597299805E-1),
+ L(-1.458550613639093752909985189067233504148E-3),
};
#define NQ2_2r3D 8
-static const long double Q2_2r3D[NQ2_2r3D + 1] = {
- 5.415024336507980465169023996403597916115E-5L,
- 4.179246497380453022046357404266022870788E-3L,
- 1.136306384261959483095442402929502368598E-1L,
- 1.422640343719842213484515445393284072830E0L,
- 8.968786703393158374728850922289204805764E0L,
- 2.914542473339246127533384118781216495934E1L,
- 4.781605421020380669870197378210457054685E1L,
- 3.693865837171883152382820584714795072937E1L,
- 1.153220502744204904763115556224395893076E1L,
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+ L(5.415024336507980465169023996403597916115E-5),
+ L(4.179246497380453022046357404266022870788E-3),
+ L(1.136306384261959483095442402929502368598E-1),
+ L(1.422640343719842213484515445393284072830E0),
+ L(8.968786703393158374728850922289204805764E0),
+ L(2.914542473339246127533384118781216495934E1),
+ L(4.781605421020380669870197378210457054685E1),
+ L(3.693865837171883152382820584714795072937E1),
+ L(1.153220502744204904763115556224395893076E1),
/* 1.000000000000000000000000000000000000000E0 */
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -664,10 +665,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -682,35 +683,35 @@ deval (long double x, const long double *p, int n)
/* Bessel function of the first kind, order one. */
-long double
-__ieee754_j1l (long double x)
+_Float128
+__ieee754_j1l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
- return 0.0L;
+ return 0;
}
- if (x == 0.0L)
+ if (x == 0)
return x;
xx = fabsl (x);
- if (xx <= 0x1p-58L)
+ if (xx <= L(0x1p-58))
{
- long double ret = x * 0.5L;
+ _Float128 ret = x * L(0.5);
math_check_force_underflow (ret);
if (ret == 0)
__set_errno (ERANGE);
return ret;
}
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
z = xx * xx;
p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
- p += 0.5L * xx;
+ p += L(0.5) * xx;
if (x < 0)
p = -p;
return p;
@@ -725,7 +726,7 @@ __ieee754_j1l (long double x)
__sincosl (xx, &s, &c);
ss = -s - c;
cc = s - c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = __cosl (xx + xx);
if ((s * c) > 0)
@@ -734,15 +735,15 @@ __ieee754_j1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
+ if (xx > L(0x1p256))
{
- z = ONEOSQPI * cc / __ieee754_sqrtl (xx);
+ z = ONEOSQPI * cc / sqrtl (xx);
if (x < 0)
z = -z;
return z;
}
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -800,10 +801,10 @@ __ieee754_j1l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * q;
- q = q * xinv + 0.375L * xinv;
- z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+ q = q * xinv + L(0.375) * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
if (x < 0)
z = -z;
return z;
@@ -815,49 +816,44 @@ strong_alias (__ieee754_j1l, __j1l_finite)
Peak relative error 6.2e-38
0 <= x <= 2 */
#define NY0_2N 7
-static long double Y0_2N[NY0_2N + 1] = {
- -6.804415404830253804408698161694720833249E19L,
- 1.805450517967019908027153056150465849237E19L,
- -8.065747497063694098810419456383006737312E17L,
- 1.401336667383028259295830955439028236299E16L,
- -1.171654432898137585000399489686629680230E14L,
- 5.061267920943853732895341125243428129150E11L,
- -1.096677850566094204586208610960870217970E9L,
- 9.541172044989995856117187515882879304461E5L,
+static const _Float128 Y0_2N[NY0_2N + 1] = {
+ L(-6.804415404830253804408698161694720833249E19),
+ L(1.805450517967019908027153056150465849237E19),
+ L(-8.065747497063694098810419456383006737312E17),
+ L(1.401336667383028259295830955439028236299E16),
+ L(-1.171654432898137585000399489686629680230E14),
+ L(5.061267920943853732895341125243428129150E11),
+ L(-1.096677850566094204586208610960870217970E9),
+ L(9.541172044989995856117187515882879304461E5),
};
#define NY0_2D 7
-static long double Y0_2D[NY0_2D + 1] = {
- 3.470629591820267059538637461549677594549E20L,
- 4.120796439009916326855848107545425217219E18L,
- 2.477653371652018249749350657387030814542E16L,
- 9.954678543353888958177169349272167762797E13L,
- 2.957927997613630118216218290262851197754E11L,
- 6.748421382188864486018861197614025972118E8L,
- 1.173453425218010888004562071020305709319E6L,
- 1.450335662961034949894009554536003377187E3L,
+static const _Float128 Y0_2D[NY0_2D + 1] = {
+ L(3.470629591820267059538637461549677594549E20),
+ L(4.120796439009916326855848107545425217219E18),
+ L(2.477653371652018249749350657387030814542E16),
+ L(9.954678543353888958177169349272167762797E13),
+ L(2.957927997613630118216218290262851197754E11),
+ L(6.748421382188864486018861197614025972118E8),
+ L(1.173453425218010888004562071020305709319E6),
+ L(1.450335662961034949894009554536003377187E3),
/* 1.000000000000000000000000000000000000000E0 */
};
/* Bessel function of the second kind, order one. */
-long double
-__ieee754_y1l (long double x)
+_Float128
+__ieee754_y1l (_Float128 x)
{
- long double xx, xinv, z, p, q, c, s, cc, ss;
+ _Float128 xx, xinv, z, p, q, c, s, cc, ss;
if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
{
- if (x != x)
- return x;
- else
- return 0.0L;
- }
- if (x <= 0.0L)
- {
- if (x < 0.0L)
+ if (x < 0)
return (zero / (zero * x));
- return -HUGE_VALL + x;
+ return -1 / zero; /* -inf and divide by zero exception. */
}
xx = fabsl (x);
if (xx <= 0x1p-114)
@@ -867,7 +863,7 @@ __ieee754_y1l (long double x)
__set_errno (ERANGE);
return z;
}
- if (xx <= 2.0L)
+ if (xx <= 2)
{
/* 0 <= x <= 2 */
SET_RESTORE_ROUNDL (FE_TONEAREST);
@@ -887,7 +883,7 @@ __ieee754_y1l (long double x)
__sincosl (xx, &s, &c);
ss = -s - c;
cc = s - c;
- if (xx <= LDBL_MAX / 2.0L)
+ if (xx <= LDBL_MAX / 2)
{
z = __cosl (xx + xx);
if ((s * c) > 0)
@@ -896,10 +892,10 @@ __ieee754_y1l (long double x)
ss = z / cc;
}
- if (xx > 0x1p256L)
- return ONEOSQPI * ss / __ieee754_sqrtl (xx);
+ if (xx > L(0x1p256))
+ return ONEOSQPI * ss / sqrtl (xx);
- xinv = 1.0L / xx;
+ xinv = 1 / xx;
z = xinv * xinv;
if (xinv <= 0.25)
{
@@ -957,10 +953,10 @@ __ieee754_y1l (long double x)
q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
}
}
- p = 1.0L + z * p;
+ p = 1 + z * p;
q = z * q;
- q = q * xinv + 0.375L * xinv;
- z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
+ q = q * xinv + L(0.375) * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
return z;
}
strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
index 98669e6e3e..7739eec291 100644
--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
@@ -60,21 +60,22 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-static const long double
- invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
- two = 2.0e0L,
- one = 1.0e0L,
- zero = 0.0L;
+static const _Float128
+ invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
+ two = 2,
+ one = 1,
+ zero = 0;
-long double
-__ieee754_jnl (int n, long double x)
+_Float128
+__ieee754_jnl (int n, _Float128 x)
{
- u_int32_t se;
+ uint32_t se;
int32_t i, ix, sgn;
- long double a, b, temp, di, ret;
- long double z, w;
+ _Float128 a, b, temp, di, ret;
+ _Float128 z, w;
ieee854_long_double_shape_type u;
@@ -108,9 +109,9 @@ __ieee754_jnl (int n, long double x)
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- if (x == 0.0L || ix >= 0x7fff0000) /* if x is 0 or inf */
+ if (x == 0 || ix >= 0x7fff0000) /* if x is 0 or inf */
return sgn == 1 ? -zero : zero;
- else if ((long double) n <= x)
+ else if ((_Float128) n <= x)
{
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
if (ix >= 0x412D0000)
@@ -131,8 +132,8 @@ __ieee754_jnl (int n, long double x)
* 2 -s+c -c-s
* 3 s+c c-s
*/
- long double s;
- long double c;
+ _Float128 s;
+ _Float128 c;
__sincosl (x, &s, &c);
switch (n & 3)
{
@@ -149,7 +150,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -158,7 +159,7 @@ __ieee754_jnl (int n, long double x)
for (i = 1; i < n; i++)
{
temp = b;
- b = b * ((long double) (i + i) / x) - a; /* avoid underflow */
+ b = b * ((_Float128) (i + i) / x) - a; /* avoid underflow */
a = temp;
}
}
@@ -178,7 +179,7 @@ __ieee754_jnl (int n, long double x)
b = temp;
for (a = one, i = 2; i <= n; i++)
{
- a *= (long double) i; /* a = n! */
+ a *= (_Float128) i; /* a = n! */
b *= temp; /* b = (x/2)^n */
}
b = b / a;
@@ -215,16 +216,16 @@ __ieee754_jnl (int n, long double x)
* When Q(k) > 1e17 good for quadruple
*/
/* determine k */
- long double t, v;
- long double q0, q1, h, tmp;
+ _Float128 t, v;
+ _Float128 q0, q1, h, tmp;
int32_t k, m;
- w = (n + n) / (long double) x;
- h = 2.0L / (long double) x;
+ w = (n + n) / (_Float128) x;
+ h = 2 / (_Float128) x;
q0 = w;
z = w + h;
- q1 = w * z - 1.0L;
+ q1 = w * z - 1;
k = 1;
- while (q1 < 1.0e17L)
+ while (q1 < L(1.0e17))
{
k += 1;
z += h;
@@ -249,9 +250,9 @@ __ieee754_jnl (int n, long double x)
v = two / x;
tmp = tmp * __ieee754_logl (fabsl (v * tmp));
- if (tmp < 1.1356523406294143949491931077970765006170e+04L)
+ if (tmp < L(1.1356523406294143949491931077970765006170e+04))
{
- for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+ for (i = n - 1, di = (_Float128) (i + i); i > 0; i--)
{
temp = b;
b *= di;
@@ -262,7 +263,7 @@ __ieee754_jnl (int n, long double x)
}
else
{
- for (i = n - 1, di = (long double) (i + i); i > 0; i--)
+ for (i = n - 1, di = (_Float128) (i + i); i > 0; i--)
{
temp = b;
b *= di;
@@ -270,7 +271,7 @@ __ieee754_jnl (int n, long double x)
a = temp;
di -= two;
/* scale b to avoid spurious overflow */
- if (b > 1e100L)
+ if (b > L(1e100))
{
a /= b;
t /= b;
@@ -306,13 +307,13 @@ __ieee754_jnl (int n, long double x)
}
strong_alias (__ieee754_jnl, __jnl_finite)
-long double
-__ieee754_ynl (int n, long double x)
+_Float128
+__ieee754_ynl (int n, _Float128 x)
{
- u_int32_t se;
+ uint32_t se;
int32_t i, ix;
int32_t sign;
- long double a, b, temp, ret;
+ _Float128 a, b, temp, ret;
ieee854_long_double_shape_type u;
u.value = x;
@@ -325,10 +326,10 @@ __ieee754_ynl (int n, long double x)
if ((u.parts32.w0 & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3)
return x + x;
}
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x == 0.0L)
- return ((n < 0 && (n & 1) != 0) ? 1.0L : -1.0L) / 0.0L;
+ if (x == 0)
+ return ((n < 0 && (n & 1) != 0) ? 1 : -1) / L(0.0);
if (se & 0x80000000)
return zero / (zero * x);
}
@@ -367,8 +368,8 @@ __ieee754_ynl (int n, long double x)
* 2 -s+c -c-s
* 3 s+c c-s
*/
- long double s;
- long double c;
+ _Float128 s;
+ _Float128 c;
__sincosl (x, &s, &c);
switch (n & 3)
{
@@ -385,7 +386,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -397,7 +398,7 @@ __ieee754_ynl (int n, long double x)
for (i = 1; i < n && se != 0xffff0000; i++)
{
temp = b;
- b = ((long double) (i + i) / x) * b - a;
+ b = ((_Float128) (i + i) / x) * b - a;
u.value = b;
se = u.parts32.w0 & 0xffff0000;
a = temp;
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 5b513ea1df..5c50e4616a 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -72,35 +72,31 @@
#include <math_private.h>
#include <float.h>
-static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
-#if LDBL_MANT_DIG == 106
-static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
-#else
-static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
-#endif
-static const long double one = 1.0L;
-static const long double huge = LDBL_MAX;
+static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0);
+static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928);
+static const _Float128 one = 1;
+static const _Float128 huge = LDBL_MAX;
/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
1/x <= 0.0741 (x >= 13.495...)
Peak relative error 1.5e-36 */
-static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
+static const _Float128 ls2pi = L(9.1893853320467274178032973640561763986140E-1);
#define NRASY 12
-static const long double RASY[NRASY + 1] =
+static const _Float128 RASY[NRASY + 1] =
{
- 8.333333333333333333333333333310437112111E-2L,
- -2.777777777777777777777774789556228296902E-3L,
- 7.936507936507936507795933938448586499183E-4L,
- -5.952380952380952041799269756378148574045E-4L,
- 8.417508417507928904209891117498524452523E-4L,
- -1.917526917481263997778542329739806086290E-3L,
- 6.410256381217852504446848671499409919280E-3L,
- -2.955064066900961649768101034477363301626E-2L,
- 1.796402955865634243663453415388336954675E-1L,
- -1.391522089007758553455753477688592767741E0L,
- 1.326130089598399157988112385013829305510E1L,
- -1.420412699593782497803472576479997819149E2L,
- 1.218058922427762808938869872528846787020E3L
+ L(8.333333333333333333333333333310437112111E-2),
+ L(-2.777777777777777777777774789556228296902E-3),
+ L(7.936507936507936507795933938448586499183E-4),
+ L(-5.952380952380952041799269756378148574045E-4),
+ L(8.417508417507928904209891117498524452523E-4),
+ L(-1.917526917481263997778542329739806086290E-3),
+ L(6.410256381217852504446848671499409919280E-3),
+ L(-2.955064066900961649768101034477363301626E-2),
+ L(1.796402955865634243663453415388336954675E-1),
+ L(-1.391522089007758553455753477688592767741E0),
+ L(1.326130089598399157988112385013829305510E1),
+ L(-1.420412699593782497803472576479997819149E2),
+ L(1.218058922427762808938869872528846787020E3)
};
@@ -108,30 +104,30 @@ static const long double RASY[NRASY + 1] =
-0.5 <= x <= 0.5
12.5 <= x+13 <= 13.5
Peak relative error 1.1e-36 */
-static const long double lgam13a = 1.9987213134765625E1L;
-static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
+static const _Float128 lgam13a = L(1.9987213134765625E1);
+static const _Float128 lgam13b = L(1.3608962611495173623870550785125024484248E-6);
#define NRN13 7
-static const long double RN13[NRN13 + 1] =
+static const _Float128 RN13[NRN13 + 1] =
{
- 8.591478354823578150238226576156275285700E11L,
- 2.347931159756482741018258864137297157668E11L,
- 2.555408396679352028680662433943000804616E10L,
- 1.408581709264464345480765758902967123937E9L,
- 4.126759849752613822953004114044451046321E7L,
- 6.133298899622688505854211579222889943778E5L,
- 3.929248056293651597987893340755876578072E3L,
- 6.850783280018706668924952057996075215223E0L
+ L(8.591478354823578150238226576156275285700E11),
+ L(2.347931159756482741018258864137297157668E11),
+ L(2.555408396679352028680662433943000804616E10),
+ L(1.408581709264464345480765758902967123937E9),
+ L(4.126759849752613822953004114044451046321E7),
+ L(6.133298899622688505854211579222889943778E5),
+ L(3.929248056293651597987893340755876578072E3),
+ L(6.850783280018706668924952057996075215223E0)
};
#define NRD13 6
-static const long double RD13[NRD13 + 1] =
+static const _Float128 RD13[NRD13 + 1] =
{
- 3.401225382297342302296607039352935541669E11L,
- 8.756765276918037910363513243563234551784E10L,
- 8.873913342866613213078554180987647243903E9L,
- 4.483797255342763263361893016049310017973E8L,
- 1.178186288833066430952276702931512870676E7L,
- 1.519928623743264797939103740132278337476E5L,
- 7.989298844938119228411117593338850892311E2L
+ L(3.401225382297342302296607039352935541669E11),
+ L(8.756765276918037910363513243563234551784E10),
+ L(8.873913342866613213078554180987647243903E9),
+ L(4.483797255342763263361893016049310017973E8),
+ L(1.178186288833066430952276702931512870676E7),
+ L(1.519928623743264797939103740132278337476E5),
+ L(7.989298844938119228411117593338850892311E2)
/* 1.0E0L */
};
@@ -140,30 +136,30 @@ static const long double RD13[NRD13 + 1] =
-0.5 <= x <= 0.5
11.5 <= x+12 <= 12.5
Peak relative error 4.1e-36 */
-static const long double lgam12a = 1.75023040771484375E1L;
-static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
+static const _Float128 lgam12a = L(1.75023040771484375E1);
+static const _Float128 lgam12b = L(3.7687254483392876529072161996717039575982E-6);
#define NRN12 7
-static const long double RN12[NRN12 + 1] =
+static const _Float128 RN12[NRN12 + 1] =
{
- 4.709859662695606986110997348630997559137E11L,
- 1.398713878079497115037857470168777995230E11L,
- 1.654654931821564315970930093932954900867E10L,
- 9.916279414876676861193649489207282144036E8L,
- 3.159604070526036074112008954113411389879E7L,
- 5.109099197547205212294747623977502492861E5L,
- 3.563054878276102790183396740969279826988E3L,
- 6.769610657004672719224614163196946862747E0L
+ L(4.709859662695606986110997348630997559137E11),
+ L(1.398713878079497115037857470168777995230E11),
+ L(1.654654931821564315970930093932954900867E10),
+ L(9.916279414876676861193649489207282144036E8),
+ L(3.159604070526036074112008954113411389879E7),
+ L(5.109099197547205212294747623977502492861E5),
+ L(3.563054878276102790183396740969279826988E3),
+ L(6.769610657004672719224614163196946862747E0)
};
#define NRD12 6
-static const long double RD12[NRD12 + 1] =
+static const _Float128 RD12[NRD12 + 1] =
{
- 1.928167007860968063912467318985802726613E11L,
- 5.383198282277806237247492369072266389233E10L,
- 5.915693215338294477444809323037871058363E9L,
- 3.241438287570196713148310560147925781342E8L,
- 9.236680081763754597872713592701048455890E6L,
- 1.292246897881650919242713651166596478850E5L,
- 7.366532445427159272584194816076600211171E2L
+ L(1.928167007860968063912467318985802726613E11),
+ L(5.383198282277806237247492369072266389233E10),
+ L(5.915693215338294477444809323037871058363E9),
+ L(3.241438287570196713148310560147925781342E8),
+ L(9.236680081763754597872713592701048455890E6),
+ L(1.292246897881650919242713651166596478850E5),
+ L(7.366532445427159272584194816076600211171E2)
/* 1.0E0L */
};
@@ -172,30 +168,30 @@ static const long double RD12[NRD12 + 1] =
-0.5 <= x <= 0.5
10.5 <= x+11 <= 11.5
Peak relative error 1.8e-35 */
-static const long double lgam11a = 1.5104400634765625E1L;
-static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
+static const _Float128 lgam11a = L(1.5104400634765625E1);
+static const _Float128 lgam11b = L(1.1938309890295225709329251070371882250744E-5);
#define NRN11 7
-static const long double RN11[NRN11 + 1] =
+static const _Float128 RN11[NRN11 + 1] =
{
- 2.446960438029415837384622675816736622795E11L,
- 7.955444974446413315803799763901729640350E10L,
- 1.030555327949159293591618473447420338444E10L,
- 6.765022131195302709153994345470493334946E8L,
- 2.361892792609204855279723576041468347494E7L,
- 4.186623629779479136428005806072176490125E5L,
- 3.202506022088912768601325534149383594049E3L,
- 6.681356101133728289358838690666225691363E0L
+ L(2.446960438029415837384622675816736622795E11),
+ L(7.955444974446413315803799763901729640350E10),
+ L(1.030555327949159293591618473447420338444E10),
+ L(6.765022131195302709153994345470493334946E8),
+ L(2.361892792609204855279723576041468347494E7),
+ L(4.186623629779479136428005806072176490125E5),
+ L(3.202506022088912768601325534149383594049E3),
+ L(6.681356101133728289358838690666225691363E0)
};
#define NRD11 6
-static const long double RD11[NRD11 + 1] =
+static const _Float128 RD11[NRD11 + 1] =
{
- 1.040483786179428590683912396379079477432E11L,
- 3.172251138489229497223696648369823779729E10L,
- 3.806961885984850433709295832245848084614E9L,
- 2.278070344022934913730015420611609620171E8L,
- 7.089478198662651683977290023829391596481E6L,
- 1.083246385105903533237139380509590158658E5L,
- 6.744420991491385145885727942219463243597E2L
+ L(1.040483786179428590683912396379079477432E11),
+ L(3.172251138489229497223696648369823779729E10),
+ L(3.806961885984850433709295832245848084614E9),
+ L(2.278070344022934913730015420611609620171E8),
+ L(7.089478198662651683977290023829391596481E6),
+ L(1.083246385105903533237139380509590158658E5),
+ L(6.744420991491385145885727942219463243597E2)
/* 1.0E0L */
};
@@ -204,31 +200,31 @@ static const long double RD11[NRD11 + 1] =
-0.5 <= x <= 0.5
9.5 <= x+10 <= 10.5
Peak relative error 5.4e-37 */
-static const long double lgam10a = 1.280181884765625E1L;
-static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
+static const _Float128 lgam10a = L(1.280181884765625E1);
+static const _Float128 lgam10b = L(8.6324252196112077178745667061642811492557E-6);
#define NRN10 7
-static const long double RN10[NRN10 + 1] =
+static const _Float128 RN10[NRN10 + 1] =
{
- -1.239059737177249934158597996648808363783E14L,
- -4.725899566371458992365624673357356908719E13L,
- -7.283906268647083312042059082837754850808E12L,
- -5.802855515464011422171165179767478794637E11L,
- -2.532349691157548788382820303182745897298E10L,
- -5.884260178023777312587193693477072061820E8L,
- -6.437774864512125749845840472131829114906E6L,
- -2.350975266781548931856017239843273049384E4L
+ L(-1.239059737177249934158597996648808363783E14),
+ L(-4.725899566371458992365624673357356908719E13),
+ L(-7.283906268647083312042059082837754850808E12),
+ L(-5.802855515464011422171165179767478794637E11),
+ L(-2.532349691157548788382820303182745897298E10),
+ L(-5.884260178023777312587193693477072061820E8),
+ L(-6.437774864512125749845840472131829114906E6),
+ L(-2.350975266781548931856017239843273049384E4)
};
#define NRD10 7
-static const long double RD10[NRD10 + 1] =
+static const _Float128 RD10[NRD10 + 1] =
{
- -5.502645997581822567468347817182347679552E13L,
- -1.970266640239849804162284805400136473801E13L,
- -2.819677689615038489384974042561531409392E12L,
- -2.056105863694742752589691183194061265094E11L,
- -8.053670086493258693186307810815819662078E9L,
- -1.632090155573373286153427982504851867131E8L,
- -1.483575879240631280658077826889223634921E6L,
- -4.002806669713232271615885826373550502510E3L
+ L(-5.502645997581822567468347817182347679552E13),
+ L(-1.970266640239849804162284805400136473801E13),
+ L(-2.819677689615038489384974042561531409392E12),
+ L(-2.056105863694742752589691183194061265094E11),
+ L(-8.053670086493258693186307810815819662078E9),
+ L(-1.632090155573373286153427982504851867131E8),
+ L(-1.483575879240631280658077826889223634921E6),
+ L(-4.002806669713232271615885826373550502510E3)
/* 1.0E0L */
};
@@ -237,31 +233,31 @@ static const long double RD10[NRD10 + 1] =
-0.5 <= x <= 0.5
8.5 <= x+9 <= 9.5
Peak relative error 3.6e-36 */
-static const long double lgam9a = 1.06045989990234375E1L;
-static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
+static const _Float128 lgam9a = L(1.06045989990234375E1);
+static const _Float128 lgam9b = L(3.9037218127284172274007216547549861681400E-6);
#define NRN9 7
-static const long double RN9[NRN9 + 1] =
+static const _Float128 RN9[NRN9 + 1] =
{
- -4.936332264202687973364500998984608306189E13L,
- -2.101372682623700967335206138517766274855E13L,
- -3.615893404644823888655732817505129444195E12L,
- -3.217104993800878891194322691860075472926E11L,
- -1.568465330337375725685439173603032921399E10L,
- -4.073317518162025744377629219101510217761E8L,
- -4.983232096406156139324846656819246974500E6L,
- -2.036280038903695980912289722995505277253E4L
+ L(-4.936332264202687973364500998984608306189E13),
+ L(-2.101372682623700967335206138517766274855E13),
+ L(-3.615893404644823888655732817505129444195E12),
+ L(-3.217104993800878891194322691860075472926E11),
+ L(-1.568465330337375725685439173603032921399E10),
+ L(-4.073317518162025744377629219101510217761E8),
+ L(-4.983232096406156139324846656819246974500E6),
+ L(-2.036280038903695980912289722995505277253E4)
};
#define NRD9 7
-static const long double RD9[NRD9 + 1] =
+static const _Float128 RD9[NRD9 + 1] =
{
- -2.306006080437656357167128541231915480393E13L,
- -9.183606842453274924895648863832233799950E12L,
- -1.461857965935942962087907301194381010380E12L,
- -1.185728254682789754150068652663124298303E11L,
- -5.166285094703468567389566085480783070037E9L,
- -1.164573656694603024184768200787835094317E8L,
- -1.177343939483908678474886454113163527909E6L,
- -3.529391059783109732159524500029157638736E3L
+ L(-2.306006080437656357167128541231915480393E13),
+ L(-9.183606842453274924895648863832233799950E12),
+ L(-1.461857965935942962087907301194381010380E12),
+ L(-1.185728254682789754150068652663124298303E11),
+ L(-5.166285094703468567389566085480783070037E9),
+ L(-1.164573656694603024184768200787835094317E8),
+ L(-1.177343939483908678474886454113163527909E6),
+ L(-3.529391059783109732159524500029157638736E3)
/* 1.0E0L */
};
@@ -270,32 +266,32 @@ static const long double RD9[NRD9 + 1] =
-0.5 <= x <= 0.5
7.5 <= x+8 <= 8.5
Peak relative error 2.4e-37 */
-static const long double lgam8a = 8.525146484375E0L;
-static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
+static const _Float128 lgam8a = L(8.525146484375E0);
+static const _Float128 lgam8b = L(1.4876690414300165531036347125050759667737E-5);
#define NRN8 8
-static const long double RN8[NRN8 + 1] =
+static const _Float128 RN8[NRN8 + 1] =
{
- 6.600775438203423546565361176829139703289E11L,
- 3.406361267593790705240802723914281025800E11L,
- 7.222460928505293914746983300555538432830E10L,
- 8.102984106025088123058747466840656458342E9L,
- 5.157620015986282905232150979772409345927E8L,
- 1.851445288272645829028129389609068641517E7L,
- 3.489261702223124354745894067468953756656E5L,
- 2.892095396706665774434217489775617756014E3L,
- 6.596977510622195827183948478627058738034E0L
+ L(6.600775438203423546565361176829139703289E11),
+ L(3.406361267593790705240802723914281025800E11),
+ L(7.222460928505293914746983300555538432830E10),
+ L(8.102984106025088123058747466840656458342E9),
+ L(5.157620015986282905232150979772409345927E8),
+ L(1.851445288272645829028129389609068641517E7),
+ L(3.489261702223124354745894067468953756656E5),
+ L(2.892095396706665774434217489775617756014E3),
+ L(6.596977510622195827183948478627058738034E0)
};
#define NRD8 7
-static const long double RD8[NRD8 + 1] =
+static const _Float128 RD8[NRD8 + 1] =
{
- 3.274776546520735414638114828622673016920E11L,
- 1.581811207929065544043963828487733970107E11L,
- 3.108725655667825188135393076860104546416E10L,
- 3.193055010502912617128480163681842165730E9L,
- 1.830871482669835106357529710116211541839E8L,
- 5.790862854275238129848491555068073485086E6L,
- 9.305213264307921522842678835618803553589E4L,
- 6.216974105861848386918949336819572333622E2L
+ L(3.274776546520735414638114828622673016920E11),
+ L(1.581811207929065544043963828487733970107E11),
+ L(3.108725655667825188135393076860104546416E10),
+ L(3.193055010502912617128480163681842165730E9),
+ L(1.830871482669835106357529710116211541839E8),
+ L(5.790862854275238129848491555068073485086E6),
+ L(9.305213264307921522842678835618803553589E4),
+ L(6.216974105861848386918949336819572333622E2)
/* 1.0E0L */
};
@@ -304,32 +300,32 @@ static const long double RD8[NRD8 + 1] =
-0.5 <= x <= 0.5
6.5 <= x+7 <= 7.5
Peak relative error 3.2e-36 */
-static const long double lgam7a = 6.5792388916015625E0L;
-static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
+static const _Float128 lgam7a = L(6.5792388916015625E0);
+static const _Float128 lgam7b = L(1.2320408538495060178292903945321122583007E-5);
#define NRN7 8
-static const long double RN7[NRN7 + 1] =
+static const _Float128 RN7[NRN7 + 1] =
{
- 2.065019306969459407636744543358209942213E11L,
- 1.226919919023736909889724951708796532847E11L,
- 2.996157990374348596472241776917953749106E10L,
- 3.873001919306801037344727168434909521030E9L,
- 2.841575255593761593270885753992732145094E8L,
- 1.176342515359431913664715324652399565551E7L,
- 2.558097039684188723597519300356028511547E5L,
- 2.448525238332609439023786244782810774702E3L,
- 6.460280377802030953041566617300902020435E0L
+ L(2.065019306969459407636744543358209942213E11),
+ L(1.226919919023736909889724951708796532847E11),
+ L(2.996157990374348596472241776917953749106E10),
+ L(3.873001919306801037344727168434909521030E9),
+ L(2.841575255593761593270885753992732145094E8),
+ L(1.176342515359431913664715324652399565551E7),
+ L(2.558097039684188723597519300356028511547E5),
+ L(2.448525238332609439023786244782810774702E3),
+ L(6.460280377802030953041566617300902020435E0)
};
#define NRD7 7
-static const long double RD7[NRD7 + 1] =
+static const _Float128 RD7[NRD7 + 1] =
{
- 1.102646614598516998880874785339049304483E11L,
- 6.099297512712715445879759589407189290040E10L,
- 1.372898136289611312713283201112060238351E10L,
- 1.615306270420293159907951633566635172343E9L,
- 1.061114435798489135996614242842561967459E8L,
- 3.845638971184305248268608902030718674691E6L,
- 7.081730675423444975703917836972720495507E4L,
- 5.423122582741398226693137276201344096370E2L
+ L(1.102646614598516998880874785339049304483E11),
+ L(6.099297512712715445879759589407189290040E10),
+ L(1.372898136289611312713283201112060238351E10),
+ L(1.615306270420293159907951633566635172343E9),
+ L(1.061114435798489135996614242842561967459E8),
+ L(3.845638971184305248268608902030718674691E6),
+ L(7.081730675423444975703917836972720495507E4),
+ L(5.423122582741398226693137276201344096370E2)
/* 1.0E0L */
};
@@ -338,33 +334,33 @@ static const long double RD7[NRD7 + 1] =
-0.5 <= x <= 0.5
5.5 <= x+6 <= 6.5
Peak relative error 6.2e-37 */
-static const long double lgam6a = 4.7874908447265625E0L;
-static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
+static const _Float128 lgam6a = L(4.7874908447265625E0);
+static const _Float128 lgam6b = L(8.9805548349424770093452324304839959231517E-7);
#define NRN6 8
-static const long double RN6[NRN6 + 1] =
+static const _Float128 RN6[NRN6 + 1] =
{
- -3.538412754670746879119162116819571823643E13L,
- -2.613432593406849155765698121483394257148E13L,
- -8.020670732770461579558867891923784753062E12L,
- -1.322227822931250045347591780332435433420E12L,
- -1.262809382777272476572558806855377129513E11L,
- -7.015006277027660872284922325741197022467E9L,
- -2.149320689089020841076532186783055727299E8L,
- -3.167210585700002703820077565539658995316E6L,
- -1.576834867378554185210279285358586385266E4L
+ L(-3.538412754670746879119162116819571823643E13),
+ L(-2.613432593406849155765698121483394257148E13),
+ L(-8.020670732770461579558867891923784753062E12),
+ L(-1.322227822931250045347591780332435433420E12),
+ L(-1.262809382777272476572558806855377129513E11),
+ L(-7.015006277027660872284922325741197022467E9),
+ L(-2.149320689089020841076532186783055727299E8),
+ L(-3.167210585700002703820077565539658995316E6),
+ L(-1.576834867378554185210279285358586385266E4)
};
#define NRD6 8
-static const long double RD6[NRD6 + 1] =
+static const _Float128 RD6[NRD6 + 1] =
{
- -2.073955870771283609792355579558899389085E13L,
- -1.421592856111673959642750863283919318175E13L,
- -4.012134994918353924219048850264207074949E12L,
- -6.013361045800992316498238470888523722431E11L,
- -5.145382510136622274784240527039643430628E10L,
- -2.510575820013409711678540476918249524123E9L,
- -6.564058379709759600836745035871373240904E7L,
- -7.861511116647120540275354855221373571536E5L,
- -2.821943442729620524365661338459579270561E3L
+ L(-2.073955870771283609792355579558899389085E13),
+ L(-1.421592856111673959642750863283919318175E13),
+ L(-4.012134994918353924219048850264207074949E12),
+ L(-6.013361045800992316498238470888523722431E11),
+ L(-5.145382510136622274784240527039643430628E10),
+ L(-2.510575820013409711678540476918249524123E9),
+ L(-6.564058379709759600836745035871373240904E7),
+ L(-7.861511116647120540275354855221373571536E5),
+ L(-2.821943442729620524365661338459579270561E3)
/* 1.0E0L */
};
@@ -373,34 +369,34 @@ static const long double RD6[NRD6 + 1] =
-0.5 <= x <= 0.5
4.5 <= x+5 <= 5.5
Peak relative error 3.4e-37 */
-static const long double lgam5a = 3.17803955078125E0L;
-static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
+static const _Float128 lgam5a = L(3.17803955078125E0);
+static const _Float128 lgam5b = L(1.4279566695619646941601297055408873990961E-5);
#define NRN5 9
-static const long double RN5[NRN5 + 1] =
+static const _Float128 RN5[NRN5 + 1] =
{
- 2.010952885441805899580403215533972172098E11L,
- 1.916132681242540921354921906708215338584E11L,
- 7.679102403710581712903937970163206882492E10L,
- 1.680514903671382470108010973615268125169E10L,
- 2.181011222911537259440775283277711588410E9L,
- 1.705361119398837808244780667539728356096E8L,
- 7.792391565652481864976147945997033946360E6L,
- 1.910741381027985291688667214472560023819E5L,
- 2.088138241893612679762260077783794329559E3L,
- 6.330318119566998299106803922739066556550E0L
+ L(2.010952885441805899580403215533972172098E11),
+ L(1.916132681242540921354921906708215338584E11),
+ L(7.679102403710581712903937970163206882492E10),
+ L(1.680514903671382470108010973615268125169E10),
+ L(2.181011222911537259440775283277711588410E9),
+ L(1.705361119398837808244780667539728356096E8),
+ L(7.792391565652481864976147945997033946360E6),
+ L(1.910741381027985291688667214472560023819E5),
+ L(2.088138241893612679762260077783794329559E3),
+ L(6.330318119566998299106803922739066556550E0)
};
#define NRD5 8
-static const long double RD5[NRD5 + 1] =
+static const _Float128 RD5[NRD5 + 1] =
{
- 1.335189758138651840605141370223112376176E11L,
- 1.174130445739492885895466097516530211283E11L,
- 4.308006619274572338118732154886328519910E10L,
- 8.547402888692578655814445003283720677468E9L,
- 9.934628078575618309542580800421370730906E8L,
- 6.847107420092173812998096295422311820672E7L,
- 2.698552646016599923609773122139463150403E6L,
- 5.526516251532464176412113632726150253215E4L,
- 4.772343321713697385780533022595450486932E2L
+ L(1.335189758138651840605141370223112376176E11),
+ L(1.174130445739492885895466097516530211283E11),
+ L(4.308006619274572338118732154886328519910E10),
+ L(8.547402888692578655814445003283720677468E9),
+ L(9.934628078575618309542580800421370730906E8),
+ L(6.847107420092173812998096295422311820672E7),
+ L(2.698552646016599923609773122139463150403E6),
+ L(5.526516251532464176412113632726150253215E4),
+ L(4.772343321713697385780533022595450486932E2)
/* 1.0E0L */
};
@@ -409,35 +405,35 @@ static const long double RD5[NRD5 + 1] =
-0.5 <= x <= 0.5
3.5 <= x+4 <= 4.5
Peak relative error 6.7e-37 */
-static const long double lgam4a = 1.791748046875E0L;
-static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
+static const _Float128 lgam4a = L(1.791748046875E0);
+static const _Float128 lgam4b = L(1.1422353055000812477358380702272722990692E-5);
#define NRN4 9
-static const long double RN4[NRN4 + 1] =
+static const _Float128 RN4[NRN4 + 1] =
{
- -1.026583408246155508572442242188887829208E13L,
- -1.306476685384622809290193031208776258809E13L,
- -7.051088602207062164232806511992978915508E12L,
- -2.100849457735620004967624442027793656108E12L,
- -3.767473790774546963588549871673843260569E11L,
- -4.156387497364909963498394522336575984206E10L,
- -2.764021460668011732047778992419118757746E9L,
- -1.036617204107109779944986471142938641399E8L,
- -1.895730886640349026257780896972598305443E6L,
- -1.180509051468390914200720003907727988201E4L
+ L(-1.026583408246155508572442242188887829208E13),
+ L(-1.306476685384622809290193031208776258809E13),
+ L(-7.051088602207062164232806511992978915508E12),
+ L(-2.100849457735620004967624442027793656108E12),
+ L(-3.767473790774546963588549871673843260569E11),
+ L(-4.156387497364909963498394522336575984206E10),
+ L(-2.764021460668011732047778992419118757746E9),
+ L(-1.036617204107109779944986471142938641399E8),
+ L(-1.895730886640349026257780896972598305443E6),
+ L(-1.180509051468390914200720003907727988201E4)
};
#define NRD4 9
-static const long double RD4[NRD4 + 1] =
+static const _Float128 RD4[NRD4 + 1] =
{
- -8.172669122056002077809119378047536240889E12L,
- -9.477592426087986751343695251801814226960E12L,
- -4.629448850139318158743900253637212801682E12L,
- -1.237965465892012573255370078308035272942E12L,
- -1.971624313506929845158062177061297598956E11L,
- -1.905434843346570533229942397763361493610E10L,
- -1.089409357680461419743730978512856675984E9L,
- -3.416703082301143192939774401370222822430E7L,
- -4.981791914177103793218433195857635265295E5L,
- -2.192507743896742751483055798411231453733E3L
+ L(-8.172669122056002077809119378047536240889E12),
+ L(-9.477592426087986751343695251801814226960E12),
+ L(-4.629448850139318158743900253637212801682E12),
+ L(-1.237965465892012573255370078308035272942E12),
+ L(-1.971624313506929845158062177061297598956E11),
+ L(-1.905434843346570533229942397763361493610E10),
+ L(-1.089409357680461419743730978512856675984E9),
+ L(-3.416703082301143192939774401370222822430E7),
+ L(-4.981791914177103793218433195857635265295E5),
+ L(-2.192507743896742751483055798411231453733E3)
/* 1.0E0L */
};
@@ -446,36 +442,36 @@ static const long double RD4[NRD4 + 1] =
-0.25 <= x <= 0.5
2.75 <= x+3 <= 3.5
Peak relative error 6.0e-37 */
-static const long double lgam3a = 6.93145751953125E-1L;
-static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
+static const _Float128 lgam3a = L(6.93145751953125E-1);
+static const _Float128 lgam3b = L(1.4286068203094172321214581765680755001344E-6);
#define NRN3 9
-static const long double RN3[NRN3 + 1] =
+static const _Float128 RN3[NRN3 + 1] =
{
- -4.813901815114776281494823863935820876670E11L,
- -8.425592975288250400493910291066881992620E11L,
- -6.228685507402467503655405482985516909157E11L,
- -2.531972054436786351403749276956707260499E11L,
- -6.170200796658926701311867484296426831687E10L,
- -9.211477458528156048231908798456365081135E9L,
- -8.251806236175037114064561038908691305583E8L,
- -4.147886355917831049939930101151160447495E7L,
- -1.010851868928346082547075956946476932162E6L,
- -8.333374463411801009783402800801201603736E3L
+ L(-4.813901815114776281494823863935820876670E11),
+ L(-8.425592975288250400493910291066881992620E11),
+ L(-6.228685507402467503655405482985516909157E11),
+ L(-2.531972054436786351403749276956707260499E11),
+ L(-6.170200796658926701311867484296426831687E10),
+ L(-9.211477458528156048231908798456365081135E9),
+ L(-8.251806236175037114064561038908691305583E8),
+ L(-4.147886355917831049939930101151160447495E7),
+ L(-1.010851868928346082547075956946476932162E6),
+ L(-8.333374463411801009783402800801201603736E3)
};
#define NRD3 9
-static const long double RD3[NRD3 + 1] =
+static const _Float128 RD3[NRD3 + 1] =
{
- -5.216713843111675050627304523368029262450E11L,
- -8.014292925418308759369583419234079164391E11L,
- -5.180106858220030014546267824392678611990E11L,
- -1.830406975497439003897734969120997840011E11L,
- -3.845274631904879621945745960119924118925E10L,
- -4.891033385370523863288908070309417710903E9L,
- -3.670172254411328640353855768698287474282E8L,
- -1.505316381525727713026364396635522516989E7L,
- -2.856327162923716881454613540575964890347E5L,
- -1.622140448015769906847567212766206894547E3L
+ L(-5.216713843111675050627304523368029262450E11),
+ L(-8.014292925418308759369583419234079164391E11),
+ L(-5.180106858220030014546267824392678611990E11),
+ L(-1.830406975497439003897734969120997840011E11),
+ L(-3.845274631904879621945745960119924118925E10),
+ L(-4.891033385370523863288908070309417710903E9),
+ L(-3.670172254411328640353855768698287474282E8),
+ L(-1.505316381525727713026364396635522516989E7),
+ L(-2.856327162923716881454613540575964890347E5),
+ L(-1.622140448015769906847567212766206894547E3)
/* 1.0E0L */
};
@@ -483,33 +479,33 @@ static const long double RD3[NRD3 + 1] =
/* log gamma(x+2.5) = log gamma(2.5) + x P(x)/Q(x)
-0.125 <= x <= 0.25
2.375 <= x+2.5 <= 2.75 */
-static const long double lgam2r5a = 2.8466796875E-1L;
-static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
+static const _Float128 lgam2r5a = L(2.8466796875E-1);
+static const _Float128 lgam2r5b = L(1.4901722919159632494669682701924320137696E-5);
#define NRN2r5 8
-static const long double RN2r5[NRN2r5 + 1] =
+static const _Float128 RN2r5[NRN2r5 + 1] =
{
- -4.676454313888335499356699817678862233205E9L,
- -9.361888347911187924389905984624216340639E9L,
- -7.695353600835685037920815799526540237703E9L,
- -3.364370100981509060441853085968900734521E9L,
- -8.449902011848163568670361316804900559863E8L,
- -1.225249050950801905108001246436783022179E8L,
- -9.732972931077110161639900388121650470926E6L,
- -3.695711763932153505623248207576425983573E5L,
- -4.717341584067827676530426007495274711306E3L
+ L(-4.676454313888335499356699817678862233205E9),
+ L(-9.361888347911187924389905984624216340639E9),
+ L(-7.695353600835685037920815799526540237703E9),
+ L(-3.364370100981509060441853085968900734521E9),
+ L(-8.449902011848163568670361316804900559863E8),
+ L(-1.225249050950801905108001246436783022179E8),
+ L(-9.732972931077110161639900388121650470926E6),
+ L(-3.695711763932153505623248207576425983573E5),
+ L(-4.717341584067827676530426007495274711306E3)
};
#define NRD2r5 8
-static const long double RD2r5[NRD2r5 + 1] =
+static const _Float128 RD2r5[NRD2r5 + 1] =
{
- -6.650657966618993679456019224416926875619E9L,
- -1.099511409330635807899718829033488771623E10L,
- -7.482546968307837168164311101447116903148E9L,
- -2.702967190056506495988922973755870557217E9L,
- -5.570008176482922704972943389590409280950E8L,
- -6.536934032192792470926310043166993233231E7L,
- -4.101991193844953082400035444146067511725E6L,
- -1.174082735875715802334430481065526664020E5L,
- -9.932840389994157592102947657277692978511E2L
+ L(-6.650657966618993679456019224416926875619E9),
+ L(-1.099511409330635807899718829033488771623E10),
+ L(-7.482546968307837168164311101447116903148E9),
+ L(-2.702967190056506495988922973755870557217E9),
+ L(-5.570008176482922704972943389590409280950E8),
+ L(-6.536934032192792470926310043166993233231E7),
+ L(-4.101991193844953082400035444146067511725E6),
+ L(-1.174082735875715802334430481065526664020E5),
+ L(-9.932840389994157592102947657277692978511E2)
/* 1.0E0L */
};
@@ -519,32 +515,32 @@ static const long double RD2r5[NRD2r5 + 1] =
1.875 <= x+2 <= 2.375
Peak relative error 4.6e-36 */
#define NRN2 9
-static const long double RN2[NRN2 + 1] =
+static const _Float128 RN2[NRN2 + 1] =
{
- -3.716661929737318153526921358113793421524E9L,
- -1.138816715030710406922819131397532331321E10L,
- -1.421017419363526524544402598734013569950E10L,
- -9.510432842542519665483662502132010331451E9L,
- -3.747528562099410197957514973274474767329E9L,
- -8.923565763363912474488712255317033616626E8L,
- -1.261396653700237624185350402781338231697E8L,
- -9.918402520255661797735331317081425749014E6L,
- -3.753996255897143855113273724233104768831E5L,
- -4.778761333044147141559311805999540765612E3L
+ L(-3.716661929737318153526921358113793421524E9),
+ L(-1.138816715030710406922819131397532331321E10),
+ L(-1.421017419363526524544402598734013569950E10),
+ L(-9.510432842542519665483662502132010331451E9),
+ L(-3.747528562099410197957514973274474767329E9),
+ L(-8.923565763363912474488712255317033616626E8),
+ L(-1.261396653700237624185350402781338231697E8),
+ L(-9.918402520255661797735331317081425749014E6),
+ L(-3.753996255897143855113273724233104768831E5),
+ L(-4.778761333044147141559311805999540765612E3)
};
#define NRD2 9
-static const long double RD2[NRD2 + 1] =
+static const _Float128 RD2[NRD2 + 1] =
{
- -8.790916836764308497770359421351673950111E9L,
- -2.023108608053212516399197678553737477486E10L,
- -1.958067901852022239294231785363504458367E10L,
- -1.035515043621003101254252481625188704529E10L,
- -3.253884432621336737640841276619272224476E9L,
- -6.186383531162456814954947669274235815544E8L,
- -6.932557847749518463038934953605969951466E7L,
- -4.240731768287359608773351626528479703758E6L,
- -1.197343995089189188078944689846348116630E5L,
- -1.004622911670588064824904487064114090920E3L
+ L(-8.790916836764308497770359421351673950111E9),
+ L(-2.023108608053212516399197678553737477486E10),
+ L(-1.958067901852022239294231785363504458367E10),
+ L(-1.035515043621003101254252481625188704529E10),
+ L(-3.253884432621336737640841276619272224476E9),
+ L(-6.186383531162456814954947669274235815544E8),
+ L(-6.932557847749518463038934953605969951466E7),
+ L(-4.240731768287359608773351626528479703758E6),
+ L(-1.197343995089189188078944689846348116630E5),
+ L(-1.004622911670588064824904487064114090920E3)
/* 1.0E0 */
};
@@ -553,33 +549,33 @@ static const long double RD2[NRD2 + 1] =
-0.125 <= x <= +0.125
1.625 <= x+1.75 <= 1.875
Peak relative error 9.2e-37 */
-static const long double lgam1r75a = -8.441162109375E-2L;
-static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
+static const _Float128 lgam1r75a = L(-8.441162109375E-2);
+static const _Float128 lgam1r75b = L(1.0500073264444042213965868602268256157604E-5);
#define NRN1r75 8
-static const long double RN1r75[NRN1r75 + 1] =
+static const _Float128 RN1r75[NRN1r75 + 1] =
{
- -5.221061693929833937710891646275798251513E7L,
- -2.052466337474314812817883030472496436993E8L,
- -2.952718275974940270675670705084125640069E8L,
- -2.132294039648116684922965964126389017840E8L,
- -8.554103077186505960591321962207519908489E7L,
- -1.940250901348870867323943119132071960050E7L,
- -2.379394147112756860769336400290402208435E6L,
- -1.384060879999526222029386539622255797389E5L,
- -2.698453601378319296159355612094598695530E3L
+ L(-5.221061693929833937710891646275798251513E7),
+ L(-2.052466337474314812817883030472496436993E8),
+ L(-2.952718275974940270675670705084125640069E8),
+ L(-2.132294039648116684922965964126389017840E8),
+ L(-8.554103077186505960591321962207519908489E7),
+ L(-1.940250901348870867323943119132071960050E7),
+ L(-2.379394147112756860769336400290402208435E6),
+ L(-1.384060879999526222029386539622255797389E5),
+ L(-2.698453601378319296159355612094598695530E3)
};
#define NRD1r75 8
-static const long double RD1r75[NRD1r75 + 1] =
+static const _Float128 RD1r75[NRD1r75 + 1] =
{
- -2.109754689501705828789976311354395393605E8L,
- -5.036651829232895725959911504899241062286E8L,
- -4.954234699418689764943486770327295098084E8L,
- -2.589558042412676610775157783898195339410E8L,
- -7.731476117252958268044969614034776883031E7L,
- -1.316721702252481296030801191240867486965E7L,
- -1.201296501404876774861190604303728810836E6L,
- -5.007966406976106636109459072523610273928E4L,
- -6.155817990560743422008969155276229018209E2L
+ L(-2.109754689501705828789976311354395393605E8),
+ L(-5.036651829232895725959911504899241062286E8),
+ L(-4.954234699418689764943486770327295098084E8),
+ L(-2.589558042412676610775157783898195339410E8),
+ L(-7.731476117252958268044969614034776883031E7),
+ L(-1.316721702252481296030801191240867486965E7),
+ L(-1.201296501404876774861190604303728810836E6),
+ L(-5.007966406976106636109459072523610273928E4),
+ L(-6.155817990560743422008969155276229018209E2)
/* 1.0E0L */
};
@@ -588,35 +584,35 @@ static const long double RD1r75[NRD1r75 + 1] =
-0.0867 <= x <= +0.1634
1.374932... <= x+x0 <= 1.625032...
Peak relative error 4.0e-36 */
-static const long double x0a = 1.4616241455078125L;
-static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
-static const long double y0a = -1.21490478515625E-1L;
-static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
+static const _Float128 x0a = L(1.4616241455078125);
+static const _Float128 x0b = L(7.9994605498412626595423257213002588621246E-6);
+static const _Float128 y0a = L(-1.21490478515625E-1);
+static const _Float128 y0b = L(4.1879797753919044854428223084178486438269E-6);
#define NRN1r5 8
-static const long double RN1r5[NRN1r5 + 1] =
+static const _Float128 RN1r5[NRN1r5 + 1] =
{
- 6.827103657233705798067415468881313128066E5L,
- 1.910041815932269464714909706705242148108E6L,
- 2.194344176925978377083808566251427771951E6L,
- 1.332921400100891472195055269688876427962E6L,
- 4.589080973377307211815655093824787123508E5L,
- 8.900334161263456942727083580232613796141E4L,
- 9.053840838306019753209127312097612455236E3L,
- 4.053367147553353374151852319743594873771E2L,
- 5.040631576303952022968949605613514584950E0L
+ L(6.827103657233705798067415468881313128066E5),
+ L(1.910041815932269464714909706705242148108E6),
+ L(2.194344176925978377083808566251427771951E6),
+ L(1.332921400100891472195055269688876427962E6),
+ L(4.589080973377307211815655093824787123508E5),
+ L(8.900334161263456942727083580232613796141E4),
+ L(9.053840838306019753209127312097612455236E3),
+ L(4.053367147553353374151852319743594873771E2),
+ L(5.040631576303952022968949605613514584950E0)
};
#define NRD1r5 8
-static const long double RD1r5[NRD1r5 + 1] =
+static const _Float128 RD1r5[NRD1r5 + 1] =
{
- 1.411036368843183477558773688484699813355E6L,
- 4.378121767236251950226362443134306184849E6L,
- 5.682322855631723455425929877581697918168E6L,
- 3.999065731556977782435009349967042222375E6L,
- 1.653651390456781293163585493620758410333E6L,
- 4.067774359067489605179546964969435858311E5L,
- 5.741463295366557346748361781768833633256E4L,
- 4.226404539738182992856094681115746692030E3L,
- 1.316980975410327975566999780608618774469E2L,
+ L(1.411036368843183477558773688484699813355E6),
+ L(4.378121767236251950226362443134306184849E6),
+ L(5.682322855631723455425929877581697918168E6),
+ L(3.999065731556977782435009349967042222375E6),
+ L(1.653651390456781293163585493620758410333E6),
+ L(4.067774359067489605179546964969435858311E5),
+ L(5.741463295366557346748361781768833633256E4),
+ L(4.226404539738182992856094681115746692030E3),
+ L(1.316980975410327975566999780608618774469E2),
/* 1.0E0L */
};
@@ -625,34 +621,34 @@ static const long double RD1r5[NRD1r5 + 1] =
-.125 <= x <= +.125
1.125 <= x+1.25 <= 1.375
Peak relative error = 4.9e-36 */
-static const long double lgam1r25a = -9.82818603515625E-2L;
-static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
+static const _Float128 lgam1r25a = L(-9.82818603515625E-2);
+static const _Float128 lgam1r25b = L(1.0023929749338536146197303364159774377296E-5);
#define NRN1r25 9
-static const long double RN1r25[NRN1r25 + 1] =
+static const _Float128 RN1r25[NRN1r25 + 1] =
{
- -9.054787275312026472896002240379580536760E4L,
- -8.685076892989927640126560802094680794471E4L,
- 2.797898965448019916967849727279076547109E5L,
- 6.175520827134342734546868356396008898299E5L,
- 5.179626599589134831538516906517372619641E5L,
- 2.253076616239043944538380039205558242161E5L,
- 5.312653119599957228630544772499197307195E4L,
- 6.434329437514083776052669599834938898255E3L,
- 3.385414416983114598582554037612347549220E2L,
- 4.907821957946273805080625052510832015792E0L
+ L(-9.054787275312026472896002240379580536760E4),
+ L(-8.685076892989927640126560802094680794471E4),
+ L(2.797898965448019916967849727279076547109E5),
+ L(6.175520827134342734546868356396008898299E5),
+ L(5.179626599589134831538516906517372619641E5),
+ L(2.253076616239043944538380039205558242161E5),
+ L(5.312653119599957228630544772499197307195E4),
+ L(6.434329437514083776052669599834938898255E3),
+ L(3.385414416983114598582554037612347549220E2),
+ L(4.907821957946273805080625052510832015792E0)
};
#define NRD1r25 8
-static const long double RD1r25[NRD1r25 + 1] =
+static const _Float128 RD1r25[NRD1r25 + 1] =
{
- 3.980939377333448005389084785896660309000E5L,
- 1.429634893085231519692365775184490465542E6L,
- 2.145438946455476062850151428438668234336E6L,
- 1.743786661358280837020848127465970357893E6L,
- 8.316364251289743923178092656080441655273E5L,
- 2.355732939106812496699621491135458324294E5L,
- 3.822267399625696880571810137601310855419E4L,
- 3.228463206479133236028576845538387620856E3L,
- 1.152133170470059555646301189220117965514E2L
+ L(3.980939377333448005389084785896660309000E5),
+ L(1.429634893085231519692365775184490465542E6),
+ L(2.145438946455476062850151428438668234336E6),
+ L(1.743786661358280837020848127465970357893E6),
+ L(8.316364251289743923178092656080441655273E5),
+ L(2.355732939106812496699621491135458324294E5),
+ L(3.822267399625696880571810137601310855419E4),
+ L(3.228463206479133236028576845538387620856E3),
+ L(1.152133170470059555646301189220117965514E2)
/* 1.0E0L */
};
@@ -662,29 +658,29 @@ static const long double RD1r25[NRD1r25 + 1] =
1.0 <= x+1 <= 1.125
Peak relative error 1.1e-35 */
#define NRN1 8
-static const long double RN1[NRN1 + 1] =
+static const _Float128 RN1[NRN1 + 1] =
{
- -9.987560186094800756471055681088744738818E3L,
- -2.506039379419574361949680225279376329742E4L,
- -1.386770737662176516403363873617457652991E4L,
- 1.439445846078103202928677244188837130744E4L,
- 2.159612048879650471489449668295139990693E4L,
- 1.047439813638144485276023138173676047079E4L,
- 2.250316398054332592560412486630769139961E3L,
- 1.958510425467720733041971651126443864041E2L,
- 4.516830313569454663374271993200291219855E0L
+ L(-9.987560186094800756471055681088744738818E3),
+ L(-2.506039379419574361949680225279376329742E4),
+ L(-1.386770737662176516403363873617457652991E4),
+ L(1.439445846078103202928677244188837130744E4),
+ L(2.159612048879650471489449668295139990693E4),
+ L(1.047439813638144485276023138173676047079E4),
+ L(2.250316398054332592560412486630769139961E3),
+ L(1.958510425467720733041971651126443864041E2),
+ L(4.516830313569454663374271993200291219855E0)
};
#define NRD1 7
-static const long double RD1[NRD1 + 1] =
+static const _Float128 RD1[NRD1 + 1] =
{
- 1.730299573175751778863269333703788214547E4L,
- 6.807080914851328611903744668028014678148E4L,
- 1.090071629101496938655806063184092302439E5L,
- 9.124354356415154289343303999616003884080E4L,
- 4.262071638655772404431164427024003253954E4L,
- 1.096981664067373953673982635805821283581E4L,
- 1.431229503796575892151252708527595787588E3L,
- 7.734110684303689320830401788262295992921E1L
+ L(1.730299573175751778863269333703788214547E4),
+ L(6.807080914851328611903744668028014678148E4),
+ L(1.090071629101496938655806063184092302439E5),
+ L(9.124354356415154289343303999616003884080E4),
+ L(4.262071638655772404431164427024003253954E4),
+ L(1.096981664067373953673982635805821283581E4),
+ L(1.431229503796575892151252708527595787588E3),
+ L(7.734110684303689320830401788262295992921E1)
/* 1.0E0 */
};
@@ -694,40 +690,40 @@ static const long double RD1[NRD1 + 1] =
0.875 <= x+1 <= 1.0
Peak relative error 7.0e-37 */
#define NRNr9 8
-static const long double RNr9[NRNr9 + 1] =
+static const _Float128 RNr9[NRNr9 + 1] =
{
- 4.441379198241760069548832023257571176884E5L,
- 1.273072988367176540909122090089580368732E6L,
- 9.732422305818501557502584486510048387724E5L,
- -5.040539994443998275271644292272870348684E5L,
- -1.208719055525609446357448132109723786736E6L,
- -7.434275365370936547146540554419058907156E5L,
- -2.075642969983377738209203358199008185741E5L,
- -2.565534860781128618589288075109372218042E4L,
- -1.032901669542994124131223797515913955938E3L,
+ L(4.441379198241760069548832023257571176884E5),
+ L(1.273072988367176540909122090089580368732E6),
+ L(9.732422305818501557502584486510048387724E5),
+ L(-5.040539994443998275271644292272870348684E5),
+ L(-1.208719055525609446357448132109723786736E6),
+ L(-7.434275365370936547146540554419058907156E5),
+ L(-2.075642969983377738209203358199008185741E5),
+ L(-2.565534860781128618589288075109372218042E4),
+ L(-1.032901669542994124131223797515913955938E3),
};
#define NRDr9 8
-static const long double RDr9[NRDr9 + 1] =
+static const _Float128 RDr9[NRDr9 + 1] =
{
- -7.694488331323118759486182246005193998007E5L,
- -3.301918855321234414232308938454112213751E6L,
- -5.856830900232338906742924836032279404702E6L,
- -5.540672519616151584486240871424021377540E6L,
- -3.006530901041386626148342989181721176919E6L,
- -9.350378280513062139466966374330795935163E5L,
- -1.566179100031063346901755685375732739511E5L,
- -1.205016539620260779274902967231510804992E4L,
- -2.724583156305709733221564484006088794284E2L
+ L(-7.694488331323118759486182246005193998007E5),
+ L(-3.301918855321234414232308938454112213751E6),
+ L(-5.856830900232338906742924836032279404702E6),
+ L(-5.540672519616151584486240871424021377540E6),
+ L(-3.006530901041386626148342989181721176919E6),
+ L(-9.350378280513062139466966374330795935163E5),
+ L(-1.566179100031063346901755685375732739511E5),
+ L(-1.205016539620260779274902967231510804992E4),
+ L(-2.724583156305709733221564484006088794284E2)
/* 1.0E0 */
};
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -742,10 +738,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -758,10 +754,10 @@ deval (long double x, const long double *p, int n)
}
-long double
-__ieee754_lgammal_r (long double x, int *signgamp)
+_Float128
+__ieee754_lgammal_r (_Float128 x, int *signgamp)
{
- long double p, q, w, z, nx;
+ _Float128 p, q, w, z, nx;
int i, nn;
*signgamp = 1;
@@ -769,31 +765,31 @@ __ieee754_lgammal_r (long double x, int *signgamp)
if (! isfinite (x))
return x * x;
- if (x == 0.0L)
+ if (x == 0)
{
if (signbit (x))
*signgamp = -1;
}
- if (x < 0.0L)
+ if (x < 0)
{
- if (x < -2.0L && x > (LDBL_MANT_DIG == 106 ? -48.0L : -50.0L))
+ if (x < -2 && x > -50)
return __lgamma_negl (x, signgamp);
q = -x;
p = __floorl (q);
if (p == q)
- return (one / (p - p));
- long double halfp = p * 0.5L;
+ return (one / fabsl (p - p));
+ _Float128 halfp = p * L(0.5);
if (halfp == __floorl (halfp))
*signgamp = -1;
else
*signgamp = 1;
- if (q < 0x1p-120L)
+ if (q < L(0x1p-120))
return -__logl (q);
z = q - p;
- if (z > 0.5L)
+ if (z > L(0.5))
{
- p += 1.0L;
+ p += 1;
z = p - q;
}
z = q * __sinl (PIL * z);
@@ -802,16 +798,16 @@ __ieee754_lgammal_r (long double x, int *signgamp)
return (z);
}
- if (x < 13.5L)
+ if (x < L(13.5))
{
- p = 0.0L;
- nx = __floorl (x + 0.5L);
+ p = 0;
+ nx = __floorl (x + L(0.5));
nn = nx;
switch (nn)
{
case 0:
/* log gamma (x + 1) = log(x) + log gamma(x) */
- if (x < 0x1p-120L)
+ if (x < L(0x1p-120))
return -__logl (x);
else if (x <= 0.125)
{
@@ -819,14 +815,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.375)
{
- z = x - 0.25L;
+ z = x - L(0.25);
p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
p += lgam1r25b;
p += lgam1r25a;
}
else if (x <= 0.625)
{
- z = x + (1.0L - x0a);
+ z = x + (1 - x0a);
z = z - x0b;
p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
p = p * z * z;
@@ -835,25 +831,25 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.875)
{
- z = x - 0.75L;
+ z = x - L(0.75);
p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
else
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
p = p - __logl (x);
break;
case 1:
- if (x < 0.875L)
+ if (x < L(0.875))
{
if (x <= 0.625)
{
- z = x + (1.0L - x0a);
+ z = x + (1 - x0a);
z = z - x0b;
p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
p = p * z * z;
@@ -862,7 +858,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else if (x <= 0.875)
{
- z = x - 0.75L;
+ z = x - L(0.75);
p = z * neval (z, RN1r75, NRN1r75)
/ deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
@@ -870,26 +866,26 @@ __ieee754_lgammal_r (long double x, int *signgamp)
}
else
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
p = p - __logl (x);
}
- else if (x < 1.0L)
+ else if (x < 1)
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
}
- else if (x == 1.0L)
- p = 0.0L;
- else if (x <= 1.125L)
+ else if (x == 1)
+ p = 0;
+ else if (x <= L(1.125))
{
- z = x - 1.0L;
+ z = x - 1;
p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
}
else if (x <= 1.375)
{
- z = x - 1.25L;
+ z = x - L(1.25);
p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
p += lgam1r25b;
p += lgam1r25a;
@@ -907,7 +903,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
break;
case 2:
- if (x < 1.625L)
+ if (x < L(1.625))
{
z = x - x0a;
z = z - x0b;
@@ -916,23 +912,23 @@ __ieee754_lgammal_r (long double x, int *signgamp)
p = p + y0b;
p = p + y0a;
}
- else if (x < 1.875L)
+ else if (x < L(1.875))
{
- z = x - 1.75L;
+ z = x - L(1.75);
p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
p += lgam1r75b;
p += lgam1r75a;
}
- else if (x == 2.0L)
- p = 0.0L;
- else if (x < 2.375L)
+ else if (x == 2)
+ p = 0;
+ else if (x < L(2.375))
{
- z = x - 2.0L;
+ z = x - 2;
p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
}
else
{
- z = x - 2.5L;
+ z = x - L(2.5);
p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
p += lgam2r5b;
p += lgam2r5a;
@@ -942,14 +938,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
case 3:
if (x < 2.75)
{
- z = x - 2.5L;
+ z = x - L(2.5);
p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
p += lgam2r5b;
p += lgam2r5a;
}
else
{
- z = x - 3.0L;
+ z = x - 3;
p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
p += lgam3b;
p += lgam3a;
@@ -957,70 +953,70 @@ __ieee754_lgammal_r (long double x, int *signgamp)
break;
case 4:
- z = x - 4.0L;
+ z = x - 4;
p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
p += lgam4b;
p += lgam4a;
break;
case 5:
- z = x - 5.0L;
+ z = x - 5;
p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
p += lgam5b;
p += lgam5a;
break;
case 6:
- z = x - 6.0L;
+ z = x - 6;
p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
p += lgam6b;
p += lgam6a;
break;
case 7:
- z = x - 7.0L;
+ z = x - 7;
p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
p += lgam7b;
p += lgam7a;
break;
case 8:
- z = x - 8.0L;
+ z = x - 8;
p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
p += lgam8b;
p += lgam8a;
break;
case 9:
- z = x - 9.0L;
+ z = x - 9;
p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
p += lgam9b;
p += lgam9a;
break;
case 10:
- z = x - 10.0L;
+ z = x - 10;
p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
p += lgam10b;
p += lgam10a;
break;
case 11:
- z = x - 11.0L;
+ z = x - 11;
p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
p += lgam11b;
p += lgam11a;
break;
case 12:
- z = x - 12.0L;
+ z = x - 12;
p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
p += lgam12b;
p += lgam12a;
break;
case 13:
- z = x - 13.0L;
+ z = x - 13;
p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
p += lgam13b;
p += lgam13a;
@@ -1032,14 +1028,14 @@ __ieee754_lgammal_r (long double x, int *signgamp)
if (x > MAXLGM)
return (*signgamp * huge * huge);
- if (x > 0x1p120L)
- return x * (__logl (x) - 1.0L);
+ if (x > L(0x1p120))
+ return x * (__logl (x) - 1);
q = ls2pi - x;
- q = (x - 0.5L) * __logl (x) + q;
- if (x > 1.0e18L)
+ q = (x - L(0.5)) * __logl (x) + q;
+ if (x > L(1.0e18))
return (q);
- p = 1.0L / (x * x);
+ p = 1 / (x * x);
q += neval (p, RASY, NRASY) / x;
return (q);
}
diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c
index 618255f2fa..e8f33984f2 100644
--- a/sysdeps/ieee754/ldbl-128/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log10l.c
@@ -68,36 +68,36 @@
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double P[13] =
+static const _Float128 P[13] =
{
- 1.313572404063446165910279910527789794488E4L,
- 7.771154681358524243729929227226708890930E4L,
- 2.014652742082537582487669938141683759923E5L,
- 3.007007295140399532324943111654767187848E5L,
- 2.854829159639697837788887080758954924001E5L,
- 1.797628303815655343403735250238293741397E5L,
- 7.594356839258970405033155585486712125861E4L,
- 2.128857716871515081352991964243375186031E4L,
- 3.824952356185897735160588078446136783779E3L,
- 4.114517881637811823002128927449878962058E2L,
- 2.321125933898420063925789532045674660756E1L,
- 4.998469661968096229986658302195402690910E-1L,
- 1.538612243596254322971797716843006400388E-6L
+ L(1.313572404063446165910279910527789794488E4),
+ L(7.771154681358524243729929227226708890930E4),
+ L(2.014652742082537582487669938141683759923E5),
+ L(3.007007295140399532324943111654767187848E5),
+ L(2.854829159639697837788887080758954924001E5),
+ L(1.797628303815655343403735250238293741397E5),
+ L(7.594356839258970405033155585486712125861E4),
+ L(2.128857716871515081352991964243375186031E4),
+ L(3.824952356185897735160588078446136783779E3),
+ L(4.114517881637811823002128927449878962058E2),
+ L(2.321125933898420063925789532045674660756E1),
+ L(4.998469661968096229986658302195402690910E-1),
+ L(1.538612243596254322971797716843006400388E-6)
};
-static const long double Q[12] =
+static const _Float128 Q[12] =
{
- 3.940717212190338497730839731583397586124E4L,
- 2.626900195321832660448791748036714883242E5L,
- 7.777690340007566932935753241556479363645E5L,
- 1.347518538384329112529391120390701166528E6L,
- 1.514882452993549494932585972882995548426E6L,
- 1.158019977462989115839826904108208787040E6L,
- 6.132189329546557743179177159925690841200E5L,
- 2.248234257620569139969141618556349415120E5L,
- 5.605842085972455027590989944010492125825E4L,
- 9.147150349299596453976674231612674085381E3L,
- 9.104928120962988414618126155557301584078E2L,
- 4.839208193348159620282142911143429644326E1L
+ L(3.940717212190338497730839731583397586124E4),
+ L(2.626900195321832660448791748036714883242E5),
+ L(7.777690340007566932935753241556479363645E5),
+ L(1.347518538384329112529391120390701166528E6),
+ L(1.514882452993549494932585972882995548426E6),
+ L(1.158019977462989115839826904108208787040E6),
+ L(6.132189329546557743179177159925690841200E5),
+ L(2.248234257620569139969141618556349415120E5),
+ L(5.605842085972455027590989944010492125825E4),
+ L(9.147150349299596453976674231612674085381E3),
+ L(9.104928120962988414618126155557301584078E2),
+ L(4.839208193348159620282142911143429644326E1)
/* 1.000000000000000000000000000000000000000E0L, */
};
@@ -107,44 +107,44 @@ static const long double Q[12] =
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double R[6] =
+static const _Float128 R[6] =
{
- 1.418134209872192732479751274970992665513E5L,
- -8.977257995689735303686582344659576526998E4L,
- 2.048819892795278657810231591630928516206E4L,
- -2.024301798136027039250415126250455056397E3L,
- 8.057002716646055371965756206836056074715E1L,
- -8.828896441624934385266096344596648080902E-1L
+ L(1.418134209872192732479751274970992665513E5),
+ L(-8.977257995689735303686582344659576526998E4),
+ L(2.048819892795278657810231591630928516206E4),
+ L(-2.024301798136027039250415126250455056397E3),
+ L(8.057002716646055371965756206836056074715E1),
+ L(-8.828896441624934385266096344596648080902E-1)
};
-static const long double S[6] =
+static const _Float128 S[6] =
{
- 1.701761051846631278975701529965589676574E6L,
- -1.332535117259762928288745111081235577029E6L,
- 4.001557694070773974936904547424676279307E5L,
- -5.748542087379434595104154610899551484314E4L,
- 3.998526750980007367835804959888064681098E3L,
- -1.186359407982897997337150403816839480438E2L
+ L(1.701761051846631278975701529965589676574E6),
+ L(-1.332535117259762928288745111081235577029E6),
+ L(4.001557694070773974936904547424676279307E5),
+ L(-5.748542087379434595104154610899551484314E4),
+ L(3.998526750980007367835804959888064681098E3),
+ L(-1.186359407982897997337150403816839480438E2)
/* 1.000000000000000000000000000000000000000E0L, */
};
-static const long double
+static const _Float128
/* log10(2) */
-L102A = 0.3125L,
-L102B = -1.14700043360188047862611052755069732318101185E-2L,
+L102A = L(0.3125),
+L102B = L(-1.14700043360188047862611052755069732318101185E-2),
/* log10(e) */
-L10EA = 0.5L,
-L10EB = -6.570551809674817234887108108339491770560299E-2L,
+L10EA = L(0.5),
+L10EB = L(-6.570551809674817234887108108339491770560299E-2),
/* sqrt(2)/2 */
-SQRTH = 7.071067811865475244008443621048490392848359E-1L;
+SQRTH = L(7.071067811865475244008443621048490392848359E-1);
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -159,10 +159,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -176,25 +176,25 @@ deval (long double x, const long double *p, int n)
-long double
-__ieee754_log10l (long double x)
+_Float128
+__ieee754_log10l (_Float128 x)
{
- long double z;
- long double y;
+ _Float128 z;
+ _Float128 y;
int e;
int64_t hx, lx;
/* Test for domain */
GET_LDOUBLE_WORDS64 (hx, lx, x);
if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
- return (-1.0L / (x - x));
+ return (-1 / fabsl (x)); /* log10l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7fff000000000000LL)
return (x + x);
- if (x == 1.0L)
- return 0.0L;
+ if (x == 1)
+ return 0;
/* separate mantissa from exponent */
@@ -212,14 +212,14 @@ __ieee754_log10l (long double x)
if (x < SQRTH)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -233,11 +233,11 @@ __ieee754_log10l (long double x)
if (x < SQRTH)
{
e -= 1;
- x = 2.0 * x - 1.0L; /* 2x - 1 */
+ x = 2.0 * x - 1; /* 2x - 1 */
}
else
{
- x = x - 1.0L;
+ x = x - 1;
}
z = x * x;
y = x * (z * neval (x, P, 12) / deval (x, Q, 11));
diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c
index 6b1faa0523..06bf04f5e3 100644
--- a/sysdeps/ieee754/ldbl-128/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_log2l.c
@@ -67,36 +67,36 @@
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double P[13] =
+static const _Float128 P[13] =
{
- 1.313572404063446165910279910527789794488E4L,
- 7.771154681358524243729929227226708890930E4L,
- 2.014652742082537582487669938141683759923E5L,
- 3.007007295140399532324943111654767187848E5L,
- 2.854829159639697837788887080758954924001E5L,
- 1.797628303815655343403735250238293741397E5L,
- 7.594356839258970405033155585486712125861E4L,
- 2.128857716871515081352991964243375186031E4L,
- 3.824952356185897735160588078446136783779E3L,
- 4.114517881637811823002128927449878962058E2L,
- 2.321125933898420063925789532045674660756E1L,
- 4.998469661968096229986658302195402690910E-1L,
- 1.538612243596254322971797716843006400388E-6L
+ L(1.313572404063446165910279910527789794488E4),
+ L(7.771154681358524243729929227226708890930E4),
+ L(2.014652742082537582487669938141683759923E5),
+ L(3.007007295140399532324943111654767187848E5),
+ L(2.854829159639697837788887080758954924001E5),
+ L(1.797628303815655343403735250238293741397E5),
+ L(7.594356839258970405033155585486712125861E4),
+ L(2.128857716871515081352991964243375186031E4),
+ L(3.824952356185897735160588078446136783779E3),
+ L(4.114517881637811823002128927449878962058E2),
+ L(2.321125933898420063925789532045674660756E1),
+ L(4.998469661968096229986658302195402690910E-1),
+ L(1.538612243596254322971797716843006400388E-6)
};
-static const long double Q[12] =
+static const _Float128 Q[12] =
{
- 3.940717212190338497730839731583397586124E4L,
- 2.626900195321832660448791748036714883242E5L,
- 7.777690340007566932935753241556479363645E5L,
- 1.347518538384329112529391120390701166528E6L,
- 1.514882452993549494932585972882995548426E6L,
- 1.158019977462989115839826904108208787040E6L,
- 6.132189329546557743179177159925690841200E5L,
- 2.248234257620569139969141618556349415120E5L,
- 5.605842085972455027590989944010492125825E4L,
- 9.147150349299596453976674231612674085381E3L,
- 9.104928120962988414618126155557301584078E2L,
- 4.839208193348159620282142911143429644326E1L
+ L(3.940717212190338497730839731583397586124E4),
+ L(2.626900195321832660448791748036714883242E5),
+ L(7.777690340007566932935753241556479363645E5),
+ L(1.347518538384329112529391120390701166528E6),
+ L(1.514882452993549494932585972882995548426E6),
+ L(1.158019977462989115839826904108208787040E6),
+ L(6.132189329546557743179177159925690841200E5),
+ L(2.248234257620569139969141618556349415120E5),
+ L(5.605842085972455027590989944010492125825E4),
+ L(9.147150349299596453976674231612674085381E3),
+ L(9.104928120962988414618126155557301584078E2),
+ L(4.839208193348159620282142911143429644326E1)
/* 1.000000000000000000000000000000000000000E0L, */
};
@@ -106,39 +106,39 @@ static const long double Q[12] =
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double R[6] =
+static const _Float128 R[6] =
{
- 1.418134209872192732479751274970992665513E5L,
- -8.977257995689735303686582344659576526998E4L,
- 2.048819892795278657810231591630928516206E4L,
- -2.024301798136027039250415126250455056397E3L,
- 8.057002716646055371965756206836056074715E1L,
- -8.828896441624934385266096344596648080902E-1L
+ L(1.418134209872192732479751274970992665513E5),
+ L(-8.977257995689735303686582344659576526998E4),
+ L(2.048819892795278657810231591630928516206E4),
+ L(-2.024301798136027039250415126250455056397E3),
+ L(8.057002716646055371965756206836056074715E1),
+ L(-8.828896441624934385266096344596648080902E-1)
};
-static const long double S[6] =
+static const _Float128 S[6] =
{
- 1.701761051846631278975701529965589676574E6L,
- -1.332535117259762928288745111081235577029E6L,
- 4.001557694070773974936904547424676279307E5L,
- -5.748542087379434595104154610899551484314E4L,
- 3.998526750980007367835804959888064681098E3L,
- -1.186359407982897997337150403816839480438E2L
+ L(1.701761051846631278975701529965589676574E6),
+ L(-1.332535117259762928288745111081235577029E6),
+ L(4.001557694070773974936904547424676279307E5),
+ L(-5.748542087379434595104154610899551484314E4),
+ L(3.998526750980007367835804959888064681098E3),
+ L(-1.186359407982897997337150403816839480438E2)
/* 1.000000000000000000000000000000000000000E0L, */
};
-static const long double
+static const _Float128
/* log2(e) - 1 */
-LOG2EA = 4.4269504088896340735992468100189213742664595E-1L,
+LOG2EA = L(4.4269504088896340735992468100189213742664595E-1),
/* sqrt(2)/2 */
-SQRTH = 7.071067811865475244008443621048490392848359E-1L;
+SQRTH = L(7.071067811865475244008443621048490392848359E-1);
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -153,10 +153,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -170,25 +170,25 @@ deval (long double x, const long double *p, int n)
-long double
-__ieee754_log2l (long double x)
+_Float128
+__ieee754_log2l (_Float128 x)
{
- long double z;
- long double y;
+ _Float128 z;
+ _Float128 y;
int e;
int64_t hx, lx;
/* Test for domain */
GET_LDOUBLE_WORDS64 (hx, lx, x);
if (((hx & 0x7fffffffffffffffLL) | lx) == 0)
- return (-1.0L / (x - x));
+ return (-1 / fabsl (x)); /* log2l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7fff000000000000LL)
return (x + x);
- if (x == 1.0L)
- return 0.0L;
+ if (x == 1)
+ return 0;
/* separate mantissa from exponent */
@@ -206,14 +206,14 @@ __ieee754_log2l (long double x)
if (x < SQRTH)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -227,11 +227,11 @@ __ieee754_log2l (long double x)
if (x < SQRTH)
{
e -= 1;
- x = 2.0 * x - 1.0L; /* 2x - 1 */
+ x = 2.0 * x - 1; /* 2x - 1 */
}
else
{
- x = x - 1.0L;
+ x = x - 1;
}
z = x * x;
y = x * (z * neval (x, P, 12) / deval (x, Q, 11));
diff --git a/sysdeps/ieee754/ldbl-128/e_logl.c b/sysdeps/ieee754/ldbl-128/e_logl.c
index cb43816793..8672047e43 100644
--- a/sysdeps/ieee754/ldbl-128/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128/e_logl.c
@@ -58,134 +58,135 @@
License along with this library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
#include <math_private.h>
/* log(1+x) = x - .5 x^2 + x^3 l(x)
-.0078125 <= x <= +.0078125
peak relative error 1.2e-37 */
-static const long double
-l3 = 3.333333333333333333333333333333336096926E-1L,
-l4 = -2.499999999999999999999999999486853077002E-1L,
-l5 = 1.999999999999999999999999998515277861905E-1L,
-l6 = -1.666666666666666666666798448356171665678E-1L,
-l7 = 1.428571428571428571428808945895490721564E-1L,
-l8 = -1.249999999999999987884655626377588149000E-1L,
-l9 = 1.111111111111111093947834982832456459186E-1L,
-l10 = -1.000000000000532974938900317952530453248E-1L,
-l11 = 9.090909090915566247008015301349979892689E-2L,
-l12 = -8.333333211818065121250921925397567745734E-2L,
-l13 = 7.692307559897661630807048686258659316091E-2L,
-l14 = -7.144242754190814657241902218399056829264E-2L,
-l15 = 6.668057591071739754844678883223432347481E-2L;
+static const _Float128
+l3 = L(3.333333333333333333333333333333336096926E-1),
+l4 = L(-2.499999999999999999999999999486853077002E-1),
+l5 = L(1.999999999999999999999999998515277861905E-1),
+l6 = L(-1.666666666666666666666798448356171665678E-1),
+l7 = L(1.428571428571428571428808945895490721564E-1),
+l8 = L(-1.249999999999999987884655626377588149000E-1),
+l9 = L(1.111111111111111093947834982832456459186E-1),
+l10 = L(-1.000000000000532974938900317952530453248E-1),
+l11 = L(9.090909090915566247008015301349979892689E-2),
+l12 = L(-8.333333211818065121250921925397567745734E-2),
+l13 = L(7.692307559897661630807048686258659316091E-2),
+l14 = L(-7.144242754190814657241902218399056829264E-2),
+l15 = L(6.668057591071739754844678883223432347481E-2);
/* Lookup table of ln(t) - (t-1)
t = 0.5 + (k+26)/128)
k = 0, ..., 91 */
-static const long double logtbl[92] = {
--5.5345593589352099112142921677820359632418E-2L,
--5.2108257402767124761784665198737642086148E-2L,
--4.8991686870576856279407775480686721935120E-2L,
--4.5993270766361228596215288742353061431071E-2L,
--4.3110481649613269682442058976885699556950E-2L,
--4.0340872319076331310838085093194799765520E-2L,
--3.7682072451780927439219005993827431503510E-2L,
--3.5131785416234343803903228503274262719586E-2L,
--3.2687785249045246292687241862699949178831E-2L,
--3.0347913785027239068190798397055267411813E-2L,
--2.8110077931525797884641940838507561326298E-2L,
--2.5972247078357715036426583294246819637618E-2L,
--2.3932450635346084858612873953407168217307E-2L,
--2.1988775689981395152022535153795155900240E-2L,
--2.0139364778244501615441044267387667496733E-2L,
--1.8382413762093794819267536615342902718324E-2L,
--1.6716169807550022358923589720001638093023E-2L,
--1.5138929457710992616226033183958974965355E-2L,
--1.3649036795397472900424896523305726435029E-2L,
--1.2244881690473465543308397998034325468152E-2L,
--1.0924898127200937840689817557742469105693E-2L,
--9.6875626072830301572839422532631079809328E-3L,
--8.5313926245226231463436209313499745894157E-3L,
--7.4549452072765973384933565912143044991706E-3L,
--6.4568155251217050991200599386801665681310E-3L,
--5.5356355563671005131126851708522185605193E-3L,
--4.6900728132525199028885749289712348829878E-3L,
--3.9188291218610470766469347968659624282519E-3L,
--3.2206394539524058873423550293617843896540E-3L,
--2.5942708080877805657374888909297113032132E-3L,
--2.0385211375711716729239156839929281289086E-3L,
--1.5522183228760777967376942769773768850872E-3L,
--1.1342191863606077520036253234446621373191E-3L,
--7.8340854719967065861624024730268350459991E-4L,
--4.9869831458030115699628274852562992756174E-4L,
--2.7902661731604211834685052867305795169688E-4L,
--1.2335696813916860754951146082826952093496E-4L,
--3.0677461025892873184042490943581654591817E-5L,
+static const _Float128 logtbl[92] = {
+L(-5.5345593589352099112142921677820359632418E-2),
+L(-5.2108257402767124761784665198737642086148E-2),
+L(-4.8991686870576856279407775480686721935120E-2),
+L(-4.5993270766361228596215288742353061431071E-2),
+L(-4.3110481649613269682442058976885699556950E-2),
+L(-4.0340872319076331310838085093194799765520E-2),
+L(-3.7682072451780927439219005993827431503510E-2),
+L(-3.5131785416234343803903228503274262719586E-2),
+L(-3.2687785249045246292687241862699949178831E-2),
+L(-3.0347913785027239068190798397055267411813E-2),
+L(-2.8110077931525797884641940838507561326298E-2),
+L(-2.5972247078357715036426583294246819637618E-2),
+L(-2.3932450635346084858612873953407168217307E-2),
+L(-2.1988775689981395152022535153795155900240E-2),
+L(-2.0139364778244501615441044267387667496733E-2),
+L(-1.8382413762093794819267536615342902718324E-2),
+L(-1.6716169807550022358923589720001638093023E-2),
+L(-1.5138929457710992616226033183958974965355E-2),
+L(-1.3649036795397472900424896523305726435029E-2),
+L(-1.2244881690473465543308397998034325468152E-2),
+L(-1.0924898127200937840689817557742469105693E-2),
+L(-9.6875626072830301572839422532631079809328E-3),
+L(-8.5313926245226231463436209313499745894157E-3),
+L(-7.4549452072765973384933565912143044991706E-3),
+L(-6.4568155251217050991200599386801665681310E-3),
+L(-5.5356355563671005131126851708522185605193E-3),
+L(-4.6900728132525199028885749289712348829878E-3),
+L(-3.9188291218610470766469347968659624282519E-3),
+L(-3.2206394539524058873423550293617843896540E-3),
+L(-2.5942708080877805657374888909297113032132E-3),
+L(-2.0385211375711716729239156839929281289086E-3),
+L(-1.5522183228760777967376942769773768850872E-3),
+L(-1.1342191863606077520036253234446621373191E-3),
+L(-7.8340854719967065861624024730268350459991E-4),
+L(-4.9869831458030115699628274852562992756174E-4),
+L(-2.7902661731604211834685052867305795169688E-4),
+L(-1.2335696813916860754951146082826952093496E-4),
+L(-3.0677461025892873184042490943581654591817E-5),
#define ZERO logtbl[38]
- 0.0000000000000000000000000000000000000000E0L,
--3.0359557945051052537099938863236321874198E-5L,
--1.2081346403474584914595395755316412213151E-4L,
--2.7044071846562177120083903771008342059094E-4L,
--4.7834133324631162897179240322783590830326E-4L,
--7.4363569786340080624467487620270965403695E-4L,
--1.0654639687057968333207323853366578860679E-3L,
--1.4429854811877171341298062134712230604279E-3L,
--1.8753781835651574193938679595797367137975E-3L,
--2.3618380914922506054347222273705859653658E-3L,
--2.9015787624124743013946600163375853631299E-3L,
--3.4938307889254087318399313316921940859043E-3L,
--4.1378413103128673800485306215154712148146E-3L,
--4.8328735414488877044289435125365629849599E-3L,
--5.5782063183564351739381962360253116934243E-3L,
--6.3731336597098858051938306767880719015261E-3L,
--7.2169643436165454612058905294782949315193E-3L,
--8.1090214990427641365934846191367315083867E-3L,
--9.0486422112807274112838713105168375482480E-3L,
--1.0035177140880864314674126398350812606841E-2L,
--1.1067990155502102718064936259435676477423E-2L,
--1.2146457974158024928196575103115488672416E-2L,
--1.3269969823361415906628825374158424754308E-2L,
--1.4437927104692837124388550722759686270765E-2L,
--1.5649743073340777659901053944852735064621E-2L,
--1.6904842527181702880599758489058031645317E-2L,
--1.8202661505988007336096407340750378994209E-2L,
--1.9542647000370545390701192438691126552961E-2L,
--2.0924256670080119637427928803038530924742E-2L,
--2.2346958571309108496179613803760727786257E-2L,
--2.3810230892650362330447187267648486279460E-2L,
--2.5313561699385640380910474255652501521033E-2L,
--2.6856448685790244233704909690165496625399E-2L,
--2.8438398935154170008519274953860128449036E-2L,
--3.0058928687233090922411781058956589863039E-2L,
--3.1717563112854831855692484086486099896614E-2L,
--3.3413836095418743219397234253475252001090E-2L,
--3.5147290019036555862676702093393332533702E-2L,
--3.6917475563073933027920505457688955423688E-2L,
--3.8723951502862058660874073462456610731178E-2L,
--4.0566284516358241168330505467000838017425E-2L,
--4.2444048996543693813649967076598766917965E-2L,
--4.4356826869355401653098777649745233339196E-2L,
--4.6304207416957323121106944474331029996141E-2L,
--4.8285787106164123613318093945035804818364E-2L,
--5.0301169421838218987124461766244507342648E-2L,
--5.2349964705088137924875459464622098310997E-2L,
--5.4431789996103111613753440311680967840214E-2L,
--5.6546268881465384189752786409400404404794E-2L,
--5.8693031345788023909329239565012647817664E-2L,
--6.0871713627532018185577188079210189048340E-2L,
--6.3081958078862169742820420185833800925568E-2L,
--6.5323413029406789694910800219643791556918E-2L,
--6.7595732653791419081537811574227049288168E-2L
+ L(0.0000000000000000000000000000000000000000E0),
+L(-3.0359557945051052537099938863236321874198E-5),
+L(-1.2081346403474584914595395755316412213151E-4),
+L(-2.7044071846562177120083903771008342059094E-4),
+L(-4.7834133324631162897179240322783590830326E-4),
+L(-7.4363569786340080624467487620270965403695E-4),
+L(-1.0654639687057968333207323853366578860679E-3),
+L(-1.4429854811877171341298062134712230604279E-3),
+L(-1.8753781835651574193938679595797367137975E-3),
+L(-2.3618380914922506054347222273705859653658E-3),
+L(-2.9015787624124743013946600163375853631299E-3),
+L(-3.4938307889254087318399313316921940859043E-3),
+L(-4.1378413103128673800485306215154712148146E-3),
+L(-4.8328735414488877044289435125365629849599E-3),
+L(-5.5782063183564351739381962360253116934243E-3),
+L(-6.3731336597098858051938306767880719015261E-3),
+L(-7.2169643436165454612058905294782949315193E-3),
+L(-8.1090214990427641365934846191367315083867E-3),
+L(-9.0486422112807274112838713105168375482480E-3),
+L(-1.0035177140880864314674126398350812606841E-2),
+L(-1.1067990155502102718064936259435676477423E-2),
+L(-1.2146457974158024928196575103115488672416E-2),
+L(-1.3269969823361415906628825374158424754308E-2),
+L(-1.4437927104692837124388550722759686270765E-2),
+L(-1.5649743073340777659901053944852735064621E-2),
+L(-1.6904842527181702880599758489058031645317E-2),
+L(-1.8202661505988007336096407340750378994209E-2),
+L(-1.9542647000370545390701192438691126552961E-2),
+L(-2.0924256670080119637427928803038530924742E-2),
+L(-2.2346958571309108496179613803760727786257E-2),
+L(-2.3810230892650362330447187267648486279460E-2),
+L(-2.5313561699385640380910474255652501521033E-2),
+L(-2.6856448685790244233704909690165496625399E-2),
+L(-2.8438398935154170008519274953860128449036E-2),
+L(-3.0058928687233090922411781058956589863039E-2),
+L(-3.1717563112854831855692484086486099896614E-2),
+L(-3.3413836095418743219397234253475252001090E-2),
+L(-3.5147290019036555862676702093393332533702E-2),
+L(-3.6917475563073933027920505457688955423688E-2),
+L(-3.8723951502862058660874073462456610731178E-2),
+L(-4.0566284516358241168330505467000838017425E-2),
+L(-4.2444048996543693813649967076598766917965E-2),
+L(-4.4356826869355401653098777649745233339196E-2),
+L(-4.6304207416957323121106944474331029996141E-2),
+L(-4.8285787106164123613318093945035804818364E-2),
+L(-5.0301169421838218987124461766244507342648E-2),
+L(-5.2349964705088137924875459464622098310997E-2),
+L(-5.4431789996103111613753440311680967840214E-2),
+L(-5.6546268881465384189752786409400404404794E-2),
+L(-5.8693031345788023909329239565012647817664E-2),
+L(-6.0871713627532018185577188079210189048340E-2),
+L(-6.3081958078862169742820420185833800925568E-2),
+L(-6.5323413029406789694910800219643791556918E-2),
+L(-6.7595732653791419081537811574227049288168E-2)
};
/* ln(2) = ln2a + ln2b with extended precision. */
-static const long double
- ln2a = 6.93145751953125e-1L,
- ln2b = 1.4286068203094172321214581765680755001344E-6L;
+static const _Float128
+ ln2a = L(6.93145751953125e-1),
+ ln2b = L(1.4286068203094172321214581765680755001344E-6);
-long double
-__ieee754_logl(long double x)
+_Float128
+__ieee754_logl(_Float128 x)
{
- long double z, y, w;
+ _Float128 z, y, w;
ieee854_long_double_shape_type u, t;
unsigned int m;
int k, e;
@@ -198,7 +199,7 @@ __ieee754_logl(long double x)
/* log(0) = -infinity. */
if ((k | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
{
- return -0.5L / ZERO;
+ return L(-0.5) / ZERO;
}
/* log ( x < 0 ) = NaN */
if (m & 0x80000000)
@@ -238,13 +239,13 @@ __ieee754_logl(long double x)
t.parts32.w3 = 0;
}
/* On this interval the table is not used due to cancellation error. */
- if ((x <= 1.0078125L) && (x >= 0.9921875L))
+ if ((x <= L(1.0078125)) && (x >= L(0.9921875)))
{
- if (x == 1.0L)
- return 0.0L;
- z = x - 1.0L;
+ if (x == 1)
+ return 0;
+ z = x - 1;
k = 64;
- t.value = 1.0L;
+ t.value = 1;
e = 0;
}
else
@@ -274,7 +275,7 @@ __ieee754_logl(long double x)
y += e * ln2b; /* Base 2 exponent offset times ln(2). */
y += z;
y += logtbl[k-26]; /* log(t) - (t-1) */
- y += (t.value - 1.0L);
+ y += (t.value - 1);
y += e * ln2a;
return y;
}
diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c
index 7f3037fb51..dc748c3a0b 100644
--- a/sysdeps/ieee754/ldbl-128/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128/e_powl.c
@@ -65,93 +65,94 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-static const long double bp[] = {
- 1.0L,
- 1.5L,
+static const _Float128 bp[] = {
+ 1,
+ L(1.5),
};
/* log_2(1.5) */
-static const long double dp_h[] = {
+static const _Float128 dp_h[] = {
0.0,
- 5.8496250072115607565592654282227158546448E-1L
+ L(5.8496250072115607565592654282227158546448E-1)
};
/* Low part of log_2(1.5) */
-static const long double dp_l[] = {
+static const _Float128 dp_l[] = {
0.0,
- 1.0579781240112554492329533686862998106046E-16L
+ L(1.0579781240112554492329533686862998106046E-16)
};
-static const long double zero = 0.0L,
- one = 1.0L,
- two = 2.0L,
- two113 = 1.0384593717069655257060992658440192E34L,
- huge = 1.0e3000L,
- tiny = 1.0e-3000L;
+static const _Float128 zero = 0,
+ one = 1,
+ two = 2,
+ two113 = L(1.0384593717069655257060992658440192E34),
+ huge = L(1.0e3000),
+ tiny = L(1.0e-3000);
/* 3/2 log x = 3 z + z^3 + z^3 (z^2 R(z^2))
z = (x-1)/(x+1)
1 <= x <= 1.25
Peak relative error 2.3e-37 */
-static const long double LN[] =
+static const _Float128 LN[] =
{
- -3.0779177200290054398792536829702930623200E1L,
- 6.5135778082209159921251824580292116201640E1L,
- -4.6312921812152436921591152809994014413540E1L,
- 1.2510208195629420304615674658258363295208E1L,
- -9.9266909031921425609179910128531667336670E-1L
+ L(-3.0779177200290054398792536829702930623200E1),
+ L(6.5135778082209159921251824580292116201640E1),
+ L(-4.6312921812152436921591152809994014413540E1),
+ L(1.2510208195629420304615674658258363295208E1),
+ L(-9.9266909031921425609179910128531667336670E-1)
};
-static const long double LD[] =
+static const _Float128 LD[] =
{
- -5.129862866715009066465422805058933131960E1L,
- 1.452015077564081884387441590064272782044E2L,
- -1.524043275549860505277434040464085593165E2L,
- 7.236063513651544224319663428634139768808E1L,
- -1.494198912340228235853027849917095580053E1L
+ L(-5.129862866715009066465422805058933131960E1),
+ L(1.452015077564081884387441590064272782044E2),
+ L(-1.524043275549860505277434040464085593165E2),
+ L(7.236063513651544224319663428634139768808E1),
+ L(-1.494198912340228235853027849917095580053E1)
/* 1.0E0 */
};
/* exp(x) = 1 + x - x / (1 - 2 / (x - x^2 R(x^2)))
0 <= x <= 0.5
Peak relative error 5.7e-38 */
-static const long double PN[] =
+static const _Float128 PN[] =
{
- 5.081801691915377692446852383385968225675E8L,
- 9.360895299872484512023336636427675327355E6L,
- 4.213701282274196030811629773097579432957E4L,
- 5.201006511142748908655720086041570288182E1L,
- 9.088368420359444263703202925095675982530E-3L,
+ L(5.081801691915377692446852383385968225675E8),
+ L(9.360895299872484512023336636427675327355E6),
+ L(4.213701282274196030811629773097579432957E4),
+ L(5.201006511142748908655720086041570288182E1),
+ L(9.088368420359444263703202925095675982530E-3),
};
-static const long double PD[] =
+static const _Float128 PD[] =
{
- 3.049081015149226615468111430031590411682E9L,
- 1.069833887183886839966085436512368982758E8L,
- 8.259257717868875207333991924545445705394E5L,
- 1.872583833284143212651746812884298360922E3L,
+ L(3.049081015149226615468111430031590411682E9),
+ L(1.069833887183886839966085436512368982758E8),
+ L(8.259257717868875207333991924545445705394E5),
+ L(1.872583833284143212651746812884298360922E3),
/* 1.0E0 */
};
-static const long double
+static const _Float128
/* ln 2 */
- lg2 = 6.9314718055994530941723212145817656807550E-1L,
- lg2_h = 6.9314718055994528622676398299518041312695E-1L,
- lg2_l = 2.3190468138462996154948554638754786504121E-17L,
- ovt = 8.0085662595372944372e-0017L,
+ lg2 = L(6.9314718055994530941723212145817656807550E-1),
+ lg2_h = L(6.9314718055994528622676398299518041312695E-1),
+ lg2_l = L(2.3190468138462996154948554638754786504121E-17),
+ ovt = L(8.0085662595372944372e-0017),
/* 2/(3*log(2)) */
- cp = 9.6179669392597560490661645400126142495110E-1L,
- cp_h = 9.6179669392597555432899980587535537779331E-1L,
- cp_l = 5.0577616648125906047157785230014751039424E-17L;
+ cp = L(9.6179669392597560490661645400126142495110E-1),
+ cp_h = L(9.6179669392597555432899980587535537779331E-1),
+ cp_l = L(5.0577616648125906047157785230014751039424E-17);
-long double
-__ieee754_powl (long double x, long double y)
+_Float128
+__ieee754_powl (_Float128 x, _Float128 y)
{
- long double z, ax, z_h, z_l, p_h, p_l;
- long double y1, t1, t2, r, s, sgn, t, u, v, w;
- long double s2, s_h, s_l, t_h, t_l, ay;
+ _Float128 z, ax, z_h, z_l, p_h, p_l;
+ _Float128 y1, t1, t2, r, s, sgn, t, u, v, w;
+ _Float128 s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
- u_int32_t ix, iy;
+ uint32_t ix, iy;
int32_t hx, hy;
ieee854_long_double_shape_type o, p, q;
@@ -165,13 +166,14 @@ __ieee754_powl (long double x, long double y)
/* y==zero: x**0 = 1 */
- if ((iy | q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0)
+ if ((iy | q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0
+ && !issignaling (x))
return one;
/* 1.0**y = 1; -1.0**+-Inf = 1 */
- if (x == one)
+ if (x == one && !issignaling (y))
return one;
- if (x == -1.0L && iy == 0x7fff0000
+ if (x == -1 && iy == 0x7fff0000
&& (q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0)
return one;
@@ -232,7 +234,7 @@ __ieee754_powl (long double x, long double y)
if (hy == 0x3ffe0000)
{ /* y is 0.5 */
if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrtl (x);
+ return sqrtl (x);
}
}
@@ -259,12 +261,12 @@ __ieee754_powl (long double x, long double y)
}
/* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | yisint) == 0)
return (x - x) / (x - x);
/* sgn (sign of result -ve**odd) = -1 else = 1 */
sgn = one;
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
sgn = -one; /* (-ve)**(odd int) */
/* |y| is huge.
@@ -363,7 +365,7 @@ __ieee754_powl (long double x, long double y)
z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */
z_l = cp_l * p_h + p_l * cp + dp_l[k];
/* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
- t = (long double) n;
+ t = (_Float128) n;
t1 = (((z_h + z_l) + dp_h[k]) + t);
o.value = t1;
o.parts32.w3 = 0;
@@ -411,7 +413,7 @@ __ieee754_powl (long double x, long double y)
n = 0;
if (i > 0x3ffe0000)
{ /* if |z| > 0.5, set n = [z+0.5] */
- n = __floorl (z + 0.5L);
+ n = __floorl (z + L(0.5));
t = n;
p_h -= t;
}
@@ -437,7 +439,7 @@ __ieee754_powl (long double x, long double y)
if ((j >> 16) <= 0)
{
z = __scalbnl (z, n); /* subnormal output */
- long double force_underflow = z * z;
+ _Float128 force_underflow = z * z;
math_force_eval (force_underflow);
}
else
diff --git a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
index 101a4c9015..d226d4218d 100644
--- a/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -183,22 +183,22 @@ static const int32_t two_over_pi[] = {
0x7b7b89, 0x483d38,
};
-static const long double c[] = {
+static const _Float128 c[] = {
/* 113 bits of pi/2 */
#define PI_2_1 c[0]
- 0x1.921fb54442d18469898cc51701b8p+0L,
+ L(0x1.921fb54442d18469898cc51701b8p+0),
/* pi/2 - PI_2_1 */
#define PI_2_1t c[1]
- 0x3.9a252049c1114cf98e804177d4c8p-116L,
+ L(0x3.9a252049c1114cf98e804177d4c8p-116),
};
-int32_t __ieee754_rem_pio2l(long double x, long double *y)
+int32_t __ieee754_rem_pio2l(_Float128 x, _Float128 *y)
{
- long double z, w, t;
+ _Float128 z, w, t;
double tx[8];
int64_t exp, n, ix, hx;
- u_int64_t lx;
+ uint64_t lx;
GET_LDOUBLE_WORDS64 (hx, lx, x);
ix = hx & 0x7fffffffffffffffLL;
@@ -255,8 +255,8 @@ int32_t __ieee754_rem_pio2l(long double x, long double *y)
/* The result is now stored in 3 double values, we need to convert it into
two long double values. */
- t = (long double) tx [6] + (long double) tx [7];
- w = (long double) tx [5];
+ t = (_Float128) tx [6] + (_Float128) tx [7];
+ w = (_Float128) tx [5];
if (hx >= 0)
{
diff --git a/sysdeps/ieee754/ldbl-128/e_remainderl.c b/sysdeps/ieee754/ldbl-128/e_remainderl.c
index 88df6f54c2..09b8640b78 100644
--- a/sysdeps/ieee754/ldbl-128/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128/e_remainderl.c
@@ -24,15 +24,15 @@
#include <math.h>
#include <math_private.h>
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__ieee754_remainderl(long double x, long double p)
+_Float128
+__ieee754_remainderl(_Float128 x, _Float128 p)
{
int64_t hx,hp;
- u_int64_t sx,lx,lp;
- long double p_half;
+ uint64_t sx,lx,lp;
+ _Float128 p_half;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hp,lp,p);
@@ -58,7 +58,7 @@ __ieee754_remainderl(long double x, long double p)
if(x+x>=p) x -= p;
}
} else {
- p_half = 0.5L*p;
+ p_half = L(0.5)*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
diff --git a/sysdeps/ieee754/ldbl-128/e_sinhl.c b/sysdeps/ieee754/ldbl-128/e_sinhl.c
index 11974a39af..39e7cf3084 100644
--- a/sysdeps/ieee754/ldbl-128/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128/e_sinhl.c
@@ -56,15 +56,16 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-static const long double one = 1.0, shuge = 1.0e4931L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, shuge = L(1.0e4931),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
-long double
-__ieee754_sinhl (long double x)
+_Float128
+__ieee754_sinhl (_Float128 x)
{
- long double t, w, h;
- u_int32_t jx, ix;
+ _Float128 t, w, h;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
/* Words of |x|. */
diff --git a/sysdeps/ieee754/ldbl-128/float128-abi.h b/sysdeps/ieee754/ldbl-128/float128-abi.h
new file mode 100644
index 0000000000..3077ffc7fe
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/float128-abi.h
@@ -0,0 +1,2 @@
+/* ABI version for _Float128 ABI introduction. */
+#define FLOAT128_VERSION GLIBC_2.27
diff --git a/sysdeps/ieee754/ldbl-128/gamma_productl.c b/sysdeps/ieee754/ldbl-128/gamma_productl.c
index 849b57d95d..2c1a03a915 100644
--- a/sysdeps/ieee754/ldbl-128/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
@@ -58,17 +28,17 @@ mul_split (long double *hi, long double *lo, long double x, long double y)
X is small enough that factors quadratic in it can be
neglected. */
-long double
-__gamma_productl (long double x, long double x_eps, int n, long double *eps)
+_Float128
+__gamma_productl (_Float128 x, _Float128 x_eps, int n, _Float128 *eps)
{
SET_RESTORE_ROUNDL (FE_TONEAREST);
- long double ret = x;
+ _Float128 ret = x;
*eps = x_eps / x;
for (int i = 1; i < n; i++)
{
*eps += x_eps / (x + i);
- long double lo;
- mul_split (&ret, &lo, ret, x + i);
+ _Float128 lo;
+ mul_splitl (&ret, &lo, ret, x + i);
*eps += lo / ret;
}
return ret;
diff --git a/sysdeps/ieee754/ldbl-128/ieee754.h b/sysdeps/ieee754/ldbl-128/ieee754.h
index fb42140933..d7173b6a8b 100644
--- a/sysdeps/ieee754/ldbl-128/ieee754.h
+++ b/sysdeps/ieee754/ldbl-128/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128/k_cosl.c b/sysdeps/ieee754/ldbl-128/k_cosl.c
index 3985b1225b..866af57921 100644
--- a/sysdeps/ieee754/ldbl-128/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_cosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,9 +20,9 @@
#include <math.h>
#include <math_private.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -31,11 +31,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
x in <0,0.1484375> */
@@ -47,14 +47,14 @@ static const long double c[] = {
#define COS6 c[11]
#define COS7 c[12]
#define COS8 c[13]
--4.99999999999999999999999999999999759E-01L, /* bffdfffffffffffffffffffffffffffb */
- 4.16666666666666666666666666651287795E-02L, /* 3ffa5555555555555555555555516f30 */
--1.38888888888888888888888742314300284E-03L, /* bff56c16c16c16c16c16c16a463dfd0d */
- 2.48015873015873015867694002851118210E-05L, /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
--2.75573192239858811636614709689300351E-07L, /* bfe927e4fb7789f5aa8142a22044b51f */
- 2.08767569877762248667431926878073669E-09L, /* 3fe21eed8eff881d1e9262d7adff4373 */
--1.14707451049343817400420280514614892E-11L, /* bfda9397496922a9601ed3d4ca48944b */
- 4.77810092804389587579843296923533297E-14L, /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
+L(-4.99999999999999999999999999999999759E-01), /* bffdfffffffffffffffffffffffffffb */
+ L(4.16666666666666666666666666651287795E-02), /* 3ffa5555555555555555555555516f30 */
+L(-1.38888888888888888888888742314300284E-03), /* bff56c16c16c16c16c16c16a463dfd0d */
+ L(2.48015873015873015867694002851118210E-05), /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
+L(-2.75573192239858811636614709689300351E-07), /* bfe927e4fb7789f5aa8142a22044b51f */
+ L(2.08767569877762248667431926878073669E-09), /* 3fe21eed8eff881d1e9262d7adff4373 */
+L(-1.14707451049343817400420280514614892E-11), /* bfda9397496922a9601ed3d4ca48944b */
+ L(4.77810092804389587579843296923533297E-14), /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -63,27 +63,27 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
-long double
-__kernel_cosl(long double x, long double y)
+_Float128
+__kernel_cosl(_Float128 x, _Float128 y)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -118,7 +118,7 @@ __kernel_cosl(long double x, long double y)
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
l = y - (h - x);
z = l * l;
sin_l = l*(ONE+z*(SSIN1+z*(SSIN2+z*(SSIN3+z*(SSIN4+z*SSIN5)))));
diff --git a/sysdeps/ieee754/ldbl-128/k_sincosl.c b/sysdeps/ieee754/ldbl-128/k_sincosl.c
index 404df352d3..6eb33ae375 100644
--- a/sysdeps/ieee754/ldbl-128/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,10 +20,11 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -32,11 +33,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
x in <0,0.1484375> */
@@ -48,14 +49,14 @@ static const long double c[] = {
#define COS6 c[11]
#define COS7 c[12]
#define COS8 c[13]
--4.99999999999999999999999999999999759E-01L, /* bffdfffffffffffffffffffffffffffb */
- 4.16666666666666666666666666651287795E-02L, /* 3ffa5555555555555555555555516f30 */
--1.38888888888888888888888742314300284E-03L, /* bff56c16c16c16c16c16c16a463dfd0d */
- 2.48015873015873015867694002851118210E-05L, /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
--2.75573192239858811636614709689300351E-07L, /* bfe927e4fb7789f5aa8142a22044b51f */
- 2.08767569877762248667431926878073669E-09L, /* 3fe21eed8eff881d1e9262d7adff4373 */
--1.14707451049343817400420280514614892E-11L, /* bfda9397496922a9601ed3d4ca48944b */
- 4.77810092804389587579843296923533297E-14L, /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
+L(-4.99999999999999999999999999999999759E-01), /* bffdfffffffffffffffffffffffffffb */
+ L(4.16666666666666666666666666651287795E-02), /* 3ffa5555555555555555555555516f30 */
+L(-1.38888888888888888888888742314300284E-03), /* bff56c16c16c16c16c16c16a463dfd0d */
+ L(2.48015873015873015867694002851118210E-05), /* 3fefa01a01a01a01a0195cebe6f3d3a5 */
+L(-2.75573192239858811636614709689300351E-07), /* bfe927e4fb7789f5aa8142a22044b51f */
+ L(2.08767569877762248667431926878073669E-09), /* 3fe21eed8eff881d1e9262d7adff4373 */
+L(-1.14707451049343817400420280514614892E-11), /* bfda9397496922a9601ed3d4ca48944b */
+ L(4.77810092804389587579843296923533297E-14), /* 3fd2ae5f8197cbcdcaf7c3fb4523414c */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -64,11 +65,11 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
/* sin x ~ ONE * x + x^3 ( SIN1 + SIN2 * x^2 + ... + SIN7 * x^12 + SIN8 * x^14 )
x in <0,0.1484375> */
@@ -80,30 +81,30 @@ static const long double c[] = {
#define SIN6 c[24]
#define SIN7 c[25]
#define SIN8 c[26]
--1.66666666666666666666666666666666538e-01L, /* bffc5555555555555555555555555550 */
- 8.33333333333333333333333333307532934e-03L, /* 3ff811111111111111111111110e7340 */
--1.98412698412698412698412534478712057e-04L, /* bff2a01a01a01a01a01a019e7a626296 */
- 2.75573192239858906520896496653095890e-06L, /* 3fec71de3a556c7338fa38527474b8f5 */
--2.50521083854417116999224301266655662e-08L, /* bfe5ae64567f544e16c7de65c2ea551f */
- 1.60590438367608957516841576404938118e-10L, /* 3fde6124613a811480538a9a41957115 */
--7.64716343504264506714019494041582610e-13L, /* bfd6ae7f3d5aef30c7bc660b060ef365 */
- 2.81068754939739570236322404393398135e-15L, /* 3fce9510115aabf87aceb2022a9a9180 */
+L(-1.66666666666666666666666666666666538e-01), /* bffc5555555555555555555555555550 */
+ L(8.33333333333333333333333333307532934e-03), /* 3ff811111111111111111111110e7340 */
+L(-1.98412698412698412698412534478712057e-04), /* bff2a01a01a01a01a01a019e7a626296 */
+ L(2.75573192239858906520896496653095890e-06), /* 3fec71de3a556c7338fa38527474b8f5 */
+L(-2.50521083854417116999224301266655662e-08), /* bfe5ae64567f544e16c7de65c2ea551f */
+ L(1.60590438367608957516841576404938118e-10), /* 3fde6124613a811480538a9a41957115 */
+L(-7.64716343504264506714019494041582610e-13), /* bfd6ae7f3d5aef30c7bc660b060ef365 */
+ L(2.81068754939739570236322404393398135e-15), /* 3fce9510115aabf87aceb2022a9a9180 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
void
-__kernel_sincosl(long double x, long double y, long double *sinx, long double *cosx, int iy)
+__kernel_sincosl(_Float128 x, _Float128 y, _Float128 *sinx, _Float128 *cosx, int iy)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -149,7 +150,7 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
if (iy)
l = y - (h - x);
else
diff --git a/sysdeps/ieee754/ldbl-128/k_sinl.c b/sysdeps/ieee754/ldbl-128/k_sinl.c
index 6290b173b4..9c19fb1bf2 100644
--- a/sysdeps/ieee754/ldbl-128/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,10 +20,11 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
-static const long double c[] = {
+static const _Float128 c[] = {
#define ONE c[0]
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
/* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
x in <0,1/256> */
@@ -32,11 +33,11 @@ static const long double c[] = {
#define SCOS3 c[3]
#define SCOS4 c[4]
#define SCOS5 c[5]
--5.00000000000000000000000000000000000E-01L, /* bffe0000000000000000000000000000 */
- 4.16666666666666666666666666556146073E-02L, /* 3ffa5555555555555555555555395023 */
--1.38888888888888888888309442601939728E-03L, /* bff56c16c16c16c16c16a566e42c0375 */
- 2.48015873015862382987049502531095061E-05L, /* 3fefa01a01a019ee02dcf7da2d6d5444 */
--2.75573112601362126593516899592158083E-07L, /* bfe927e4f5dce637cb0b54908754bde0 */
+L(-5.00000000000000000000000000000000000E-01), /* bffe0000000000000000000000000000 */
+ L(4.16666666666666666666666666556146073E-02), /* 3ffa5555555555555555555555395023 */
+L(-1.38888888888888888888309442601939728E-03), /* bff56c16c16c16c16c16a566e42c0375 */
+ L(2.48015873015862382987049502531095061E-05), /* 3fefa01a01a019ee02dcf7da2d6d5444 */
+L(-2.75573112601362126593516899592158083E-07), /* bfe927e4f5dce637cb0b54908754bde0 */
/* sin x ~ ONE * x + x^3 ( SIN1 + SIN2 * x^2 + ... + SIN7 * x^12 + SIN8 * x^14 )
x in <0,0.1484375> */
@@ -48,14 +49,14 @@ static const long double c[] = {
#define SIN6 c[11]
#define SIN7 c[12]
#define SIN8 c[13]
--1.66666666666666666666666666666666538e-01L, /* bffc5555555555555555555555555550 */
- 8.33333333333333333333333333307532934e-03L, /* 3ff811111111111111111111110e7340 */
--1.98412698412698412698412534478712057e-04L, /* bff2a01a01a01a01a01a019e7a626296 */
- 2.75573192239858906520896496653095890e-06L, /* 3fec71de3a556c7338fa38527474b8f5 */
--2.50521083854417116999224301266655662e-08L, /* bfe5ae64567f544e16c7de65c2ea551f */
- 1.60590438367608957516841576404938118e-10L, /* 3fde6124613a811480538a9a41957115 */
--7.64716343504264506714019494041582610e-13L, /* bfd6ae7f3d5aef30c7bc660b060ef365 */
- 2.81068754939739570236322404393398135e-15L, /* 3fce9510115aabf87aceb2022a9a9180 */
+L(-1.66666666666666666666666666666666538e-01), /* bffc5555555555555555555555555550 */
+ L(8.33333333333333333333333333307532934e-03), /* 3ff811111111111111111111110e7340 */
+L(-1.98412698412698412698412534478712057e-04), /* bff2a01a01a01a01a01a019e7a626296 */
+ L(2.75573192239858906520896496653095890e-06), /* 3fec71de3a556c7338fa38527474b8f5 */
+L(-2.50521083854417116999224301266655662e-08), /* bfe5ae64567f544e16c7de65c2ea551f */
+ L(1.60590438367608957516841576404938118e-10), /* 3fde6124613a811480538a9a41957115 */
+L(-7.64716343504264506714019494041582610e-13), /* bfd6ae7f3d5aef30c7bc660b060ef365 */
+ L(2.81068754939739570236322404393398135e-15), /* 3fce9510115aabf87aceb2022a9a9180 */
/* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * x^8 )
x in <0,1/256> */
@@ -64,27 +65,27 @@ static const long double c[] = {
#define SSIN3 c[16]
#define SSIN4 c[17]
#define SSIN5 c[18]
--1.66666666666666666666666666666666659E-01L, /* bffc5555555555555555555555555555 */
- 8.33333333333333333333333333146298442E-03L, /* 3ff81111111111111111111110fe195d */
--1.98412698412698412697726277416810661E-04L, /* bff2a01a01a01a01a019e7121e080d88 */
- 2.75573192239848624174178393552189149E-06L, /* 3fec71de3a556c640c6aaa51aa02ab41 */
--2.50521016467996193495359189395805639E-08L, /* bfe5ae644ee90c47dc71839de75b2787 */
+L(-1.66666666666666666666666666666666659E-01), /* bffc5555555555555555555555555555 */
+ L(8.33333333333333333333333333146298442E-03), /* 3ff81111111111111111111110fe195d */
+L(-1.98412698412698412697726277416810661E-04), /* bff2a01a01a01a01a019e7121e080d88 */
+ L(2.75573192239848624174178393552189149E-06), /* 3fec71de3a556c640c6aaa51aa02ab41 */
+L(-2.50521016467996193495359189395805639E-08), /* bfe5ae644ee90c47dc71839de75b2787 */
};
#define SINCOSL_COS_HI 0
#define SINCOSL_COS_LO 1
#define SINCOSL_SIN_HI 2
#define SINCOSL_SIN_LO 3
-extern const long double __sincosl_table[];
+extern const _Float128 __sincosl_table[];
-long double
-__kernel_sinl(long double x, long double y, int iy)
+_Float128
+__kernel_sinl(_Float128 x, _Float128 y, int iy)
{
- long double h, l, z, sin_l, cos_l_m1;
+ _Float128 h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
GET_LDOUBLE_MSW64 (ix, x);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3ffc3000) /* |x| < 0.1484375 */
{
@@ -118,7 +119,7 @@ __kernel_sinl(long double x, long double y, int iy)
case 2: index = (hix - 0x3ffc3000) >> 10; break;
}
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ SET_LDOUBLE_WORDS64(h, ((uint64_t)hix) << 32, 0);
if (iy)
l = (ix < 0 ? -y : y) - (h - x);
else
diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c
index 6bb221e4a6..8da794d80c 100644
--- a/sysdeps/ieee754/ldbl-128/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/k_tanl.c
@@ -57,36 +57,38 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
-static const long double
- one = 1.0L,
- pio4hi = 7.8539816339744830961566084581987569936977E-1L,
- pio4lo = 2.1679525325309452561992610065108379921906E-35L,
+#include <math-underflow.h>
+#include <libc-diag.h>
+
+static const _Float128
+ one = 1,
+ pio4hi = L(7.8539816339744830961566084581987569936977E-1),
+ pio4lo = L(2.1679525325309452561992610065108379921906E-35),
/* tan x = x + x^3 / 3 + x^5 T(x^2)/U(x^2)
0 <= x <= 0.6743316650390625
Peak relative error 8.0e-36 */
- TH = 3.333333333333333333333333333333333333333E-1L,
- T0 = -1.813014711743583437742363284336855889393E7L,
- T1 = 1.320767960008972224312740075083259247618E6L,
- T2 = -2.626775478255838182468651821863299023956E4L,
- T3 = 1.764573356488504935415411383687150199315E2L,
- T4 = -3.333267763822178690794678978979803526092E-1L,
+ TH = L(3.333333333333333333333333333333333333333E-1),
+ T0 = L(-1.813014711743583437742363284336855889393E7),
+ T1 = L(1.320767960008972224312740075083259247618E6),
+ T2 = L(-2.626775478255838182468651821863299023956E4),
+ T3 = L(1.764573356488504935415411383687150199315E2),
+ T4 = L(-3.333267763822178690794678978979803526092E-1),
- U0 = -1.359761033807687578306772463253710042010E8L,
- U1 = 6.494370630656893175666729313065113194784E7L,
- U2 = -4.180787672237927475505536849168729386782E6L,
- U3 = 8.031643765106170040139966622980914621521E4L,
- U4 = -5.323131271912475695157127875560667378597E2L;
+ U0 = L(-1.359761033807687578306772463253710042010E8),
+ U1 = L(6.494370630656893175666729313065113194784E7),
+ U2 = L(-4.180787672237927475505536849168729386782E6),
+ U3 = L(8.031643765106170040139966622980914621521E4),
+ U4 = L(-5.323131271912475695157127875560667378597E2);
/* 1.000000000000000000000000000000000000000E0 */
-long double
-__kernel_tanl (long double x, long double y, int iy)
+_Float128
+__kernel_tanl (_Float128 x, _Float128 y, int iy)
{
- long double z, r, v, w, s;
+ _Float128 z, r, v, w, s;
int32_t ix, sign;
ieee854_long_double_shape_type u, u1;
@@ -98,7 +100,7 @@ __kernel_tanl (long double x, long double y, int iy)
{ /* generate inexact */
if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3
| (iy + 1)) == 0)
- return one / fabs (x);
+ return one / fabsl (x);
else if (iy == 1)
{
math_check_force_underflow (x);
@@ -134,7 +136,7 @@ __kernel_tanl (long double x, long double y, int iy)
w = x + r;
if (ix >= 0x3ffe5942)
{
- v = (long double) iy;
+ v = (_Float128) iy;
w = (v - 2.0 * (x - (w * w / (w + v) - r)));
/* SIGN is set for arguments that reach this code, but not
otherwise, resulting in warnings that it may be used
diff --git a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
index e3f97623ed..0c0d43155d 100644
--- a/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <ieee754.h>
#include <float.h>
#include <math.h>
+#include <math_private.h>
#include <stdlib.h>
/* Convert a `long double' in IEEE854 quad-precision format to a
@@ -31,7 +32,7 @@
mp_size_t
__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
- long double value)
+ _Float128 value)
{
union ieee854_long_double u;
u.d = value;
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_negl.c b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
index df46199b82..f5043719ad 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,142 +20,142 @@
#include <math.h>
#include <math_private.h>
-static const long double lgamma_zeros[][2] =
+static const _Float128 lgamma_zeros[][2] =
{
- { -0x2.74ff92c01f0d82abec9f315f1a08p+0L, 0xe.d3ccb7fb2658634a2b9f6b2ba81p-116L },
- { -0x2.bf6821437b20197995a4b4641eaep+0L, -0xb.f4b00b4829f961e428533e6ad048p-116L },
- { -0x3.24c1b793cb35efb8be699ad3d9bap+0L, -0x6.5454cb7fac60e3f16d9d7840c2ep-116L },
- { -0x3.f48e2a8f85fca170d4561291236cp+0L, -0xc.320a4887d1cb4c711828a75d5758p-116L },
- { -0x4.0a139e16656030c39f0b0de18114p+0L, 0x1.53e84029416e1242006b2b3d1cfp-112L },
- { -0x4.fdd5de9bbabf3510d0aa40769884p+0L, -0x1.01d7d78125286f78d1e501f14966p-112L },
- { -0x5.021a95fc2db6432a4c56e595394cp+0L, -0x1.ecc6af0430d4fe5746fa7233356fp-112L },
- { -0x5.ffa4bd647d0357dd4ed62cbd31ecp+0L, -0x1.f8e3f8e5deba2d67dbd70dd96ce1p-112L },
- { -0x6.005ac9625f233b607c2d96d16384p+0L, -0x1.cb86ac569340cf1e5f24df7aab7bp-112L },
- { -0x6.fff2fddae1bbff3d626b65c23fd4p+0L, 0x1.e0bfcff5c457ebcf4d3ad9674167p-112L },
- { -0x7.000cff7b7f87adf4482dcdb98784p+0L, 0x1.54d99e35a74d6407b80292df199fp-112L },
- { -0x7.fffe5fe05673c3ca9e82b522b0ccp+0L, 0x1.62d177c832e0eb42c2faffd1b145p-112L },
- { -0x8.0001a01459fc9f60cb3cec1cec88p+0L, 0x2.8998835ac7277f7bcef67c47f188p-112L },
- { -0x8.ffffd1c425e80ffc864e95749258p+0L, -0x1.e7e20210e7f81cf781b44e9d2b02p-112L },
- { -0x9.00002e3bb47d86d6d843fedc352p+0L, 0x2.14852f613a16291751d2ab751f7ep-112L },
- { -0x9.fffffb606bdfdcd062ae77a50548p+0L, 0x3.962d1490cc2e8f031c7007eaa1ap-116L },
- { -0xa.0000049f93bb9927b45d95e1544p+0L, -0x1.e03086db9146a9287bd4f2172d5ap-112L },
- { -0xa.ffffff9466e9f1b36dacd2adbd18p+0L, -0xd.05a4e458062f3f95345a4d9c9b6p-116L },
- { -0xb.0000006b9915315d965a6ffea41p+0L, 0x1.b415c6fff233e7b7fdc3a094246fp-112L },
- { -0xb.fffffff7089387387de41acc3d4p+0L, 0x3.687427c6373bd74a10306e10a28ep-112L },
- { -0xc.00000008f76c7731567c0f0250fp+0L, -0x3.87920df5675833859190eb128ef6p-112L },
- { -0xc.ffffffff4f6dcf617f97a5ffc758p+0L, 0x2.ab72d76f32eaee2d1a42ed515d3ap-116L },
- { -0xd.00000000b092309c06683dd1b9p+0L, -0x3.e3700857a15c19ac5a611de9688ap-112L },
- { -0xd.fffffffff36345ab9e184a3e09dp+0L, -0x1.176dc48e47f62d917973dd44e553p-112L },
- { -0xe.000000000c9cba545e94e75ec57p+0L, -0x1.8f753e2501e757a17cf2ecbeeb89p-112L },
- { -0xe.ffffffffff28c060c6604ef3037p+0L, -0x1.f89d37357c9e3dc17c6c6e63becap-112L },
- { -0xf.0000000000d73f9f399bd0e420f8p+0L, -0x5.e9ee31b0b890744fc0e3fbc01048p-116L },
- { -0xf.fffffffffff28c060c6621f512e8p+0L, 0xd.1b2eec9d960bd9adc5be5f5fa5p-116L },
- { -0x1.000000000000d73f9f399da1424cp+4L, 0x6.c46e0e88305d2800f0e414c506a8p-116L },
- { -0x1.0ffffffffffff3569c47e7a93e1cp+4L, -0x4.6a08a2e008a998ebabb8087efa2cp-112L },
- { -0x1.1000000000000ca963b818568887p+4L, -0x6.ca5a3a64ec15db0a95caf2c9ffb4p-112L },
- { -0x1.1fffffffffffff4bec3ce234132dp+4L, -0x8.b2b726187c841cb92cd5221e444p-116L },
- { -0x1.20000000000000b413c31dcbeca5p+4L, 0x3.c4d005344b6cd0e7231120294abcp-112L },
- { -0x1.2ffffffffffffff685b25cbf5f54p+4L, -0x5.ced932e38485f7dd296b8fa41448p-112L },
- { -0x1.30000000000000097a4da340a0acp+4L, 0x7.e484e0e0ffe38d406ebebe112f88p-112L },
- { -0x1.3fffffffffffffff86af516ff7f7p+4L, -0x6.bd67e720d57854502b7db75e1718p-112L },
- { -0x1.40000000000000007950ae900809p+4L, 0x6.bec33375cac025d9c073168c5d9p-112L },
- { -0x1.4ffffffffffffffffa391c4248c3p+4L, 0x5.c63022b62b5484ba346524db607p-112L },
- { -0x1.500000000000000005c6e3bdb73dp+4L, -0x5.c62f55ed5322b2685c5e9a51e6a8p-112L },
- { -0x1.5fffffffffffffffffbcc71a492p+4L, -0x1.eb5aeb96c74d7ad25e060528fb5p-112L },
- { -0x1.6000000000000000004338e5b6ep+4L, 0x1.eb5aec04b2f2eb663e4e3d8a018cp-112L },
- { -0x1.6ffffffffffffffffffd13c97d9dp+4L, -0x3.8fcc4d08d6fe5aa56ab04307ce7ep-112L },
- { -0x1.70000000000000000002ec368263p+4L, 0x3.8fcc4d090cee2f5d0b69a99c353cp-112L },
- { -0x1.7fffffffffffffffffffe0d30fe7p+4L, 0x7.2f577cca4b4c8cb1dc14001ac5ecp-112L },
- { -0x1.800000000000000000001f2cf019p+4L, -0x7.2f577cca4b3442e35f0040b3b9e8p-112L },
- { -0x1.8ffffffffffffffffffffec0c332p+4L, -0x2.e9a0572b1bb5b95f346a92d67a6p-112L },
- { -0x1.90000000000000000000013f3ccep+4L, 0x2.e9a0572b1bb5c371ddb3561705ap-112L },
- { -0x1.9ffffffffffffffffffffff3b8bdp+4L, -0x1.cad8d32e386fd783e97296d63dcbp-116L },
- { -0x1.a0000000000000000000000c4743p+4L, 0x1.cad8d32e386fd7c1ab8c1fe34c0ep-116L },
- { -0x1.afffffffffffffffffffffff8b95p+4L, -0x3.8f48cc5737d5979c39db806c5406p-112L },
- { -0x1.b00000000000000000000000746bp+4L, 0x3.8f48cc5737d5979c3b3a6bda06f6p-112L },
- { -0x1.bffffffffffffffffffffffffbd8p+4L, 0x6.2898d42174dcf171470d8c8c6028p-112L },
- { -0x1.c000000000000000000000000428p+4L, -0x6.2898d42174dcf171470d18ba412cp-112L },
- { -0x1.cfffffffffffffffffffffffffdbp+4L, -0x4.c0ce9794ea50a839e311320bde94p-112L },
- { -0x1.d000000000000000000000000025p+4L, 0x4.c0ce9794ea50a839e311322f7cf8p-112L },
- { -0x1.dfffffffffffffffffffffffffffp+4L, 0x3.932c5047d60e60caded4c298a174p-112L },
- { -0x1.e000000000000000000000000001p+4L, -0x3.932c5047d60e60caded4c298973ap-112L },
- { -0x1.fp+4L, 0xa.1a6973c1fade2170f7237d35fe3p-116L },
- { -0x1.fp+4L, -0xa.1a6973c1fade2170f7237d35fe08p-116L },
- { -0x2p+4L, 0x5.0d34b9e0fd6f10b87b91be9aff1p-120L },
- { -0x2p+4L, -0x5.0d34b9e0fd6f10b87b91be9aff0cp-120L },
- { -0x2.1p+4L, 0x2.73024a9ba1aa36a7059bff52e844p-124L },
- { -0x2.1p+4L, -0x2.73024a9ba1aa36a7059bff52e844p-124L },
- { -0x2.2p+4L, 0x1.2710231c0fd7a13f8a2b4af9d6b7p-128L },
- { -0x2.2p+4L, -0x1.2710231c0fd7a13f8a2b4af9d6b7p-128L },
- { -0x2.3p+4L, 0x8.6e2ce38b6c8f9419e3fad3f0312p-136L },
- { -0x2.3p+4L, -0x8.6e2ce38b6c8f9419e3fad3f0312p-136L },
- { -0x2.4p+4L, 0x3.bf30652185952560d71a254e4eb8p-140L },
- { -0x2.4p+4L, -0x3.bf30652185952560d71a254e4eb8p-140L },
- { -0x2.5p+4L, 0x1.9ec8d1c94e85af4c78b15c3d89d3p-144L },
- { -0x2.5p+4L, -0x1.9ec8d1c94e85af4c78b15c3d89d3p-144L },
- { -0x2.6p+4L, 0xa.ea565ce061d57489e9b85276274p-152L },
- { -0x2.6p+4L, -0xa.ea565ce061d57489e9b85276274p-152L },
- { -0x2.7p+4L, 0x4.7a6512692eb37804111dabad30ecp-156L },
- { -0x2.7p+4L, -0x4.7a6512692eb37804111dabad30ecp-156L },
- { -0x2.8p+4L, 0x1.ca8ed42a12ae3001a07244abad2bp-160L },
- { -0x2.8p+4L, -0x1.ca8ed42a12ae3001a07244abad2bp-160L },
- { -0x2.9p+4L, 0xb.2f30e1ce812063f12e7e8d8d96e8p-168L },
- { -0x2.9p+4L, -0xb.2f30e1ce812063f12e7e8d8d96e8p-168L },
- { -0x2.ap+4L, 0x4.42bd49d4c37a0db136489772e428p-172L },
- { -0x2.ap+4L, -0x4.42bd49d4c37a0db136489772e428p-172L },
- { -0x2.bp+4L, 0x1.95db45257e5122dcbae56def372p-176L },
- { -0x2.bp+4L, -0x1.95db45257e5122dcbae56def372p-176L },
- { -0x2.cp+4L, 0x9.3958d81ff63527ecf993f3fb6f48p-184L },
- { -0x2.cp+4L, -0x9.3958d81ff63527ecf993f3fb6f48p-184L },
- { -0x2.dp+4L, 0x3.47970e4440c8f1c058bd238c9958p-188L },
- { -0x2.dp+4L, -0x3.47970e4440c8f1c058bd238c9958p-188L },
- { -0x2.ep+4L, 0x1.240804f65951062ca46e4f25c608p-192L },
- { -0x2.ep+4L, -0x1.240804f65951062ca46e4f25c608p-192L },
- { -0x2.fp+4L, 0x6.36a382849fae6de2d15362d8a394p-200L },
- { -0x2.fp+4L, -0x6.36a382849fae6de2d15362d8a394p-200L },
- { -0x3p+4L, 0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204L },
- { -0x3p+4L, -0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204L },
- { -0x3.1p+4L, 0xa.d21786ff5842eca51fea0870919p-212L },
- { -0x3.1p+4L, -0xa.d21786ff5842eca51fea0870919p-212L },
- { -0x3.2p+4L, 0x3.766dedc259af040be140a68a6c04p-216L },
+ { L(-0x2.74ff92c01f0d82abec9f315f1a08p+0), L(0xe.d3ccb7fb2658634a2b9f6b2ba81p-116) },
+ { L(-0x2.bf6821437b20197995a4b4641eaep+0), L(-0xb.f4b00b4829f961e428533e6ad048p-116) },
+ { L(-0x3.24c1b793cb35efb8be699ad3d9bap+0), L(-0x6.5454cb7fac60e3f16d9d7840c2ep-116) },
+ { L(-0x3.f48e2a8f85fca170d4561291236cp+0), L(-0xc.320a4887d1cb4c711828a75d5758p-116) },
+ { L(-0x4.0a139e16656030c39f0b0de18114p+0), L(0x1.53e84029416e1242006b2b3d1cfp-112) },
+ { L(-0x4.fdd5de9bbabf3510d0aa40769884p+0), L(-0x1.01d7d78125286f78d1e501f14966p-112) },
+ { L(-0x5.021a95fc2db6432a4c56e595394cp+0), L(-0x1.ecc6af0430d4fe5746fa7233356fp-112) },
+ { L(-0x5.ffa4bd647d0357dd4ed62cbd31ecp+0), L(-0x1.f8e3f8e5deba2d67dbd70dd96ce1p-112) },
+ { L(-0x6.005ac9625f233b607c2d96d16384p+0), L(-0x1.cb86ac569340cf1e5f24df7aab7bp-112) },
+ { L(-0x6.fff2fddae1bbff3d626b65c23fd4p+0), L(0x1.e0bfcff5c457ebcf4d3ad9674167p-112) },
+ { L(-0x7.000cff7b7f87adf4482dcdb98784p+0), L(0x1.54d99e35a74d6407b80292df199fp-112) },
+ { L(-0x7.fffe5fe05673c3ca9e82b522b0ccp+0), L(0x1.62d177c832e0eb42c2faffd1b145p-112) },
+ { L(-0x8.0001a01459fc9f60cb3cec1cec88p+0), L(0x2.8998835ac7277f7bcef67c47f188p-112) },
+ { L(-0x8.ffffd1c425e80ffc864e95749258p+0), L(-0x1.e7e20210e7f81cf781b44e9d2b02p-112) },
+ { L(-0x9.00002e3bb47d86d6d843fedc352p+0), L(0x2.14852f613a16291751d2ab751f7ep-112) },
+ { L(-0x9.fffffb606bdfdcd062ae77a50548p+0), L(0x3.962d1490cc2e8f031c7007eaa1ap-116) },
+ { L(-0xa.0000049f93bb9927b45d95e1544p+0), L(-0x1.e03086db9146a9287bd4f2172d5ap-112) },
+ { L(-0xa.ffffff9466e9f1b36dacd2adbd18p+0), L(-0xd.05a4e458062f3f95345a4d9c9b6p-116) },
+ { L(-0xb.0000006b9915315d965a6ffea41p+0), L(0x1.b415c6fff233e7b7fdc3a094246fp-112) },
+ { L(-0xb.fffffff7089387387de41acc3d4p+0), L(0x3.687427c6373bd74a10306e10a28ep-112) },
+ { L(-0xc.00000008f76c7731567c0f0250fp+0), L(-0x3.87920df5675833859190eb128ef6p-112) },
+ { L(-0xc.ffffffff4f6dcf617f97a5ffc758p+0), L(0x2.ab72d76f32eaee2d1a42ed515d3ap-116) },
+ { L(-0xd.00000000b092309c06683dd1b9p+0), L(-0x3.e3700857a15c19ac5a611de9688ap-112) },
+ { L(-0xd.fffffffff36345ab9e184a3e09dp+0), L(-0x1.176dc48e47f62d917973dd44e553p-112) },
+ { L(-0xe.000000000c9cba545e94e75ec57p+0), L(-0x1.8f753e2501e757a17cf2ecbeeb89p-112) },
+ { L(-0xe.ffffffffff28c060c6604ef3037p+0), L(-0x1.f89d37357c9e3dc17c6c6e63becap-112) },
+ { L(-0xf.0000000000d73f9f399bd0e420f8p+0), L(-0x5.e9ee31b0b890744fc0e3fbc01048p-116) },
+ { L(-0xf.fffffffffff28c060c6621f512e8p+0), L(0xd.1b2eec9d960bd9adc5be5f5fa5p-116) },
+ { L(-0x1.000000000000d73f9f399da1424cp+4), L(0x6.c46e0e88305d2800f0e414c506a8p-116) },
+ { L(-0x1.0ffffffffffff3569c47e7a93e1cp+4), L(-0x4.6a08a2e008a998ebabb8087efa2cp-112) },
+ { L(-0x1.1000000000000ca963b818568887p+4), L(-0x6.ca5a3a64ec15db0a95caf2c9ffb4p-112) },
+ { L(-0x1.1fffffffffffff4bec3ce234132dp+4), L(-0x8.b2b726187c841cb92cd5221e444p-116) },
+ { L(-0x1.20000000000000b413c31dcbeca5p+4), L(0x3.c4d005344b6cd0e7231120294abcp-112) },
+ { L(-0x1.2ffffffffffffff685b25cbf5f54p+4), L(-0x5.ced932e38485f7dd296b8fa41448p-112) },
+ { L(-0x1.30000000000000097a4da340a0acp+4), L(0x7.e484e0e0ffe38d406ebebe112f88p-112) },
+ { L(-0x1.3fffffffffffffff86af516ff7f7p+4), L(-0x6.bd67e720d57854502b7db75e1718p-112) },
+ { L(-0x1.40000000000000007950ae900809p+4), L(0x6.bec33375cac025d9c073168c5d9p-112) },
+ { L(-0x1.4ffffffffffffffffa391c4248c3p+4), L(0x5.c63022b62b5484ba346524db607p-112) },
+ { L(-0x1.500000000000000005c6e3bdb73dp+4), L(-0x5.c62f55ed5322b2685c5e9a51e6a8p-112) },
+ { L(-0x1.5fffffffffffffffffbcc71a492p+4), L(-0x1.eb5aeb96c74d7ad25e060528fb5p-112) },
+ { L(-0x1.6000000000000000004338e5b6ep+4), L(0x1.eb5aec04b2f2eb663e4e3d8a018cp-112) },
+ { L(-0x1.6ffffffffffffffffffd13c97d9dp+4), L(-0x3.8fcc4d08d6fe5aa56ab04307ce7ep-112) },
+ { L(-0x1.70000000000000000002ec368263p+4), L(0x3.8fcc4d090cee2f5d0b69a99c353cp-112) },
+ { L(-0x1.7fffffffffffffffffffe0d30fe7p+4), L(0x7.2f577cca4b4c8cb1dc14001ac5ecp-112) },
+ { L(-0x1.800000000000000000001f2cf019p+4), L(-0x7.2f577cca4b3442e35f0040b3b9e8p-112) },
+ { L(-0x1.8ffffffffffffffffffffec0c332p+4), L(-0x2.e9a0572b1bb5b95f346a92d67a6p-112) },
+ { L(-0x1.90000000000000000000013f3ccep+4), L(0x2.e9a0572b1bb5c371ddb3561705ap-112) },
+ { L(-0x1.9ffffffffffffffffffffff3b8bdp+4), L(-0x1.cad8d32e386fd783e97296d63dcbp-116) },
+ { L(-0x1.a0000000000000000000000c4743p+4), L(0x1.cad8d32e386fd7c1ab8c1fe34c0ep-116) },
+ { L(-0x1.afffffffffffffffffffffff8b95p+4), L(-0x3.8f48cc5737d5979c39db806c5406p-112) },
+ { L(-0x1.b00000000000000000000000746bp+4), L(0x3.8f48cc5737d5979c3b3a6bda06f6p-112) },
+ { L(-0x1.bffffffffffffffffffffffffbd8p+4), L(0x6.2898d42174dcf171470d8c8c6028p-112) },
+ { L(-0x1.c000000000000000000000000428p+4), L(-0x6.2898d42174dcf171470d18ba412cp-112) },
+ { L(-0x1.cfffffffffffffffffffffffffdbp+4), L(-0x4.c0ce9794ea50a839e311320bde94p-112) },
+ { L(-0x1.d000000000000000000000000025p+4), L(0x4.c0ce9794ea50a839e311322f7cf8p-112) },
+ { L(-0x1.dfffffffffffffffffffffffffffp+4), L(0x3.932c5047d60e60caded4c298a174p-112) },
+ { L(-0x1.e000000000000000000000000001p+4), L(-0x3.932c5047d60e60caded4c298973ap-112) },
+ { L(-0x1.fp+4), L(0xa.1a6973c1fade2170f7237d35fe3p-116) },
+ { L(-0x1.fp+4), L(-0xa.1a6973c1fade2170f7237d35fe08p-116) },
+ { L(-0x2p+4), L(0x5.0d34b9e0fd6f10b87b91be9aff1p-120) },
+ { L(-0x2p+4), L(-0x5.0d34b9e0fd6f10b87b91be9aff0cp-120) },
+ { L(-0x2.1p+4), L(0x2.73024a9ba1aa36a7059bff52e844p-124) },
+ { L(-0x2.1p+4), L(-0x2.73024a9ba1aa36a7059bff52e844p-124) },
+ { L(-0x2.2p+4), L(0x1.2710231c0fd7a13f8a2b4af9d6b7p-128) },
+ { L(-0x2.2p+4), L(-0x1.2710231c0fd7a13f8a2b4af9d6b7p-128) },
+ { L(-0x2.3p+4), L(0x8.6e2ce38b6c8f9419e3fad3f0312p-136) },
+ { L(-0x2.3p+4), L(-0x8.6e2ce38b6c8f9419e3fad3f0312p-136) },
+ { L(-0x2.4p+4), L(0x3.bf30652185952560d71a254e4eb8p-140) },
+ { L(-0x2.4p+4), L(-0x3.bf30652185952560d71a254e4eb8p-140) },
+ { L(-0x2.5p+4), L(0x1.9ec8d1c94e85af4c78b15c3d89d3p-144) },
+ { L(-0x2.5p+4), L(-0x1.9ec8d1c94e85af4c78b15c3d89d3p-144) },
+ { L(-0x2.6p+4), L(0xa.ea565ce061d57489e9b85276274p-152) },
+ { L(-0x2.6p+4), L(-0xa.ea565ce061d57489e9b85276274p-152) },
+ { L(-0x2.7p+4), L(0x4.7a6512692eb37804111dabad30ecp-156) },
+ { L(-0x2.7p+4), L(-0x4.7a6512692eb37804111dabad30ecp-156) },
+ { L(-0x2.8p+4), L(0x1.ca8ed42a12ae3001a07244abad2bp-160) },
+ { L(-0x2.8p+4), L(-0x1.ca8ed42a12ae3001a07244abad2bp-160) },
+ { L(-0x2.9p+4), L(0xb.2f30e1ce812063f12e7e8d8d96e8p-168) },
+ { L(-0x2.9p+4), L(-0xb.2f30e1ce812063f12e7e8d8d96e8p-168) },
+ { L(-0x2.ap+4), L(0x4.42bd49d4c37a0db136489772e428p-172) },
+ { L(-0x2.ap+4), L(-0x4.42bd49d4c37a0db136489772e428p-172) },
+ { L(-0x2.bp+4), L(0x1.95db45257e5122dcbae56def372p-176) },
+ { L(-0x2.bp+4), L(-0x1.95db45257e5122dcbae56def372p-176) },
+ { L(-0x2.cp+4), L(0x9.3958d81ff63527ecf993f3fb6f48p-184) },
+ { L(-0x2.cp+4), L(-0x9.3958d81ff63527ecf993f3fb6f48p-184) },
+ { L(-0x2.dp+4), L(0x3.47970e4440c8f1c058bd238c9958p-188) },
+ { L(-0x2.dp+4), L(-0x3.47970e4440c8f1c058bd238c9958p-188) },
+ { L(-0x2.ep+4), L(0x1.240804f65951062ca46e4f25c608p-192) },
+ { L(-0x2.ep+4), L(-0x1.240804f65951062ca46e4f25c608p-192) },
+ { L(-0x2.fp+4), L(0x6.36a382849fae6de2d15362d8a394p-200) },
+ { L(-0x2.fp+4), L(-0x6.36a382849fae6de2d15362d8a394p-200) },
+ { L(-0x3p+4), L(0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204) },
+ { L(-0x3p+4), L(-0x2.123680d6dfe4cf4b9b1bcb9d8bdcp-204) },
+ { L(-0x3.1p+4), L(0xa.d21786ff5842eca51fea0870919p-212) },
+ { L(-0x3.1p+4), L(-0xa.d21786ff5842eca51fea0870919p-212) },
+ { L(-0x3.2p+4), L(0x3.766dedc259af040be140a68a6c04p-216) },
};
-static const long double e_hi = 0x2.b7e151628aed2a6abf7158809cf4p+0L;
-static const long double e_lo = 0xf.3c762e7160f38b4da56a784d9048p-116L;
+static const _Float128 e_hi = L(0x2.b7e151628aed2a6abf7158809cf4p+0);
+static const _Float128 e_lo = L(0xf.3c762e7160f38b4da56a784d9048p-116);
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) in Stirling's
approximation to lgamma function. */
-static const long double lgamma_coeff[] =
+static const _Float128 lgamma_coeff[] =
{
- 0x1.5555555555555555555555555555p-4L,
- -0xb.60b60b60b60b60b60b60b60b60b8p-12L,
- 0x3.4034034034034034034034034034p-12L,
- -0x2.7027027027027027027027027028p-12L,
- 0x3.72a3c5631fe46ae1d4e700dca8f2p-12L,
- -0x7.daac36664f1f207daac36664f1f4p-12L,
- 0x1.a41a41a41a41a41a41a41a41a41ap-8L,
- -0x7.90a1b2c3d4e5f708192a3b4c5d7p-8L,
- 0x2.dfd2c703c0cfff430edfd2c703cp-4L,
- -0x1.6476701181f39edbdb9ce625987dp+0L,
- 0xd.672219167002d3a7a9c886459cp+0L,
- -0x9.cd9292e6660d55b3f712eb9e07c8p+4L,
- 0x8.911a740da740da740da740da741p+8L,
- -0x8.d0cc570e255bf59ff6eec24b49p+12L,
- 0xa.8d1044d3708d1c219ee4fdc446ap+16L,
- -0xe.8844d8a169abbc406169abbc406p+20L,
- 0x1.6d29a0f6433b79890cede62433b8p+28L,
- -0x2.88a233b3c8cddaba9809357125d8p+32L,
- 0x5.0dde6f27500939a85c40939a85c4p+36L,
- -0xb.4005bde03d4642a243581714af68p+40L,
- 0x1.bc8cd6f8f1f755c78753cdb5d5c9p+48L,
- -0x4.bbebb143bb94de5a0284fa7ec424p+52L,
- 0xe.2e1337f5af0bed90b6b0a352d4fp+56L,
- -0x2.e78250162b62405ad3e4bfe61b38p+64L,
- 0xa.5f7eef9e71ac7c80326ab4cc8bfp+68L,
- -0x2.83be0395e550213369924971b21ap+76L,
- 0xa.8ebfe48da17dd999790760b0cep+80L,
+ L(0x1.5555555555555555555555555555p-4),
+ L(-0xb.60b60b60b60b60b60b60b60b60b8p-12),
+ L(0x3.4034034034034034034034034034p-12),
+ L(-0x2.7027027027027027027027027028p-12),
+ L(0x3.72a3c5631fe46ae1d4e700dca8f2p-12),
+ L(-0x7.daac36664f1f207daac36664f1f4p-12),
+ L(0x1.a41a41a41a41a41a41a41a41a41ap-8),
+ L(-0x7.90a1b2c3d4e5f708192a3b4c5d7p-8),
+ L(0x2.dfd2c703c0cfff430edfd2c703cp-4),
+ L(-0x1.6476701181f39edbdb9ce625987dp+0),
+ L(0xd.672219167002d3a7a9c886459cp+0),
+ L(-0x9.cd9292e6660d55b3f712eb9e07c8p+4),
+ L(0x8.911a740da740da740da740da741p+8),
+ L(-0x8.d0cc570e255bf59ff6eec24b49p+12),
+ L(0xa.8d1044d3708d1c219ee4fdc446ap+16),
+ L(-0xe.8844d8a169abbc406169abbc406p+20),
+ L(0x1.6d29a0f6433b79890cede62433b8p+28),
+ L(-0x2.88a233b3c8cddaba9809357125d8p+32),
+ L(0x5.0dde6f27500939a85c40939a85c4p+36),
+ L(-0xb.4005bde03d4642a243581714af68p+40),
+ L(0x1.bc8cd6f8f1f755c78753cdb5d5c9p+48),
+ L(-0x4.bbebb143bb94de5a0284fa7ec424p+52),
+ L(0xe.2e1337f5af0bed90b6b0a352d4fp+56),
+ L(-0x2.e78250162b62405ad3e4bfe61b38p+64),
+ L(0xa.5f7eef9e71ac7c80326ab4cc8bfp+68),
+ L(-0x2.83be0395e550213369924971b21ap+76),
+ L(0xa.8ebfe48da17dd999790760b0cep+80),
};
#define NCOEFF (sizeof (lgamma_coeff) / sizeof (lgamma_coeff[0]))
@@ -166,224 +166,224 @@ static const long double lgamma_coeff[] =
polynomial is expressed in terms of x-xm, where xm is the midpoint
of the interval for which the polynomial applies. */
-static const long double poly_coeff[] =
+static const _Float128 poly_coeff[] =
{
/* Interval [-2.125, -2] (polynomial degree 23). */
- -0x1.0b71c5c54d42eb6c17f30b7aa8f5p+0L,
- -0xc.73a1dc05f34951602554c6d7506p-4L,
- -0x1.ec841408528b51473e6c425ee5ffp-4L,
- -0xe.37c9da26fc3c9a3c1844c8c7f1cp-4L,
- -0x1.03cd87c519305703b021fa33f827p-4L,
- -0xe.ae9ada65e09aa7f1c75216128f58p-4L,
- 0x9.b11855a4864b5731cf85736015a8p-8L,
- -0xe.f28c133e697a95c28607c9701dep-4L,
- 0x2.6ec14a1c586a72a7cc33ee569d6ap-4L,
- -0xf.57cab973e14464a262fc24723c38p-4L,
- 0x4.5b0fc25f16e52997b2886bbae808p-4L,
- -0xf.f50e59f1a9b56e76e988dac9ccf8p-4L,
- 0x6.5f5eae15e9a93369e1d85146c6fcp-4L,
- -0x1.0d2422daac459e33e0994325ed23p+0L,
- 0x8.82000a0e7401fb1117a0e6606928p-4L,
- -0x1.1f492f178a3f1b19f58a2ca68e55p+0L,
- 0xa.cb545f949899a04c160b19389abp-4L,
- -0x1.36165a1b155ba3db3d1b77caf498p+0L,
- 0xd.44c5d5576f74302e5cf79e183eep-4L,
- -0x1.51f22e0cdd33d3d481e326c02f3ep+0L,
- 0xf.f73a349c08244ac389c007779bfp-4L,
- -0x1.73317bf626156ba716747c4ca866p+0L,
- 0x1.379c3c97b9bc71e1c1c4802dd657p+0L,
- -0x1.a72a351c54f902d483052000f5dfp+0L,
+ L(-0x1.0b71c5c54d42eb6c17f30b7aa8f5p+0),
+ L(-0xc.73a1dc05f34951602554c6d7506p-4),
+ L(-0x1.ec841408528b51473e6c425ee5ffp-4),
+ L(-0xe.37c9da26fc3c9a3c1844c8c7f1cp-4),
+ L(-0x1.03cd87c519305703b021fa33f827p-4),
+ L(-0xe.ae9ada65e09aa7f1c75216128f58p-4),
+ L(0x9.b11855a4864b5731cf85736015a8p-8),
+ L(-0xe.f28c133e697a95c28607c9701dep-4),
+ L(0x2.6ec14a1c586a72a7cc33ee569d6ap-4),
+ L(-0xf.57cab973e14464a262fc24723c38p-4),
+ L(0x4.5b0fc25f16e52997b2886bbae808p-4),
+ L(-0xf.f50e59f1a9b56e76e988dac9ccf8p-4),
+ L(0x6.5f5eae15e9a93369e1d85146c6fcp-4),
+ L(-0x1.0d2422daac459e33e0994325ed23p+0),
+ L(0x8.82000a0e7401fb1117a0e6606928p-4),
+ L(-0x1.1f492f178a3f1b19f58a2ca68e55p+0),
+ L(0xa.cb545f949899a04c160b19389abp-4),
+ L(-0x1.36165a1b155ba3db3d1b77caf498p+0),
+ L(0xd.44c5d5576f74302e5cf79e183eep-4),
+ L(-0x1.51f22e0cdd33d3d481e326c02f3ep+0),
+ L(0xf.f73a349c08244ac389c007779bfp-4),
+ L(-0x1.73317bf626156ba716747c4ca866p+0),
+ L(0x1.379c3c97b9bc71e1c1c4802dd657p+0),
+ L(-0x1.a72a351c54f902d483052000f5dfp+0),
/* Interval [-2.25, -2.125] (polynomial degree 24). */
- -0xf.2930890d7d675a80c36afb0fd5e8p-4L,
- -0xc.a5cfde054eab5c6770daeca577f8p-4L,
- 0x3.9c9e0fdebb07cdf89c61d41c9238p-4L,
- -0x1.02a5ad35605fcf4af65a6dbacb84p+0L,
- 0x9.6e9b1185bb48be9de1918e00a2e8p-4L,
- -0x1.4d8332f3cfbfa116fd611e9ce90dp+0L,
- 0x1.1c0c8cb4d9f4b1d490e1a41fae4dp+0L,
- -0x1.c9a6f5ae9130cd0299e293a42714p+0L,
- 0x1.d7e9307fd58a2ea997f29573a112p+0L,
- -0x2.921cb3473d96178ca2a11d2a8d46p+0L,
- 0x2.e8d59113b6f3409ff8db226e9988p+0L,
- -0x3.cbab931625a1ae2b26756817f264p+0L,
- 0x4.7d9f0f05d5296d18663ca003912p+0L,
- -0x5.ade9cba12a14ea485667b7135bbp+0L,
- 0x6.dc983a5da74fb48e767b7fec0a3p+0L,
- -0x8.8d9ed454ae31d9e138dd8ee0d1a8p+0L,
- 0xa.6fa099d4e7c202e0c0fd6ed8492p+0L,
- -0xc.ebc552a8090a0f0115e92d4ebbc8p+0L,
- 0xf.d695e4772c0d829b53fba9ca5568p+0L,
- -0x1.38c32ae38e5e9eb79b2a4c5570a9p+4L,
- 0x1.8035145646cfab49306d0999a51bp+4L,
- -0x1.d930adbb03dd342a4c2a8c4e1af6p+4L,
- 0x2.45c2edb1b4943ddb3686cd9c6524p+4L,
- -0x2.e818ebbfafe2f916fa21abf7756p+4L,
- 0x3.9804ce51d0fb9a430a711fd7307p+4L,
+ L(-0xf.2930890d7d675a80c36afb0fd5e8p-4),
+ L(-0xc.a5cfde054eab5c6770daeca577f8p-4),
+ L(0x3.9c9e0fdebb07cdf89c61d41c9238p-4),
+ L(-0x1.02a5ad35605fcf4af65a6dbacb84p+0),
+ L(0x9.6e9b1185bb48be9de1918e00a2e8p-4),
+ L(-0x1.4d8332f3cfbfa116fd611e9ce90dp+0),
+ L(0x1.1c0c8cb4d9f4b1d490e1a41fae4dp+0),
+ L(-0x1.c9a6f5ae9130cd0299e293a42714p+0),
+ L(0x1.d7e9307fd58a2ea997f29573a112p+0),
+ L(-0x2.921cb3473d96178ca2a11d2a8d46p+0),
+ L(0x2.e8d59113b6f3409ff8db226e9988p+0),
+ L(-0x3.cbab931625a1ae2b26756817f264p+0),
+ L(0x4.7d9f0f05d5296d18663ca003912p+0),
+ L(-0x5.ade9cba12a14ea485667b7135bbp+0),
+ L(0x6.dc983a5da74fb48e767b7fec0a3p+0),
+ L(-0x8.8d9ed454ae31d9e138dd8ee0d1a8p+0),
+ L(0xa.6fa099d4e7c202e0c0fd6ed8492p+0),
+ L(-0xc.ebc552a8090a0f0115e92d4ebbc8p+0),
+ L(0xf.d695e4772c0d829b53fba9ca5568p+0),
+ L(-0x1.38c32ae38e5e9eb79b2a4c5570a9p+4),
+ L(0x1.8035145646cfab49306d0999a51bp+4),
+ L(-0x1.d930adbb03dd342a4c2a8c4e1af6p+4),
+ L(0x2.45c2edb1b4943ddb3686cd9c6524p+4),
+ L(-0x2.e818ebbfafe2f916fa21abf7756p+4),
+ L(0x3.9804ce51d0fb9a430a711fd7307p+4),
/* Interval [-2.375, -2.25] (polynomial degree 25). */
- -0xd.7d28d505d6181218a25f31d5e45p-4L,
- -0xe.69649a3040985140cdf946829fap-4L,
- 0xb.0d74a2827d053a8d44595012484p-4L,
- -0x1.924b0922853617cac181afbc08ddp+0L,
- 0x1.d49b12bccf0a568582e2d3c410f3p+0L,
- -0x3.0898bb7d8c4093e636279c791244p+0L,
- 0x4.207a6cac711cb53868e8a5057eep+0L,
- -0x6.39ee63ea4fb1dcab0c9144bf3ddcp+0L,
- 0x8.e2e2556a797b649bf3f53bd26718p+0L,
- -0xd.0e83ac82552ef12af508589e7a8p+0L,
- 0x1.2e4525e0ce6670563c6484a82b05p+4L,
- -0x1.b8e350d6a8f2b222fa390a57c23dp+4L,
- 0x2.805cd69b919087d8a80295892c2cp+4L,
- -0x3.a42585424a1b7e64c71743ab014p+4L,
- 0x5.4b4f409f98de49f7bfb03c05f984p+4L,
- -0x7.b3c5827fbe934bc820d6832fb9fcp+4L,
- 0xb.33b7b90cc96c425526e0d0866e7p+4L,
- -0x1.04b77047ac4f59ee3775ca10df0dp+8L,
- 0x1.7b366f5e94a34f41386eac086313p+8L,
- -0x2.2797338429385c9849ca6355bfc2p+8L,
- 0x3.225273cf92a27c9aac1b35511256p+8L,
- -0x4.8f078aa48afe6cb3a4e89690f898p+8L,
- 0x6.9f311d7b6654fc1d0b5195141d04p+8L,
- -0x9.a0c297b6b4621619ca9bacc48ed8p+8L,
- 0xe.ce1f06b6f90d92138232a76e4cap+8L,
- -0x1.5b0e6806fa064daf011613e43b17p+12L,
+ L(-0xd.7d28d505d6181218a25f31d5e45p-4),
+ L(-0xe.69649a3040985140cdf946829fap-4),
+ L(0xb.0d74a2827d053a8d44595012484p-4),
+ L(-0x1.924b0922853617cac181afbc08ddp+0),
+ L(0x1.d49b12bccf0a568582e2d3c410f3p+0),
+ L(-0x3.0898bb7d8c4093e636279c791244p+0),
+ L(0x4.207a6cac711cb53868e8a5057eep+0),
+ L(-0x6.39ee63ea4fb1dcab0c9144bf3ddcp+0),
+ L(0x8.e2e2556a797b649bf3f53bd26718p+0),
+ L(-0xd.0e83ac82552ef12af508589e7a8p+0),
+ L(0x1.2e4525e0ce6670563c6484a82b05p+4),
+ L(-0x1.b8e350d6a8f2b222fa390a57c23dp+4),
+ L(0x2.805cd69b919087d8a80295892c2cp+4),
+ L(-0x3.a42585424a1b7e64c71743ab014p+4),
+ L(0x5.4b4f409f98de49f7bfb03c05f984p+4),
+ L(-0x7.b3c5827fbe934bc820d6832fb9fcp+4),
+ L(0xb.33b7b90cc96c425526e0d0866e7p+4),
+ L(-0x1.04b77047ac4f59ee3775ca10df0dp+8),
+ L(0x1.7b366f5e94a34f41386eac086313p+8),
+ L(-0x2.2797338429385c9849ca6355bfc2p+8),
+ L(0x3.225273cf92a27c9aac1b35511256p+8),
+ L(-0x4.8f078aa48afe6cb3a4e89690f898p+8),
+ L(0x6.9f311d7b6654fc1d0b5195141d04p+8),
+ L(-0x9.a0c297b6b4621619ca9bacc48ed8p+8),
+ L(0xe.ce1f06b6f90d92138232a76e4cap+8),
+ L(-0x1.5b0e6806fa064daf011613e43b17p+12),
/* Interval [-2.5, -2.375] (polynomial degree 27). */
- -0xb.74ea1bcfff94b2c01afba9daa7d8p-4L,
- -0x1.2a82bd590c37538cab143308de4dp+0L,
- 0x1.88020f828b966fec66b8649fd6fcp+0L,
- -0x3.32279f040eb694970e9db24863dcp+0L,
- 0x5.57ac82517767e68a721005853864p+0L,
- -0x9.c2aedcfe22833de43834a0a6cc4p+0L,
- 0x1.12c132f1f5577f99e1a0ed3538e1p+4L,
- -0x1.ea94e26628a3de3597f7bb55a948p+4L,
- 0x3.66b4ac4fa582f58b59f96b2f7c7p+4L,
- -0x6.0cf746a9cf4cba8c39afcc73fc84p+4L,
- 0xa.c102ef2c20d75a342197df7fedf8p+4L,
- -0x1.31ebff06e8f14626782df58db3b6p+8L,
- 0x2.1fd6f0c0e710994e059b9dbdb1fep+8L,
- -0x3.c6d76040407f447f8b5074f07706p+8L,
- 0x6.b6d18e0d8feb4c2ef5af6a40ed18p+8L,
- -0xb.efaf542c529f91e34217f24ae6a8p+8L,
- 0x1.53852d873210e7070f5d9eb2296p+12L,
- -0x2.5b977c0ddc6d540717173ac29fc8p+12L,
- 0x4.310d452ae05100eff1e02343a724p+12L,
- -0x7.73a5d8f20c4f986a7dd1912b2968p+12L,
- 0xd.3f5ea2484f3fca15eab1f4d1a218p+12L,
- -0x1.78d18aac156d1d93a2ffe7e08d3fp+16L,
- 0x2.9df49ca75e5b567f5ea3e47106cp+16L,
- -0x4.a7149af8961a08aa7c3233b5bb94p+16L,
- 0x8.3db10ffa742c707c25197d989798p+16L,
- -0xe.a26d6dd023cadd02041a049ec368p+16L,
- 0x1.c825d90514e7c57c7fa5316f947cp+20L,
- -0x3.34bb81e5a0952df8ca1abdc6684cp+20L,
+ L(-0xb.74ea1bcfff94b2c01afba9daa7d8p-4),
+ L(-0x1.2a82bd590c37538cab143308de4dp+0),
+ L(0x1.88020f828b966fec66b8649fd6fcp+0),
+ L(-0x3.32279f040eb694970e9db24863dcp+0),
+ L(0x5.57ac82517767e68a721005853864p+0),
+ L(-0x9.c2aedcfe22833de43834a0a6cc4p+0),
+ L(0x1.12c132f1f5577f99e1a0ed3538e1p+4),
+ L(-0x1.ea94e26628a3de3597f7bb55a948p+4),
+ L(0x3.66b4ac4fa582f58b59f96b2f7c7p+4),
+ L(-0x6.0cf746a9cf4cba8c39afcc73fc84p+4),
+ L(0xa.c102ef2c20d75a342197df7fedf8p+4),
+ L(-0x1.31ebff06e8f14626782df58db3b6p+8),
+ L(0x2.1fd6f0c0e710994e059b9dbdb1fep+8),
+ L(-0x3.c6d76040407f447f8b5074f07706p+8),
+ L(0x6.b6d18e0d8feb4c2ef5af6a40ed18p+8),
+ L(-0xb.efaf542c529f91e34217f24ae6a8p+8),
+ L(0x1.53852d873210e7070f5d9eb2296p+12),
+ L(-0x2.5b977c0ddc6d540717173ac29fc8p+12),
+ L(0x4.310d452ae05100eff1e02343a724p+12),
+ L(-0x7.73a5d8f20c4f986a7dd1912b2968p+12),
+ L(0xd.3f5ea2484f3fca15eab1f4d1a218p+12),
+ L(-0x1.78d18aac156d1d93a2ffe7e08d3fp+16),
+ L(0x2.9df49ca75e5b567f5ea3e47106cp+16),
+ L(-0x4.a7149af8961a08aa7c3233b5bb94p+16),
+ L(0x8.3db10ffa742c707c25197d989798p+16),
+ L(-0xe.a26d6dd023cadd02041a049ec368p+16),
+ L(0x1.c825d90514e7c57c7fa5316f947cp+20),
+ L(-0x3.34bb81e5a0952df8ca1abdc6684cp+20),
/* Interval [-2.625, -2.5] (polynomial degree 28). */
- -0x3.d10108c27ebafad533c20eac32bp-4L,
- 0x1.cd557caff7d2b2085f41dbec5106p+0L,
- 0x3.819b4856d399520dad9776ea2cacp+0L,
- 0x6.8505cbad03dc34c5e42e8b12eb78p+0L,
- 0xb.c1b2e653a9e38f82b399c94e7f08p+0L,
- 0x1.50a53a38f148138105124df65419p+4L,
- 0x2.57ae00cbe5232cbeeed34d89727ap+4L,
- 0x4.2b156301b8604db85a601544bfp+4L,
- 0x7.6989ed23ca3ca7579b3462592b5cp+4L,
- 0xd.2dd2976557939517f831f5552cc8p+4L,
- 0x1.76e1c3430eb860969bce40cd494p+8L,
- 0x2.9a77bf5488742466db3a2c7c1ec6p+8L,
- 0x4.a0d62ed7266e8eb36f725a8ebcep+8L,
- 0x8.3a6184dd3021067df2f8b91e99c8p+8L,
- 0xe.a0ade1538245bf55d39d7e436b1p+8L,
- 0x1.a01359fae8617b5826dd74428e9p+12L,
- 0x2.e3b0a32caae77251169acaca1ad4p+12L,
- 0x5.2301257c81589f62b38fb5993ee8p+12L,
- 0x9.21c9275db253d4e719b73b18cb9p+12L,
- 0x1.03c104bc96141cda3f3fa4b112bcp+16L,
- 0x1.cdc8ed65119196a08b0c78f1445p+16L,
- 0x3.34f31d2eaacf34382cdb0073572ap+16L,
- 0x5.b37628cadf12bf0000907d0ef294p+16L,
- 0xa.22d8b332c0b1e6a616f425dfe5ap+16L,
- 0x1.205b01444804c3ff922cd78b4c42p+20L,
- 0x1.fe8f0cea9d1e0ff25be2470b4318p+20L,
- 0x3.8872aebeb368399aee02b39340aep+20L,
- 0x6.ebd560d351e84e26a4381f5b293cp+20L,
- 0xc.c3644d094b0dae2fbcbf682cd428p+20L,
+ L(-0x3.d10108c27ebafad533c20eac32bp-4),
+ L(0x1.cd557caff7d2b2085f41dbec5106p+0),
+ L(0x3.819b4856d399520dad9776ea2cacp+0),
+ L(0x6.8505cbad03dc34c5e42e8b12eb78p+0),
+ L(0xb.c1b2e653a9e38f82b399c94e7f08p+0),
+ L(0x1.50a53a38f148138105124df65419p+4),
+ L(0x2.57ae00cbe5232cbeeed34d89727ap+4),
+ L(0x4.2b156301b8604db85a601544bfp+4),
+ L(0x7.6989ed23ca3ca7579b3462592b5cp+4),
+ L(0xd.2dd2976557939517f831f5552cc8p+4),
+ L(0x1.76e1c3430eb860969bce40cd494p+8),
+ L(0x2.9a77bf5488742466db3a2c7c1ec6p+8),
+ L(0x4.a0d62ed7266e8eb36f725a8ebcep+8),
+ L(0x8.3a6184dd3021067df2f8b91e99c8p+8),
+ L(0xe.a0ade1538245bf55d39d7e436b1p+8),
+ L(0x1.a01359fae8617b5826dd74428e9p+12),
+ L(0x2.e3b0a32caae77251169acaca1ad4p+12),
+ L(0x5.2301257c81589f62b38fb5993ee8p+12),
+ L(0x9.21c9275db253d4e719b73b18cb9p+12),
+ L(0x1.03c104bc96141cda3f3fa4b112bcp+16),
+ L(0x1.cdc8ed65119196a08b0c78f1445p+16),
+ L(0x3.34f31d2eaacf34382cdb0073572ap+16),
+ L(0x5.b37628cadf12bf0000907d0ef294p+16),
+ L(0xa.22d8b332c0b1e6a616f425dfe5ap+16),
+ L(0x1.205b01444804c3ff922cd78b4c42p+20),
+ L(0x1.fe8f0cea9d1e0ff25be2470b4318p+20),
+ L(0x3.8872aebeb368399aee02b39340aep+20),
+ L(0x6.ebd560d351e84e26a4381f5b293cp+20),
+ L(0xc.c3644d094b0dae2fbcbf682cd428p+20),
/* Interval [-2.75, -2.625] (polynomial degree 26). */
- -0x6.b5d252a56e8a75458a27ed1c2dd4p-4L,
- 0x1.28d60383da3ac721aed3c5794da9p+0L,
- 0x1.db6513ada8a66ea77d87d9a8827bp+0L,
- 0x2.e217118f9d348a27f7506a707e6ep+0L,
- 0x4.450112c5cbf725a0fb9802396c9p+0L,
- 0x6.4af99151eae7810a75df2a0303c4p+0L,
- 0x9.2db598b4a97a7f69aeef32aec758p+0L,
- 0xd.62bef9c22471f5ee47ea1b9c0b5p+0L,
- 0x1.379f294e412bd62328326d4222f9p+4L,
- 0x1.c5827349d8865f1e8825c37c31c6p+4L,
- 0x2.93a7e7a75b7568cc8cbe8c016c12p+4L,
- 0x3.bf9bb882afe57edb383d41879d3ap+4L,
- 0x5.73c737828cee095c43a5566731c8p+4L,
- 0x7.ee4653493a7f81e0442062b3823cp+4L,
- 0xb.891c6b83fc8b55bd973b5d962d6p+4L,
- 0x1.0c775d7de3bf9b246c0208e0207ep+8L,
- 0x1.867ee43ec4bd4f4fd56abc05110ap+8L,
- 0x2.37fe9ba6695821e9822d8c8af0a6p+8L,
- 0x3.3a2c667e37c942f182cd3223a936p+8L,
- 0x4.b1b500eb59f3f782c7ccec88754p+8L,
- 0x6.d3efd3b65b3d0d8488d30b79fa4cp+8L,
- 0x9.ee8224e65bed5ced8b75eaec609p+8L,
- 0xe.72416e510cca77d53fc615c1f3dp+8L,
- 0x1.4fb538b0a2dfe567a8904b7e0445p+12L,
- 0x1.e7f56a9266cf525a5b8cf4cb76cep+12L,
- 0x2.f0365c983f68c597ee49d099cce8p+12L,
- 0x4.53aa229e1b9f5b5e59625265951p+12L,
+ L(-0x6.b5d252a56e8a75458a27ed1c2dd4p-4),
+ L(0x1.28d60383da3ac721aed3c5794da9p+0),
+ L(0x1.db6513ada8a66ea77d87d9a8827bp+0),
+ L(0x2.e217118f9d348a27f7506a707e6ep+0),
+ L(0x4.450112c5cbf725a0fb9802396c9p+0),
+ L(0x6.4af99151eae7810a75df2a0303c4p+0),
+ L(0x9.2db598b4a97a7f69aeef32aec758p+0),
+ L(0xd.62bef9c22471f5ee47ea1b9c0b5p+0),
+ L(0x1.379f294e412bd62328326d4222f9p+4),
+ L(0x1.c5827349d8865f1e8825c37c31c6p+4),
+ L(0x2.93a7e7a75b7568cc8cbe8c016c12p+4),
+ L(0x3.bf9bb882afe57edb383d41879d3ap+4),
+ L(0x5.73c737828cee095c43a5566731c8p+4),
+ L(0x7.ee4653493a7f81e0442062b3823cp+4),
+ L(0xb.891c6b83fc8b55bd973b5d962d6p+4),
+ L(0x1.0c775d7de3bf9b246c0208e0207ep+8),
+ L(0x1.867ee43ec4bd4f4fd56abc05110ap+8),
+ L(0x2.37fe9ba6695821e9822d8c8af0a6p+8),
+ L(0x3.3a2c667e37c942f182cd3223a936p+8),
+ L(0x4.b1b500eb59f3f782c7ccec88754p+8),
+ L(0x6.d3efd3b65b3d0d8488d30b79fa4cp+8),
+ L(0x9.ee8224e65bed5ced8b75eaec609p+8),
+ L(0xe.72416e510cca77d53fc615c1f3dp+8),
+ L(0x1.4fb538b0a2dfe567a8904b7e0445p+12),
+ L(0x1.e7f56a9266cf525a5b8cf4cb76cep+12),
+ L(0x2.f0365c983f68c597ee49d099cce8p+12),
+ L(0x4.53aa229e1b9f5b5e59625265951p+12),
/* Interval [-2.875, -2.75] (polynomial degree 24). */
- -0x8.a41b1e4f36ff88dc820815607d68p-4L,
- 0xc.da87d3b69dc0f2f9c6f368b8ca1p-4L,
- 0x1.1474ad5c36158a7bea04fd2f98c6p+0L,
- 0x1.761ecb90c555df6555b7dba955b6p+0L,
- 0x1.d279bff9ae291caf6c4b4bcb3202p+0L,
- 0x2.4e5d00559a6e2b9b5d7fe1f6689cp+0L,
- 0x2.d57545a75cee8743ae2b17bc8d24p+0L,
- 0x3.8514eee3aac88b89bec2307021bap+0L,
- 0x4.5235e3b6e1891ffeb87fed9f8a24p+0L,
- 0x5.562acdb10eef3c9a773b3e27a864p+0L,
- 0x6.8ec8965c76efe03c26bff60b1194p+0L,
- 0x8.15251aca144877af32658399f9b8p+0L,
- 0x9.f08d56aba174d844138af782c0f8p+0L,
- 0xc.3dbbeda2679e8a1346ccc3f6da88p+0L,
- 0xf.0f5bfd5eacc26db308ffa0556fa8p+0L,
- 0x1.28a6ccd84476fbc713d6bab49ac9p+4L,
- 0x1.6d0a3ae2a3b1c8ff400641a3a21fp+4L,
- 0x1.c15701b28637f87acfb6a91d33b5p+4L,
- 0x2.28fbe0eccf472089b017651ca55ep+4L,
- 0x2.a8a453004f6e8ffaacd1603bc3dp+4L,
- 0x3.45ae4d9e1e7cd1a5dba0e4ec7f6cp+4L,
- 0x4.065fbfacb7fad3e473cb577a61e8p+4L,
- 0x4.f3d1473020927acac1944734a39p+4L,
- 0x6.54bb091245815a36fb74e314dd18p+4L,
- 0x7.d7f445129f7fb6c055e582d3f6ep+4L,
+ L(-0x8.a41b1e4f36ff88dc820815607d68p-4),
+ L(0xc.da87d3b69dc0f2f9c6f368b8ca1p-4),
+ L(0x1.1474ad5c36158a7bea04fd2f98c6p+0),
+ L(0x1.761ecb90c555df6555b7dba955b6p+0),
+ L(0x1.d279bff9ae291caf6c4b4bcb3202p+0),
+ L(0x2.4e5d00559a6e2b9b5d7fe1f6689cp+0),
+ L(0x2.d57545a75cee8743ae2b17bc8d24p+0),
+ L(0x3.8514eee3aac88b89bec2307021bap+0),
+ L(0x4.5235e3b6e1891ffeb87fed9f8a24p+0),
+ L(0x5.562acdb10eef3c9a773b3e27a864p+0),
+ L(0x6.8ec8965c76efe03c26bff60b1194p+0),
+ L(0x8.15251aca144877af32658399f9b8p+0),
+ L(0x9.f08d56aba174d844138af782c0f8p+0),
+ L(0xc.3dbbeda2679e8a1346ccc3f6da88p+0),
+ L(0xf.0f5bfd5eacc26db308ffa0556fa8p+0),
+ L(0x1.28a6ccd84476fbc713d6bab49ac9p+4),
+ L(0x1.6d0a3ae2a3b1c8ff400641a3a21fp+4),
+ L(0x1.c15701b28637f87acfb6a91d33b5p+4),
+ L(0x2.28fbe0eccf472089b017651ca55ep+4),
+ L(0x2.a8a453004f6e8ffaacd1603bc3dp+4),
+ L(0x3.45ae4d9e1e7cd1a5dba0e4ec7f6cp+4),
+ L(0x4.065fbfacb7fad3e473cb577a61e8p+4),
+ L(0x4.f3d1473020927acac1944734a39p+4),
+ L(0x6.54bb091245815a36fb74e314dd18p+4),
+ L(0x7.d7f445129f7fb6c055e582d3f6ep+4),
/* Interval [-3, -2.875] (polynomial degree 23). */
- -0xa.046d667e468f3e44dcae1afcc648p-4L,
- 0x9.70b88dcc006c214d8d996fdf5ccp-4L,
- 0xa.a8a39421c86d3ff24931a0929fp-4L,
- 0xd.2f4d1363f324da2b357c8b6ec94p-4L,
- 0xd.ca9aa1a3a5c00de11bf60499a97p-4L,
- 0xf.cf09c31eeb52a45dfa7ebe3778dp-4L,
- 0x1.04b133a39ed8a09691205660468bp+0L,
- 0x1.22b547a06edda944fcb12fd9b5ecp+0L,
- 0x1.2c57fce7db86a91df09602d344b3p+0L,
- 0x1.4aade4894708f84795212fe257eep+0L,
- 0x1.579c8b7b67ec4afed5b28c8bf787p+0L,
- 0x1.776820e7fc80ae5284239733078ap+0L,
- 0x1.883ab28c7301fde4ca6b8ec26ec8p+0L,
- 0x1.aa2ef6e1ae52eb42c9ee83b206e3p+0L,
- 0x1.bf4ad50f0a9a9311300cf0c51ee7p+0L,
- 0x1.e40206e0e96b1da463814dde0d09p+0L,
- 0x1.fdcbcffef3a21b29719c2bd9feb1p+0L,
- 0x2.25e2e8948939c4d42cf108fae4bep+0L,
- 0x2.44ce14d2b59c1c0e6bf2cfa81018p+0L,
- 0x2.70ee80bbd0387162be4861c43622p+0L,
- 0x2.954b64d2c2ebf3489b949c74476p+0L,
- 0x2.c616e133a811c1c9446105208656p+0L,
- 0x3.05a69dfe1a9ba1079f90fcf26bd4p+0L,
- 0x3.410d2ad16a0506de29736e6aafdap+0L,
+ L(-0xa.046d667e468f3e44dcae1afcc648p-4),
+ L(0x9.70b88dcc006c214d8d996fdf5ccp-4),
+ L(0xa.a8a39421c86d3ff24931a0929fp-4),
+ L(0xd.2f4d1363f324da2b357c8b6ec94p-4),
+ L(0xd.ca9aa1a3a5c00de11bf60499a97p-4),
+ L(0xf.cf09c31eeb52a45dfa7ebe3778dp-4),
+ L(0x1.04b133a39ed8a09691205660468bp+0),
+ L(0x1.22b547a06edda944fcb12fd9b5ecp+0),
+ L(0x1.2c57fce7db86a91df09602d344b3p+0),
+ L(0x1.4aade4894708f84795212fe257eep+0),
+ L(0x1.579c8b7b67ec4afed5b28c8bf787p+0),
+ L(0x1.776820e7fc80ae5284239733078ap+0),
+ L(0x1.883ab28c7301fde4ca6b8ec26ec8p+0),
+ L(0x1.aa2ef6e1ae52eb42c9ee83b206e3p+0),
+ L(0x1.bf4ad50f0a9a9311300cf0c51ee7p+0),
+ L(0x1.e40206e0e96b1da463814dde0d09p+0),
+ L(0x1.fdcbcffef3a21b29719c2bd9feb1p+0),
+ L(0x2.25e2e8948939c4d42cf108fae4bep+0),
+ L(0x2.44ce14d2b59c1c0e6bf2cfa81018p+0),
+ L(0x2.70ee80bbd0387162be4861c43622p+0),
+ L(0x2.954b64d2c2ebf3489b949c74476p+0),
+ L(0x2.c616e133a811c1c9446105208656p+0),
+ L(0x3.05a69dfe1a9ba1079f90fcf26bd4p+0),
+ L(0x3.410d2ad16a0506de29736e6aafdap+0),
};
static const size_t poly_deg[] =
@@ -412,30 +412,30 @@ static const size_t poly_end[] =
/* Compute sin (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_sinpi (long double x)
+static _Float128
+lg_sinpi (_Float128 x)
{
- if (x <= 0.25L)
+ if (x <= L(0.25))
return __sinl (M_PIl * x);
else
- return __cosl (M_PIl * (0.5L - x));
+ return __cosl (M_PIl * (L(0.5) - x));
}
/* Compute cos (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_cospi (long double x)
+static _Float128
+lg_cospi (_Float128 x)
{
- if (x <= 0.25L)
+ if (x <= L(0.25))
return __cosl (M_PIl * x);
else
- return __sinl (M_PIl * (0.5L - x));
+ return __sinl (M_PIl * (L(0.5) - x));
}
/* Compute cot (pi * X) for -0.25 <= X <= 0.5. */
-static long double
-lg_cotpi (long double x)
+static _Float128
+lg_cotpi (_Float128 x)
{
return lg_cospi (x) / lg_sinpi (x);
}
@@ -443,34 +443,34 @@ lg_cotpi (long double x)
/* Compute lgamma of a negative argument -50 < X < -2, setting
*SIGNGAMP accordingly. */
-long double
-__lgamma_negl (long double x, int *signgamp)
+_Float128
+__lgamma_negl (_Float128 x, int *signgamp)
{
/* Determine the half-integer region X lies in, handle exact
integers and determine the sign of the result. */
int i = __floorl (-2 * x);
if ((i & 1) == 0 && i == -2 * x)
- return 1.0L / 0.0L;
- long double xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
+ return L(1.0) / L(0.0);
+ _Float128 xn = ((i & 1) == 0 ? -i / 2 : (-i - 1) / 2);
i -= 4;
*signgamp = ((i & 2) == 0 ? -1 : 1);
SET_RESTORE_ROUNDL (FE_TONEAREST);
/* Expand around the zero X0 = X0_HI + X0_LO. */
- long double x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
- long double xdiff = x - x0_hi - x0_lo;
+ _Float128 x0_hi = lgamma_zeros[i][0], x0_lo = lgamma_zeros[i][1];
+ _Float128 xdiff = x - x0_hi - x0_lo;
/* For arguments in the range -3 to -2, use polynomial
approximations to an adjusted version of the gamma function. */
if (i < 2)
{
int j = __floorl (-8 * x) - 16;
- long double xm = (-33 - 2 * j) * 0.0625L;
- long double x_adj = x - xm;
+ _Float128 xm = (-33 - 2 * j) * L(0.0625);
+ _Float128 x_adj = x - xm;
size_t deg = poly_deg[j];
size_t end = poly_end[j];
- long double g = poly_coeff[end];
+ _Float128 g = poly_coeff[end];
for (size_t j = 1; j <= deg; j++)
g = g * x_adj + poly_coeff[end - j];
return __log1pl (g * xdiff / (x - xn));
@@ -478,9 +478,9 @@ __lgamma_negl (long double x, int *signgamp)
/* The result we want is log (sinpi (X0) / sinpi (X))
+ log (gamma (1 - X0) / gamma (1 - X)). */
- long double x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
- long double log_sinpi_ratio;
- if (x0_idiff < x_idiff * 0.5L)
+ _Float128 x_idiff = fabsl (xn - x), x0_idiff = fabsl (xn - x0_hi - x0_lo);
+ _Float128 log_sinpi_ratio;
+ if (x0_idiff < x_idiff * L(0.5))
/* Use log not log1p to avoid inaccuracy from log1p of arguments
close to -1. */
log_sinpi_ratio = __ieee754_logl (lg_sinpi (x0_idiff)
@@ -490,29 +490,29 @@ __lgamma_negl (long double x, int *signgamp)
/* Use log1p not log to avoid inaccuracy from log of arguments
close to 1. X0DIFF2 has positive sign if X0 is further from
XN than X is from XN, negative sign otherwise. */
- long double x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * 0.5L;
- long double sx0d2 = lg_sinpi (x0diff2);
- long double cx0d2 = lg_cospi (x0diff2);
+ _Float128 x0diff2 = ((i & 1) == 0 ? xdiff : -xdiff) * L(0.5);
+ _Float128 sx0d2 = lg_sinpi (x0diff2);
+ _Float128 cx0d2 = lg_cospi (x0diff2);
log_sinpi_ratio = __log1pl (2 * sx0d2
* (-sx0d2 + cx0d2 * lg_cotpi (x_idiff)));
}
- long double log_gamma_ratio;
- long double y0 = 1 - x0_hi;
- long double y0_eps = -x0_hi + (1 - y0) - x0_lo;
- long double y = 1 - x;
- long double y_eps = -x + (1 - y);
+ _Float128 log_gamma_ratio;
+ _Float128 y0 = 1 - x0_hi;
+ _Float128 y0_eps = -x0_hi + (1 - y0) - x0_lo;
+ _Float128 y = 1 - x;
+ _Float128 y_eps = -x + (1 - y);
/* We now wish to compute LOG_GAMMA_RATIO
= log (gamma (Y0 + Y0_EPS) / gamma (Y + Y_EPS)). XDIFF
accurately approximates the difference Y0 + Y0_EPS - Y -
Y_EPS. Use Stirling's approximation. First, we may need to
adjust into the range where Stirling's approximation is
sufficiently accurate. */
- long double log_gamma_adj = 0;
+ _Float128 log_gamma_adj = 0;
if (i < 20)
{
int n_up = (21 - i) / 2;
- long double ny0, ny0_eps, ny, ny_eps;
+ _Float128 ny0, ny0_eps, ny, ny_eps;
ny0 = y0 + n_up;
ny0_eps = y0 - (ny0 - n_up) + y0_eps;
y0 = ny0;
@@ -521,28 +521,28 @@ __lgamma_negl (long double x, int *signgamp)
ny_eps = y - (ny - n_up) + y_eps;
y = ny;
y_eps = ny_eps;
- long double prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
+ _Float128 prodm1 = __lgamma_productl (xdiff, y - n_up, y_eps, n_up);
log_gamma_adj = -__log1pl (prodm1);
}
- long double log_gamma_high
+ _Float128 log_gamma_high
= (xdiff * __log1pl ((y0 - e_hi - e_lo + y0_eps) / e_hi)
- + (y - 0.5L + y_eps) * __log1pl (xdiff / y) + log_gamma_adj);
+ + (y - L(0.5) + y_eps) * __log1pl (xdiff / y) + log_gamma_adj);
/* Compute the sum of (B_2k / 2k(2k-1))(Y0^-(2k-1) - Y^-(2k-1)). */
- long double y0r = 1 / y0, yr = 1 / y;
- long double y0r2 = y0r * y0r, yr2 = yr * yr;
- long double rdiff = -xdiff / (y * y0);
- long double bterm[NCOEFF];
- long double dlast = rdiff, elast = rdiff * yr * (yr + y0r);
+ _Float128 y0r = 1 / y0, yr = 1 / y;
+ _Float128 y0r2 = y0r * y0r, yr2 = yr * yr;
+ _Float128 rdiff = -xdiff / (y * y0);
+ _Float128 bterm[NCOEFF];
+ _Float128 dlast = rdiff, elast = rdiff * yr * (yr + y0r);
bterm[0] = dlast * lgamma_coeff[0];
for (size_t j = 1; j < NCOEFF; j++)
{
- long double dnext = dlast * y0r2 + elast;
- long double enext = elast * yr2;
+ _Float128 dnext = dlast * y0r2 + elast;
+ _Float128 enext = elast * yr2;
bterm[j] = dnext * lgamma_coeff[j];
dlast = dnext;
elast = enext;
}
- long double log_gamma_low = 0;
+ _Float128 log_gamma_low = 0;
for (size_t j = 0; j < NCOEFF; j++)
log_gamma_low += bterm[NCOEFF - 1 - j];
log_gamma_ratio = log_gamma_high + log_gamma_low;
diff --git a/sysdeps/ieee754/ldbl-128/lgamma_productl.c b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
index de67cbe665..fa69603aee 100644
--- a/sysdeps/ieee754/ldbl-128/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
@@ -56,24 +26,24 @@ mul_split (long double *hi, long double *lo, long double x, long double y)
X_EPS / X is small enough that factors quadratic in it can be
neglected. */
-long double
-__lgamma_productl (long double t, long double x, long double x_eps, int n)
+_Float128
+__lgamma_productl (_Float128 t, _Float128 x, _Float128 x_eps, int n)
{
- long double ret = 0, ret_eps = 0;
+ _Float128 ret = 0, ret_eps = 0;
for (int i = 0; i < n; i++)
{
- long double xi = x + i;
- long double quot = t / xi;
- long double mhi, mlo;
- mul_split (&mhi, &mlo, quot, xi);
- long double quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
+ _Float128 xi = x + i;
+ _Float128 quot = t / xi;
+ _Float128 mhi, mlo;
+ mul_splitl (&mhi, &mlo, quot, xi);
+ _Float128 quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
/* We want (1 + RET + RET_EPS) * (1 + QUOT + QUOT_LO) - 1. */
- long double rhi, rlo;
- mul_split (&rhi, &rlo, ret, quot);
- long double rpq = ret + quot;
- long double rpq_eps = (ret - rpq) + quot;
- long double nret = rpq + rhi;
- long double nret_eps = (rpq - nret) + rhi;
+ _Float128 rhi, rlo;
+ mul_splitl (&rhi, &rlo, ret, quot);
+ _Float128 rpq = ret + quot;
+ _Float128 rpq_eps = (ret - rpq) + quot;
+ _Float128 nret = rpq + rhi;
+ _Float128 nret_eps = (rpq - nret) + rhi;
ret_eps += (rpq_eps + nret_eps + rlo + ret_eps * quot
+ quot_lo + quot_lo * (ret + ret_eps));
ret = nret;
diff --git a/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h
index aed8953421..e2f092d3e1 100644
--- a/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h
+++ b/sysdeps/ieee754/ldbl-128/math-nan-payload-ldouble.h
@@ -1,5 +1,5 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* NaN payload handling for ldbl-128.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee854_long_double u; \
diff --git a/sysdeps/ieee754/ldbl-128/math_ldbl.h b/sysdeps/ieee754/ldbl-128/math_ldbl.h
index b3faa04846..db2bc5e0c3 100644
--- a/sysdeps/ieee754/ldbl-128/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128/math_ldbl.h
@@ -1,41 +1,61 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
+#include <endian.h>
/* A union which permits us to convert between a long double and
four 32 bit ints or two 64 bit ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
long double value;
struct
{
- u_int64_t msw;
- u_int64_t lsw;
+ uint64_t msw;
+ uint64_t lsw;
} parts64;
struct
{
- u_int32_t w0, w1, w2, w3;
+ uint32_t w0, w1, w2, w3;
} parts32;
} ieee854_long_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
long double value;
struct
{
- u_int64_t lsw;
- u_int64_t msw;
+ uint64_t lsw;
+ uint64_t msw;
} parts64;
struct
{
- u_int32_t w3, w2, w1, w0;
+ uint32_t w3, w2, w1, w0;
} parts32;
} ieee854_long_double_shape_type;
@@ -88,3 +108,13 @@ do { \
sh_u.value = (d); \
(v) = sh_u.parts64.lsw; \
} while (0)
+
+/*
+ On a platform already supporting a binary128 long double,
+ _Float128 will alias to long double. This transformation
+ makes aliasing *l functions to *f128 trivial.
+*/
+#define _Float128 long double
+#define L(x) x##L
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-128/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
index f9e4a39f59..9fb9f5c3ad 100644
--- a/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex.c b/sysdeps/ieee754/ldbl-128/printf_fphex.c
index 83f8f39ae8..ec86afb6b1 100644
--- a/sysdeps/ieee754/ldbl-128/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128/printf_fphex.c
@@ -1,6 +1,6 @@
/* Print floating point number in hexadecimal notation according to
ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,91 +17,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <ldbl-128/printf_fphex_macros.h>
#define PRINT_FPHEX_LONG_DOUBLE \
-do { \
- /* We have 112 bits of mantissa plus one implicit digit. Since \
- 112 bits are representable without rest using hexadecimal \
- digits we use only the implicit digits for the number before \
- the decimal point. */ \
- unsigned long long int num0, num1; \
- union ieee854_long_double u; \
- u.d = fpnum.ldbl; \
- \
- assert (sizeof (long double) == 16); \
- \
- num0 = (((unsigned long long int) u.ieee.mantissa0) << 32 \
- | u.ieee.mantissa1); \
- num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \
- | u.ieee.mantissa3); \
- \
- zero_mantissa = (num0|num1) == 0; \
- \
- if (sizeof (unsigned long int) > 6) \
- { \
- numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16, \
- info->spec == 'A'); \
- wnumstr = _itowa_word (num1, \
- wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
- 16, info->spec == 'A'); \
- } \
- else \
- { \
- numstr = _itoa (num1, numbuf + sizeof numbuf, 16, \
- info->spec == 'A'); \
- wnumstr = _itowa (num1, \
- wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t), \
- 16, info->spec == 'A'); \
- } \
- \
- while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \
- { \
- *--numstr = '0'; \
- *--wnumstr = L'0'; \
- } \
- \
- if (sizeof (unsigned long int) > 6) \
- { \
- numstr = _itoa_word (num0, numstr, 16, info->spec == 'A'); \
- wnumstr = _itowa_word (num0, wnumstr, 16, info->spec == 'A'); \
- } \
- else \
- { \
- numstr = _itoa (num0, numstr, 16, info->spec == 'A'); \
- wnumstr = _itowa (num0, wnumstr, 16, info->spec == 'A'); \
- } \
- \
- /* Fill with zeroes. */ \
- while (numstr > numbuf + (sizeof numbuf - 112 / 4)) \
- { \
- *--numstr = '0'; \
- *--wnumstr = L'0'; \
- } \
- \
- leading = u.ieee.exponent == 0 ? '0' : '1'; \
- \
- exponent = u.ieee.exponent; \
- \
- if (exponent == 0) \
- { \
- if (zero_mantissa) \
- expnegative = 0; \
- else \
- { \
- /* This is a denormalized number. */ \
- expnegative = 1; \
- exponent = IEEE854_LONG_DOUBLE_BIAS - 1; \
- } \
- } \
- else if (exponent >= IEEE854_LONG_DOUBLE_BIAS) \
- { \
- expnegative = 0; \
- exponent -= IEEE854_LONG_DOUBLE_BIAS; \
- } \
- else \
- { \
- expnegative = 1; \
- exponent = -(exponent - IEEE854_LONG_DOUBLE_BIAS); \
- } \
-} while (0)
+ PRINT_FPHEX (long double, fpnum.ldbl, ieee854_long_double, \
+ IEEE854_LONG_DOUBLE_BIAS)
#include <stdio-common/printf_fphex.c>
diff --git a/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h b/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h
new file mode 100644
index 0000000000..4d3ba72004
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/printf_fphex_macros.h
@@ -0,0 +1,104 @@
+/* Macro to print floating point numbers in hexadecimal notation.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define PRINT_FPHEX(FLOAT, VAR, IEEE854_UNION, IEEE854_BIAS) \
+do { \
+ /* We have 112 bits of mantissa plus one implicit digit. Since \
+ 112 bits are representable without rest using hexadecimal \
+ digits we use only the implicit digits for the number before \
+ the decimal point. */ \
+ unsigned long long int num0, num1; \
+ union IEEE854_UNION u; \
+ u.d = VAR; \
+ \
+ assert (sizeof (FLOAT) == 16); \
+ \
+ num0 = (((unsigned long long int) u.ieee.mantissa0) << 32 \
+ | u.ieee.mantissa1); \
+ num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \
+ | u.ieee.mantissa3); \
+ \
+ zero_mantissa = (num0|num1) == 0; \
+ \
+ if (sizeof (unsigned long int) > 6) \
+ { \
+ numstr = _itoa_word (num1, numbuf + sizeof numbuf, 16, \
+ info->spec == 'A'); \
+ wnumstr = _itowa_word (num1, \
+ wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t),\
+ 16, info->spec == 'A'); \
+ } \
+ else \
+ { \
+ numstr = _itoa (num1, numbuf + sizeof numbuf, 16, \
+ info->spec == 'A'); \
+ wnumstr = _itowa (num1, \
+ wnumbuf + sizeof (wnumbuf) / sizeof (wchar_t), \
+ 16, info->spec == 'A'); \
+ } \
+ \
+ while (numstr > numbuf + (sizeof numbuf - 64 / 4)) \
+ { \
+ *--numstr = '0'; \
+ *--wnumstr = L'0'; \
+ } \
+ \
+ if (sizeof (unsigned long int) > 6) \
+ { \
+ numstr = _itoa_word (num0, numstr, 16, info->spec == 'A'); \
+ wnumstr = _itowa_word (num0, wnumstr, 16, info->spec == 'A'); \
+ } \
+ else \
+ { \
+ numstr = _itoa (num0, numstr, 16, info->spec == 'A'); \
+ wnumstr = _itowa (num0, wnumstr, 16, info->spec == 'A'); \
+ } \
+ \
+ /* Fill with zeroes. */ \
+ while (numstr > numbuf + (sizeof numbuf - 112 / 4)) \
+ { \
+ *--numstr = '0'; \
+ *--wnumstr = L'0'; \
+ } \
+ \
+ leading = u.ieee.exponent == 0 ? '0' : '1'; \
+ \
+ exponent = u.ieee.exponent; \
+ \
+ if (exponent == 0) \
+ { \
+ if (zero_mantissa) \
+ expnegative = 0; \
+ else \
+ { \
+ /* This is a denormalized number. */ \
+ expnegative = 1; \
+ exponent = IEEE854_BIAS - 1; \
+ } \
+ } \
+ else if (exponent >= IEEE854_BIAS) \
+ { \
+ expnegative = 0; \
+ exponent -= IEEE854_BIAS; \
+ } \
+ else \
+ { \
+ expnegative = 1; \
+ exponent = -(exponent - IEEE854_BIAS); \
+ } \
+} while (0)
diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 5f3b9f2c76..a733ee7695 100644
--- a/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -32,16 +32,18 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
-static const long double
- one = 1.0L,
- ln2 = 6.931471805599453094172321214581765681e-1L,
- huge = 1.0e+4900L;
+static const _Float128
+ one = 1,
+ ln2 = L(6.931471805599453094172321214581765681e-1),
+ huge = L(1.0e+4900);
-long double
-__asinhl (long double x)
+_Float128
+__asinhl (_Float128 x)
{
- long double t, w;
+ _Float128 t, w;
int32_t ix, sign;
ieee854_long_double_shape_type u;
@@ -64,16 +66,16 @@ __asinhl (long double x)
else if (ix >0x40000000)
{ /* 2^ 54 > |x| > 2.0 */
t = u.value;
- w = __ieee754_logl (2.0 * t + one / (__ieee754_sqrtl (x * x + one) + t));
+ w = __ieee754_logl (2.0 * t + one / (sqrtl (x * x + one) + t));
}
else
{ /* 2.0 > |x| > 2 ^ -56 */
t = x * x;
- w = __log1pl (u.value + t / (one + __ieee754_sqrtl (one + t)));
+ w = __log1pl (u.value + t / (one + sqrtl (one + t)));
}
if (sign & 0x80000000)
return -w;
else
return w;
}
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index aaae701551..022ccf4c45 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -62,93 +62,95 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
/* arctan(k/8), k = 0, ..., 82 */
-static const long double atantbl[84] = {
- 0.0000000000000000000000000000000000000000E0L,
- 1.2435499454676143503135484916387102557317E-1L, /* arctan(0.125) */
- 2.4497866312686415417208248121127581091414E-1L,
- 3.5877067027057222039592006392646049977698E-1L,
- 4.6364760900080611621425623146121440202854E-1L,
- 5.5859931534356243597150821640166127034645E-1L,
- 6.4350110879328438680280922871732263804151E-1L,
- 7.1882999962162450541701415152590465395142E-1L,
- 7.8539816339744830961566084581987572104929E-1L,
- 8.4415398611317100251784414827164750652594E-1L,
- 8.9605538457134395617480071802993782702458E-1L,
- 9.4200004037946366473793717053459358607166E-1L,
- 9.8279372324732906798571061101466601449688E-1L,
- 1.0191413442663497346383429170230636487744E0L,
- 1.0516502125483736674598673120862998296302E0L,
- 1.0808390005411683108871567292171998202703E0L,
- 1.1071487177940905030170654601785370400700E0L,
- 1.1309537439791604464709335155363278047493E0L,
- 1.1525719972156675180401498626127513797495E0L,
- 1.1722738811284763866005949441337046149712E0L,
- 1.1902899496825317329277337748293183376012E0L,
- 1.2068173702852525303955115800565576303133E0L,
- 1.2220253232109896370417417439225704908830E0L,
- 1.2360594894780819419094519711090786987027E0L,
- 1.2490457723982544258299170772810901230778E0L,
- 1.2610933822524404193139408812473357720101E0L,
- 1.2722973952087173412961937498224804940684E0L,
- 1.2827408797442707473628852511364955306249E0L,
- 1.2924966677897852679030914214070816845853E0L,
- 1.3016288340091961438047858503666855921414E0L,
- 1.3101939350475556342564376891719053122733E0L,
- 1.3182420510168370498593302023271362531155E0L,
- 1.3258176636680324650592392104284756311844E0L,
- 1.3329603993374458675538498697331558093700E0L,
- 1.3397056595989995393283037525895557411039E0L,
- 1.3460851583802539310489409282517796256512E0L,
- 1.3521273809209546571891479413898128509842E0L,
- 1.3578579772154994751124898859640585287459E0L,
- 1.3633001003596939542892985278250991189943E0L,
- 1.3684746984165928776366381936948529556191E0L,
- 1.3734007669450158608612719264449611486510E0L,
- 1.3780955681325110444536609641291551522494E0L,
- 1.3825748214901258580599674177685685125566E0L,
- 1.3868528702577214543289381097042486034883E0L,
- 1.3909428270024183486427686943836432060856E0L,
- 1.3948567013423687823948122092044222644895E0L,
- 1.3986055122719575950126700816114282335732E0L,
- 1.4021993871854670105330304794336492676944E0L,
- 1.4056476493802697809521934019958079881002E0L,
- 1.4089588955564736949699075250792569287156E0L,
- 1.4121410646084952153676136718584891599630E0L,
- 1.4152014988178669079462550975833894394929E0L,
- 1.4181469983996314594038603039700989523716E0L,
- 1.4209838702219992566633046424614466661176E0L,
- 1.4237179714064941189018190466107297503086E0L,
- 1.4263547484202526397918060597281265695725E0L,
- 1.4288992721907326964184700745371983590908E0L,
- 1.4313562697035588982240194668401779312122E0L,
- 1.4337301524847089866404719096698873648610E0L,
- 1.4360250423171655234964275337155008780675E0L,
- 1.4382447944982225979614042479354815855386E0L,
- 1.4403930189057632173997301031392126865694E0L,
- 1.4424730991091018200252920599377292525125E0L,
- 1.4444882097316563655148453598508037025938E0L,
- 1.4464413322481351841999668424758804165254E0L,
- 1.4483352693775551917970437843145232637695E0L,
- 1.4501726582147939000905940595923466567576E0L,
- 1.4519559822271314199339700039142990228105E0L,
- 1.4536875822280323362423034480994649820285E0L,
- 1.4553696664279718992423082296859928222270E0L,
- 1.4570043196511885530074841089245667532358E0L,
- 1.4585935117976422128825857356750737658039E0L,
- 1.4601391056210009726721818194296893361233E0L,
- 1.4616428638860188872060496086383008594310E0L,
- 1.4631064559620759326975975316301202111560E0L,
- 1.4645314639038178118428450961503371619177E0L,
- 1.4659193880646627234129855241049975398470E0L,
- 1.4672716522843522691530527207287398276197E0L,
- 1.4685896086876430842559640450619880951144E0L,
- 1.4698745421276027686510391411132998919794E0L,
- 1.4711276743037345918528755717617308518553E0L,
- 1.4723501675822635384916444186631899205983E0L,
- 1.4735431285433308455179928682541563973416E0L, /* arctan(10.25) */
- 1.5707963267948966192313216916397514420986E0L /* pi/2 */
+static const _Float128 atantbl[84] = {
+ L(0.0000000000000000000000000000000000000000E0),
+ L(1.2435499454676143503135484916387102557317E-1), /* arctan(0.125) */
+ L(2.4497866312686415417208248121127581091414E-1),
+ L(3.5877067027057222039592006392646049977698E-1),
+ L(4.6364760900080611621425623146121440202854E-1),
+ L(5.5859931534356243597150821640166127034645E-1),
+ L(6.4350110879328438680280922871732263804151E-1),
+ L(7.1882999962162450541701415152590465395142E-1),
+ L(7.8539816339744830961566084581987572104929E-1),
+ L(8.4415398611317100251784414827164750652594E-1),
+ L(8.9605538457134395617480071802993782702458E-1),
+ L(9.4200004037946366473793717053459358607166E-1),
+ L(9.8279372324732906798571061101466601449688E-1),
+ L(1.0191413442663497346383429170230636487744E0),
+ L(1.0516502125483736674598673120862998296302E0),
+ L(1.0808390005411683108871567292171998202703E0),
+ L(1.1071487177940905030170654601785370400700E0),
+ L(1.1309537439791604464709335155363278047493E0),
+ L(1.1525719972156675180401498626127513797495E0),
+ L(1.1722738811284763866005949441337046149712E0),
+ L(1.1902899496825317329277337748293183376012E0),
+ L(1.2068173702852525303955115800565576303133E0),
+ L(1.2220253232109896370417417439225704908830E0),
+ L(1.2360594894780819419094519711090786987027E0),
+ L(1.2490457723982544258299170772810901230778E0),
+ L(1.2610933822524404193139408812473357720101E0),
+ L(1.2722973952087173412961937498224804940684E0),
+ L(1.2827408797442707473628852511364955306249E0),
+ L(1.2924966677897852679030914214070816845853E0),
+ L(1.3016288340091961438047858503666855921414E0),
+ L(1.3101939350475556342564376891719053122733E0),
+ L(1.3182420510168370498593302023271362531155E0),
+ L(1.3258176636680324650592392104284756311844E0),
+ L(1.3329603993374458675538498697331558093700E0),
+ L(1.3397056595989995393283037525895557411039E0),
+ L(1.3460851583802539310489409282517796256512E0),
+ L(1.3521273809209546571891479413898128509842E0),
+ L(1.3578579772154994751124898859640585287459E0),
+ L(1.3633001003596939542892985278250991189943E0),
+ L(1.3684746984165928776366381936948529556191E0),
+ L(1.3734007669450158608612719264449611486510E0),
+ L(1.3780955681325110444536609641291551522494E0),
+ L(1.3825748214901258580599674177685685125566E0),
+ L(1.3868528702577214543289381097042486034883E0),
+ L(1.3909428270024183486427686943836432060856E0),
+ L(1.3948567013423687823948122092044222644895E0),
+ L(1.3986055122719575950126700816114282335732E0),
+ L(1.4021993871854670105330304794336492676944E0),
+ L(1.4056476493802697809521934019958079881002E0),
+ L(1.4089588955564736949699075250792569287156E0),
+ L(1.4121410646084952153676136718584891599630E0),
+ L(1.4152014988178669079462550975833894394929E0),
+ L(1.4181469983996314594038603039700989523716E0),
+ L(1.4209838702219992566633046424614466661176E0),
+ L(1.4237179714064941189018190466107297503086E0),
+ L(1.4263547484202526397918060597281265695725E0),
+ L(1.4288992721907326964184700745371983590908E0),
+ L(1.4313562697035588982240194668401779312122E0),
+ L(1.4337301524847089866404719096698873648610E0),
+ L(1.4360250423171655234964275337155008780675E0),
+ L(1.4382447944982225979614042479354815855386E0),
+ L(1.4403930189057632173997301031392126865694E0),
+ L(1.4424730991091018200252920599377292525125E0),
+ L(1.4444882097316563655148453598508037025938E0),
+ L(1.4464413322481351841999668424758804165254E0),
+ L(1.4483352693775551917970437843145232637695E0),
+ L(1.4501726582147939000905940595923466567576E0),
+ L(1.4519559822271314199339700039142990228105E0),
+ L(1.4536875822280323362423034480994649820285E0),
+ L(1.4553696664279718992423082296859928222270E0),
+ L(1.4570043196511885530074841089245667532358E0),
+ L(1.4585935117976422128825857356750737658039E0),
+ L(1.4601391056210009726721818194296893361233E0),
+ L(1.4616428638860188872060496086383008594310E0),
+ L(1.4631064559620759326975975316301202111560E0),
+ L(1.4645314639038178118428450961503371619177E0),
+ L(1.4659193880646627234129855241049975398470E0),
+ L(1.4672716522843522691530527207287398276197E0),
+ L(1.4685896086876430842559640450619880951144E0),
+ L(1.4698745421276027686510391411132998919794E0),
+ L(1.4711276743037345918528755717617308518553E0),
+ L(1.4723501675822635384916444186631899205983E0),
+ L(1.4735431285433308455179928682541563973416E0), /* arctan(10.25) */
+ L(1.5707963267948966192313216916397514420986E0) /* pi/2 */
};
@@ -156,26 +158,26 @@ static const long double atantbl[84] = {
|t| <= 0.09375
peak relative error 5.3e-37 */
-static const long double
- p0 = -4.283708356338736809269381409828726405572E1L,
- p1 = -8.636132499244548540964557273544599863825E1L,
- p2 = -5.713554848244551350855604111031839613216E1L,
- p3 = -1.371405711877433266573835355036413750118E1L,
- p4 = -8.638214309119210906997318946650189640184E-1L,
- q0 = 1.285112506901621042780814422948906537959E2L,
- q1 = 3.361907253914337187957855834229672347089E2L,
- q2 = 3.180448303864130128268191635189365331680E2L,
- q3 = 1.307244136980865800160844625025280344686E2L,
- q4 = 2.173623741810414221251136181221172551416E1L;
+static const _Float128
+ p0 = L(-4.283708356338736809269381409828726405572E1),
+ p1 = L(-8.636132499244548540964557273544599863825E1),
+ p2 = L(-5.713554848244551350855604111031839613216E1),
+ p3 = L(-1.371405711877433266573835355036413750118E1),
+ p4 = L(-8.638214309119210906997318946650189640184E-1),
+ q0 = L(1.285112506901621042780814422948906537959E2),
+ q1 = L(3.361907253914337187957855834229672347089E2),
+ q2 = L(3.180448303864130128268191635189365331680E2),
+ q3 = L(1.307244136980865800160844625025280344686E2),
+ q4 = L(2.173623741810414221251136181221172551416E1);
/* q5 = 1.000000000000000000000000000000000000000E0 */
-static const long double huge = 1.0e4930L;
+static const _Float128 huge = L(1.0e4930);
-long double
-__atanl (long double x)
+_Float128
+__atanl (_Float128 x)
{
int k, sign;
- long double t, u, p, q;
+ _Float128 t, u, p, q;
ieee854_long_double_shape_type s;
s.value = x;
@@ -231,7 +233,7 @@ __atanl (long double x)
Roundoff to integer is asymmetrical to avoid cancellation when t < 0
(cf. fdlibm). */
k = 8.0 * x + 0.25;
- u = 0.125 * k;
+ u = L(0.125) * k;
/* Small arctan argument. */
t = (x - u) / (1.0 + x * u);
}
@@ -250,4 +252,4 @@ __atanl (long double x)
return u;
}
-weak_alias (__atanl, atanl)
+libm_alias_ldouble (__atan, atan)
diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
index c3ae96830e..526e850378 100644
--- a/sysdeps/ieee754/ldbl-128/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
@@ -56,18 +56,19 @@ Adapted for glibc October, 2001.
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
-static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
-static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
-static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
+static const _Float128 CBRT2 = L(1.259921049894873164767210607278228350570251);
+static const _Float128 CBRT4 = L(1.587401051968199474751705639272308260391493);
+static const _Float128 CBRT2I = L(0.7937005259840997373758528196361541301957467);
+static const _Float128 CBRT4I = L(0.6299605249474365823836053036391141752851257);
-long double
-__cbrtl (long double x)
+_Float128
+__cbrtl (_Float128 x)
{
int e, rem, sign;
- long double z;
+ _Float128 z;
if (!isfinite (x))
return x + x;
@@ -89,11 +90,11 @@ __cbrtl (long double x)
/* Approximate cube root of number between .5 and 1,
peak relative error = 1.2e-6 */
- x = ((((1.3584464340920900529734e-1L * x
- - 6.3986917220457538402318e-1L) * x
- + 1.2875551670318751538055e0L) * x
- - 1.4897083391357284957891e0L) * x
- + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L;
+ x = ((((L(1.3584464340920900529734e-1) * x
+ - L(6.3986917220457538402318e-1)) * x
+ + L(1.2875551670318751538055e0)) * x
+ - L(1.4897083391357284957891e0)) * x
+ + L(1.3304961236013647092521e0)) * x + L(3.7568280825958912391243e-1);
/* exponent divided by 3 */
if (e >= 0)
@@ -123,13 +124,13 @@ __cbrtl (long double x)
x = __ldexpl (x, e);
/* Newton iteration */
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
- x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+ x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
if (sign < 0)
x = -x;
return (x);
}
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c
index 9f6bc4ce15..e6aba5f2af 100644
--- a/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -22,34 +22,28 @@ static char rcsid[] = "$NetBSD: $";
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to ceil(x).
*/
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0e4930L;
-
-long double __ceill(long double x)
+_Float128 __ceill(_Float128 x)
{
int64_t i0,i1,j0;
- u_int64_t i,j;
+ uint64_t i,j;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<48) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0<0) {i0=0x8000000000000000ULL;i1=0;}
- else if((i0|i1)!=0) { i0=0x3fff000000000000ULL;i1=0;}
- }
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
+ if(i0<0) {i0=0x8000000000000000ULL;i1=0;}
+ else if((i0|i1)!=0) { i0=0x3fff000000000000ULL;i1=0;}
} else {
i = (0x0000ffffffffffffULL)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) i0 += (0x0001000000000000LL)>>j0;
- i0 &= (~i); i1=0;
- }
+ if(i0>0) i0 += (0x0001000000000000LL)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>111) {
if(j0==0x4000) return x+x; /* inf or NaN */
@@ -57,19 +51,17 @@ long double __ceill(long double x)
} else {
i = -1ULL>>(j0-48);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) {
- if(j0==48) i0+=1;
- else {
- j = i1+(1LL<<(112-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
+ if(i0>0) {
+ if(j0==48) i0+=1;
+ else {
+ j = i1+(1LL<<(112-j0));
+ if(j<i1) i0 +=1 ; /* got a carry */
+ i1=j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
SET_LDOUBLE_WORDS64(x,i0,i1);
return x;
}
-weak_alias (__ceill, ceill)
+libm_alias_ldouble (__ceil, ceil)
diff --git a/sysdeps/ieee754/ldbl-128/s_copysignl.c b/sysdeps/ieee754/ldbl-128/s_copysignl.c
index 19b6880940..d23e0f72ea 100644
--- a/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -25,14 +25,15 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __copysignl(long double x, long double y)
+_Float128 __copysignl(_Float128 x, _Float128 y)
{
- u_int64_t hx,hy;
+ uint64_t hx,hy;
GET_LDOUBLE_MSW64(hx,x);
GET_LDOUBLE_MSW64(hy,y);
SET_LDOUBLE_MSW64(x,(hx&0x7fffffffffffffffULL)
|(hy&0x8000000000000000ULL));
return x;
}
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index 2c3bff6e0f..b315abccc5 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __cosl(long double x)
+_Float128 __cosl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
@@ -83,4 +84,4 @@ long double __cosl(long double x)
}
}
}
-weak_alias (__cosl, cosl)
+libm_alias_ldouble (__cos, cos)
diff --git a/sysdeps/ieee754/ldbl-128/s_daddl.c b/sysdeps/ieee754/ldbl-128/s_daddl.c
new file mode 100644
index 0000000000..81e8e2d3e1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_daddl.c
@@ -0,0 +1,37 @@
+/* Add long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <math.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+
+#include <math-narrow.h>
+
+double
+__daddl (_Float128 x, _Float128 y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_ddivl.c b/sysdeps/ieee754/ldbl-128/s_ddivl.c
new file mode 100644
index 0000000000..c76df92bfb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ddivl.c
@@ -0,0 +1,37 @@
+/* Divide long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <math.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+
+#include <math-narrow.h>
+
+double
+__ddivl (_Float128 x, _Float128 y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_dmull.c b/sysdeps/ieee754/ldbl-128/s_dmull.c
new file mode 100644
index 0000000000..d32c4284e0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_dmull.c
@@ -0,0 +1,37 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <math.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+
+#include <math-narrow.h>
+
+double
+__dmull (_Float128 x, _Float128 y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_dsubl.c b/sysdeps/ieee754/ldbl-128/s_dsubl.c
new file mode 100644
index 0000000000..46d0f95b4c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_dsubl.c
@@ -0,0 +1,37 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <math.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+
+#include <math-narrow.h>
+
+double
+__dsubl (_Float128 x, _Float128 y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index dd275a7dd9..c0abfe2926 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -100,13 +100,15 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-neval (long double x, const long double *p, int n)
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = *p--;
@@ -121,10 +123,10 @@ neval (long double x, const long double *p, int n)
/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
-static long double
-deval (long double x, const long double *p, int n)
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
{
- long double y;
+ _Float128 y;
p += n;
y = x + *p--;
@@ -138,42 +140,42 @@ deval (long double x, const long double *p, int n)
-static const long double
-tiny = 1e-4931L,
- one = 1.0L,
- two = 2.0L,
+static const _Float128
+tiny = L(1e-4931),
+ one = 1,
+ two = 2,
/* 2/sqrt(pi) - 1 */
- efx = 1.2837916709551257389615890312154517168810E-1L;
+ efx = L(1.2837916709551257389615890312154517168810E-1);
/* erf(x) = x + x R(x^2)
0 <= x <= 7/8
Peak relative error 1.8e-35 */
#define NTN1 8
-static const long double TN1[NTN1 + 1] =
-{
- -3.858252324254637124543172907442106422373E10L,
- 9.580319248590464682316366876952214879858E10L,
- 1.302170519734879977595901236693040544854E10L,
- 2.922956950426397417800321486727032845006E9L,
- 1.764317520783319397868923218385468729799E8L,
- 1.573436014601118630105796794840834145120E7L,
- 4.028077380105721388745632295157816229289E5L,
- 1.644056806467289066852135096352853491530E4L,
- 3.390868480059991640235675479463287886081E1L
+static const _Float128 TN1[NTN1 + 1] =
+{
+ L(-3.858252324254637124543172907442106422373E10),
+ L(9.580319248590464682316366876952214879858E10),
+ L(1.302170519734879977595901236693040544854E10),
+ L(2.922956950426397417800321486727032845006E9),
+ L(1.764317520783319397868923218385468729799E8),
+ L(1.573436014601118630105796794840834145120E7),
+ L(4.028077380105721388745632295157816229289E5),
+ L(1.644056806467289066852135096352853491530E4),
+ L(3.390868480059991640235675479463287886081E1)
};
#define NTD1 8
-static const long double TD1[NTD1 + 1] =
-{
- -3.005357030696532927149885530689529032152E11L,
- -1.342602283126282827411658673839982164042E11L,
- -2.777153893355340961288511024443668743399E10L,
- -3.483826391033531996955620074072768276974E9L,
- -2.906321047071299585682722511260895227921E8L,
- -1.653347985722154162439387878512427542691E7L,
- -6.245520581562848778466500301865173123136E5L,
- -1.402124304177498828590239373389110545142E4L,
- -1.209368072473510674493129989468348633579E2L
+static const _Float128 TD1[NTD1 + 1] =
+{
+ L(-3.005357030696532927149885530689529032152E11),
+ L(-1.342602283126282827411658673839982164042E11),
+ L(-2.777153893355340961288511024443668743399E10),
+ L(-3.483826391033531996955620074072768276974E9),
+ L(-2.906321047071299585682722511260895227921E8),
+ L(-1.653347985722154162439387878512427542691E7),
+ L(-6.245520581562848778466500301865173123136E5),
+ L(-1.402124304177498828590239373389110545142E4),
+ L(-1.209368072473510674493129989468348633579E2)
/* 1.0E0 */
};
@@ -181,32 +183,32 @@ static const long double TD1[NTD1 + 1] =
/* erf(z+1) = erf_const + P(z)/Q(z)
-.125 <= z <= 0
Peak relative error 7.3e-36 */
-static const long double erf_const = 0.845062911510467529296875L;
+static const _Float128 erf_const = L(0.845062911510467529296875);
#define NTN2 8
-static const long double TN2[NTN2 + 1] =
-{
- -4.088889697077485301010486931817357000235E1L,
- 7.157046430681808553842307502826960051036E3L,
- -2.191561912574409865550015485451373731780E3L,
- 2.180174916555316874988981177654057337219E3L,
- 2.848578658049670668231333682379720943455E2L,
- 1.630362490952512836762810462174798925274E2L,
- 6.317712353961866974143739396865293596895E0L,
- 2.450441034183492434655586496522857578066E1L,
- 5.127662277706787664956025545897050896203E-1L
+static const _Float128 TN2[NTN2 + 1] =
+{
+ L(-4.088889697077485301010486931817357000235E1),
+ L(7.157046430681808553842307502826960051036E3),
+ L(-2.191561912574409865550015485451373731780E3),
+ L(2.180174916555316874988981177654057337219E3),
+ L(2.848578658049670668231333682379720943455E2),
+ L(1.630362490952512836762810462174798925274E2),
+ L(6.317712353961866974143739396865293596895E0),
+ L(2.450441034183492434655586496522857578066E1),
+ L(5.127662277706787664956025545897050896203E-1)
};
#define NTD2 8
-static const long double TD2[NTD2 + 1] =
-{
- 1.731026445926834008273768924015161048885E4L,
- 1.209682239007990370796112604286048173750E4L,
- 1.160950290217993641320602282462976163857E4L,
- 5.394294645127126577825507169061355698157E3L,
- 2.791239340533632669442158497532521776093E3L,
- 8.989365571337319032943005387378993827684E2L,
- 2.974016493766349409725385710897298069677E2L,
- 6.148192754590376378740261072533527271947E1L,
- 1.178502892490738445655468927408440847480E1L
+static const _Float128 TD2[NTD2 + 1] =
+{
+ L(1.731026445926834008273768924015161048885E4),
+ L(1.209682239007990370796112604286048173750E4),
+ L(1.160950290217993641320602282462976163857E4),
+ L(5.394294645127126577825507169061355698157E3),
+ L(2.791239340533632669442158497532521776093E3),
+ L(8.989365571337319032943005387378993827684E2),
+ L(2.974016493766349409725385710897298069677E2),
+ L(6.148192754590376378740261072533527271947E1),
+ L(1.178502892490738445655468927408440847480E1)
/* 1.0E0 */
};
@@ -215,297 +217,297 @@ static const long double TD2[NTD2 + 1] =
0 <= x < 0.125
Peak relative error 1.4e-35 */
#define NRNr13 8
-static const long double RNr13[NRNr13 + 1] =
-{
- -2.353707097641280550282633036456457014829E3L,
- 3.871159656228743599994116143079870279866E2L,
- -3.888105134258266192210485617504098426679E2L,
- -2.129998539120061668038806696199343094971E1L,
- -8.125462263594034672468446317145384108734E1L,
- 8.151549093983505810118308635926270319660E0L,
- -5.033362032729207310462422357772568553670E0L,
- -4.253956621135136090295893547735851168471E-2L,
- -8.098602878463854789780108161581050357814E-2L
+static const _Float128 RNr13[NRNr13 + 1] =
+{
+ L(-2.353707097641280550282633036456457014829E3),
+ L(3.871159656228743599994116143079870279866E2),
+ L(-3.888105134258266192210485617504098426679E2),
+ L(-2.129998539120061668038806696199343094971E1),
+ L(-8.125462263594034672468446317145384108734E1),
+ L(8.151549093983505810118308635926270319660E0),
+ L(-5.033362032729207310462422357772568553670E0),
+ L(-4.253956621135136090295893547735851168471E-2),
+ L(-8.098602878463854789780108161581050357814E-2)
};
#define NRDr13 7
-static const long double RDr13[NRDr13 + 1] =
-{
- 2.220448796306693503549505450626652881752E3L,
- 1.899133258779578688791041599040951431383E2L,
- 1.061906712284961110196427571557149268454E3L,
- 7.497086072306967965180978101974566760042E1L,
- 2.146796115662672795876463568170441327274E2L,
- 1.120156008362573736664338015952284925592E1L,
- 2.211014952075052616409845051695042741074E1L,
- 6.469655675326150785692908453094054988938E-1L
+static const _Float128 RDr13[NRDr13 + 1] =
+{
+ L(2.220448796306693503549505450626652881752E3),
+ L(1.899133258779578688791041599040951431383E2),
+ L(1.061906712284961110196427571557149268454E3),
+ L(7.497086072306967965180978101974566760042E1),
+ L(2.146796115662672795876463568170441327274E2),
+ L(1.120156008362573736664338015952284925592E1),
+ L(2.211014952075052616409845051695042741074E1),
+ L(6.469655675326150785692908453094054988938E-1)
/* 1.0E0 */
};
/* erfc(0.25) = C13a + C13b to extra precision. */
-static const long double C13a = 0.723663330078125L;
-static const long double C13b = 1.0279753638067014931732235184287934646022E-5L;
+static const _Float128 C13a = L(0.723663330078125);
+static const _Float128 C13b = L(1.0279753638067014931732235184287934646022E-5);
/* erfc(x + 0.375) = erfc(0.375) + x R(x)
0 <= x < 0.125
Peak relative error 1.2e-35 */
#define NRNr14 8
-static const long double RNr14[NRNr14 + 1] =
-{
- -2.446164016404426277577283038988918202456E3L,
- 6.718753324496563913392217011618096698140E2L,
- -4.581631138049836157425391886957389240794E2L,
- -2.382844088987092233033215402335026078208E1L,
- -7.119237852400600507927038680970936336458E1L,
- 1.313609646108420136332418282286454287146E1L,
- -6.188608702082264389155862490056401365834E0L,
- -2.787116601106678287277373011101132659279E-2L,
- -2.230395570574153963203348263549700967918E-2L
+static const _Float128 RNr14[NRNr14 + 1] =
+{
+ L(-2.446164016404426277577283038988918202456E3),
+ L(6.718753324496563913392217011618096698140E2),
+ L(-4.581631138049836157425391886957389240794E2),
+ L(-2.382844088987092233033215402335026078208E1),
+ L(-7.119237852400600507927038680970936336458E1),
+ L(1.313609646108420136332418282286454287146E1),
+ L(-6.188608702082264389155862490056401365834E0),
+ L(-2.787116601106678287277373011101132659279E-2),
+ L(-2.230395570574153963203348263549700967918E-2)
};
#define NRDr14 7
-static const long double RDr14[NRDr14 + 1] =
-{
- 2.495187439241869732696223349840963702875E3L,
- 2.503549449872925580011284635695738412162E2L,
- 1.159033560988895481698051531263861842461E3L,
- 9.493751466542304491261487998684383688622E1L,
- 2.276214929562354328261422263078480321204E2L,
- 1.367697521219069280358984081407807931847E1L,
- 2.276988395995528495055594829206582732682E1L,
- 7.647745753648996559837591812375456641163E-1L
+static const _Float128 RDr14[NRDr14 + 1] =
+{
+ L(2.495187439241869732696223349840963702875E3),
+ L(2.503549449872925580011284635695738412162E2),
+ L(1.159033560988895481698051531263861842461E3),
+ L(9.493751466542304491261487998684383688622E1),
+ L(2.276214929562354328261422263078480321204E2),
+ L(1.367697521219069280358984081407807931847E1),
+ L(2.276988395995528495055594829206582732682E1),
+ L(7.647745753648996559837591812375456641163E-1)
/* 1.0E0 */
};
/* erfc(0.375) = C14a + C14b to extra precision. */
-static const long double C14a = 0.5958709716796875L;
-static const long double C14b = 1.2118885490201676174914080878232469565953E-5L;
+static const _Float128 C14a = L(0.5958709716796875);
+static const _Float128 C14b = L(1.2118885490201676174914080878232469565953E-5);
/* erfc(x + 0.5) = erfc(0.5) + x R(x)
0 <= x < 0.125
Peak relative error 4.7e-36 */
#define NRNr15 8
-static const long double RNr15[NRNr15 + 1] =
-{
- -2.624212418011181487924855581955853461925E3L,
- 8.473828904647825181073831556439301342756E2L,
- -5.286207458628380765099405359607331669027E2L,
- -3.895781234155315729088407259045269652318E1L,
- -6.200857908065163618041240848728398496256E1L,
- 1.469324610346924001393137895116129204737E1L,
- -6.961356525370658572800674953305625578903E0L,
- 5.145724386641163809595512876629030548495E-3L,
- 1.990253655948179713415957791776180406812E-2L
+static const _Float128 RNr15[NRNr15 + 1] =
+{
+ L(-2.624212418011181487924855581955853461925E3),
+ L(8.473828904647825181073831556439301342756E2),
+ L(-5.286207458628380765099405359607331669027E2),
+ L(-3.895781234155315729088407259045269652318E1),
+ L(-6.200857908065163618041240848728398496256E1),
+ L(1.469324610346924001393137895116129204737E1),
+ L(-6.961356525370658572800674953305625578903E0),
+ L(5.145724386641163809595512876629030548495E-3),
+ L(1.990253655948179713415957791776180406812E-2)
};
#define NRDr15 7
-static const long double RDr15[NRDr15 + 1] =
-{
- 2.986190760847974943034021764693341524962E3L,
- 5.288262758961073066335410218650047725985E2L,
- 1.363649178071006978355113026427856008978E3L,
- 1.921707975649915894241864988942255320833E2L,
- 2.588651100651029023069013885900085533226E2L,
- 2.628752920321455606558942309396855629459E1L,
- 2.455649035885114308978333741080991380610E1L,
- 1.378826653595128464383127836412100939126E0L
+static const _Float128 RDr15[NRDr15 + 1] =
+{
+ L(2.986190760847974943034021764693341524962E3),
+ L(5.288262758961073066335410218650047725985E2),
+ L(1.363649178071006978355113026427856008978E3),
+ L(1.921707975649915894241864988942255320833E2),
+ L(2.588651100651029023069013885900085533226E2),
+ L(2.628752920321455606558942309396855629459E1),
+ L(2.455649035885114308978333741080991380610E1),
+ L(1.378826653595128464383127836412100939126E0)
/* 1.0E0 */
};
/* erfc(0.5) = C15a + C15b to extra precision. */
-static const long double C15a = 0.4794921875L;
-static const long double C15b = 7.9346869534623172533461080354712635484242E-6L;
+static const _Float128 C15a = L(0.4794921875);
+static const _Float128 C15b = L(7.9346869534623172533461080354712635484242E-6);
/* erfc(x + 0.625) = erfc(0.625) + x R(x)
0 <= x < 0.125
Peak relative error 5.1e-36 */
#define NRNr16 8
-static const long double RNr16[NRNr16 + 1] =
-{
- -2.347887943200680563784690094002722906820E3L,
- 8.008590660692105004780722726421020136482E2L,
- -5.257363310384119728760181252132311447963E2L,
- -4.471737717857801230450290232600243795637E1L,
- -4.849540386452573306708795324759300320304E1L,
- 1.140885264677134679275986782978655952843E1L,
- -6.731591085460269447926746876983786152300E0L,
- 1.370831653033047440345050025876085121231E-1L,
- 2.022958279982138755020825717073966576670E-2L,
+static const _Float128 RNr16[NRNr16 + 1] =
+{
+ L(-2.347887943200680563784690094002722906820E3),
+ L(8.008590660692105004780722726421020136482E2),
+ L(-5.257363310384119728760181252132311447963E2),
+ L(-4.471737717857801230450290232600243795637E1),
+ L(-4.849540386452573306708795324759300320304E1),
+ L(1.140885264677134679275986782978655952843E1),
+ L(-6.731591085460269447926746876983786152300E0),
+ L(1.370831653033047440345050025876085121231E-1),
+ L(2.022958279982138755020825717073966576670E-2),
};
#define NRDr16 7
-static const long double RDr16[NRDr16 + 1] =
-{
- 3.075166170024837215399323264868308087281E3L,
- 8.730468942160798031608053127270430036627E2L,
- 1.458472799166340479742581949088453244767E3L,
- 3.230423687568019709453130785873540386217E2L,
- 2.804009872719893612081109617983169474655E2L,
- 4.465334221323222943418085830026979293091E1L,
- 2.612723259683205928103787842214809134746E1L,
- 2.341526751185244109722204018543276124997E0L,
+static const _Float128 RDr16[NRDr16 + 1] =
+{
+ L(3.075166170024837215399323264868308087281E3),
+ L(8.730468942160798031608053127270430036627E2),
+ L(1.458472799166340479742581949088453244767E3),
+ L(3.230423687568019709453130785873540386217E2),
+ L(2.804009872719893612081109617983169474655E2),
+ L(4.465334221323222943418085830026979293091E1),
+ L(2.612723259683205928103787842214809134746E1),
+ L(2.341526751185244109722204018543276124997E0),
/* 1.0E0 */
};
/* erfc(0.625) = C16a + C16b to extra precision. */
-static const long double C16a = 0.3767547607421875L;
-static const long double C16b = 4.3570693945275513594941232097252997287766E-6L;
+static const _Float128 C16a = L(0.3767547607421875);
+static const _Float128 C16b = L(4.3570693945275513594941232097252997287766E-6);
/* erfc(x + 0.75) = erfc(0.75) + x R(x)
0 <= x < 0.125
Peak relative error 1.7e-35 */
#define NRNr17 8
-static const long double RNr17[NRNr17 + 1] =
-{
- -1.767068734220277728233364375724380366826E3L,
- 6.693746645665242832426891888805363898707E2L,
- -4.746224241837275958126060307406616817753E2L,
- -2.274160637728782675145666064841883803196E1L,
- -3.541232266140939050094370552538987982637E1L,
- 6.988950514747052676394491563585179503865E0L,
- -5.807687216836540830881352383529281215100E0L,
- 3.631915988567346438830283503729569443642E-1L,
- -1.488945487149634820537348176770282391202E-2L
+static const _Float128 RNr17[NRNr17 + 1] =
+{
+ L(-1.767068734220277728233364375724380366826E3),
+ L(6.693746645665242832426891888805363898707E2),
+ L(-4.746224241837275958126060307406616817753E2),
+ L(-2.274160637728782675145666064841883803196E1),
+ L(-3.541232266140939050094370552538987982637E1),
+ L(6.988950514747052676394491563585179503865E0),
+ L(-5.807687216836540830881352383529281215100E0),
+ L(3.631915988567346438830283503729569443642E-1),
+ L(-1.488945487149634820537348176770282391202E-2)
};
#define NRDr17 7
-static const long double RDr17[NRDr17 + 1] =
-{
- 2.748457523498150741964464942246913394647E3L,
- 1.020213390713477686776037331757871252652E3L,
- 1.388857635935432621972601695296561952738E3L,
- 3.903363681143817750895999579637315491087E2L,
- 2.784568344378139499217928969529219886578E2L,
- 5.555800830216764702779238020065345401144E1L,
- 2.646215470959050279430447295801291168941E1L,
- 2.984905282103517497081766758550112011265E0L,
+static const _Float128 RDr17[NRDr17 + 1] =
+{
+ L(2.748457523498150741964464942246913394647E3),
+ L(1.020213390713477686776037331757871252652E3),
+ L(1.388857635935432621972601695296561952738E3),
+ L(3.903363681143817750895999579637315491087E2),
+ L(2.784568344378139499217928969529219886578E2),
+ L(5.555800830216764702779238020065345401144E1),
+ L(2.646215470959050279430447295801291168941E1),
+ L(2.984905282103517497081766758550112011265E0),
/* 1.0E0 */
};
/* erfc(0.75) = C17a + C17b to extra precision. */
-static const long double C17a = 0.2888336181640625L;
-static const long double C17b = 1.0748182422368401062165408589222625794046E-5L;
+static const _Float128 C17a = L(0.2888336181640625);
+static const _Float128 C17b = L(1.0748182422368401062165408589222625794046E-5);
/* erfc(x + 0.875) = erfc(0.875) + x R(x)
0 <= x < 0.125
Peak relative error 2.2e-35 */
#define NRNr18 8
-static const long double RNr18[NRNr18 + 1] =
-{
- -1.342044899087593397419622771847219619588E3L,
- 6.127221294229172997509252330961641850598E2L,
- -4.519821356522291185621206350470820610727E2L,
- 1.223275177825128732497510264197915160235E1L,
- -2.730789571382971355625020710543532867692E1L,
- 4.045181204921538886880171727755445395862E0L,
- -4.925146477876592723401384464691452700539E0L,
- 5.933878036611279244654299924101068088582E-1L,
- -5.557645435858916025452563379795159124753E-2L
+static const _Float128 RNr18[NRNr18 + 1] =
+{
+ L(-1.342044899087593397419622771847219619588E3),
+ L(6.127221294229172997509252330961641850598E2),
+ L(-4.519821356522291185621206350470820610727E2),
+ L(1.223275177825128732497510264197915160235E1),
+ L(-2.730789571382971355625020710543532867692E1),
+ L(4.045181204921538886880171727755445395862E0),
+ L(-4.925146477876592723401384464691452700539E0),
+ L(5.933878036611279244654299924101068088582E-1),
+ L(-5.557645435858916025452563379795159124753E-2)
};
#define NRDr18 7
-static const long double RDr18[NRDr18 + 1] =
-{
- 2.557518000661700588758505116291983092951E3L,
- 1.070171433382888994954602511991940418588E3L,
- 1.344842834423493081054489613250688918709E3L,
- 4.161144478449381901208660598266288188426E2L,
- 2.763670252219855198052378138756906980422E2L,
- 5.998153487868943708236273854747564557632E1L,
- 2.657695108438628847733050476209037025318E1L,
- 3.252140524394421868923289114410336976512E0L,
+static const _Float128 RDr18[NRDr18 + 1] =
+{
+ L(2.557518000661700588758505116291983092951E3),
+ L(1.070171433382888994954602511991940418588E3),
+ L(1.344842834423493081054489613250688918709E3),
+ L(4.161144478449381901208660598266288188426E2),
+ L(2.763670252219855198052378138756906980422E2),
+ L(5.998153487868943708236273854747564557632E1),
+ L(2.657695108438628847733050476209037025318E1),
+ L(3.252140524394421868923289114410336976512E0),
/* 1.0E0 */
};
/* erfc(0.875) = C18a + C18b to extra precision. */
-static const long double C18a = 0.215911865234375L;
-static const long double C18b = 1.3073705765341685464282101150637224028267E-5L;
+static const _Float128 C18a = L(0.215911865234375);
+static const _Float128 C18b = L(1.3073705765341685464282101150637224028267E-5);
/* erfc(x + 1.0) = erfc(1.0) + x R(x)
0 <= x < 0.125
Peak relative error 1.6e-35 */
#define NRNr19 8
-static const long double RNr19[NRNr19 + 1] =
-{
- -1.139180936454157193495882956565663294826E3L,
- 6.134903129086899737514712477207945973616E2L,
- -4.628909024715329562325555164720732868263E2L,
- 4.165702387210732352564932347500364010833E1L,
- -2.286979913515229747204101330405771801610E1L,
- 1.870695256449872743066783202326943667722E0L,
- -4.177486601273105752879868187237000032364E0L,
- 7.533980372789646140112424811291782526263E-1L,
- -8.629945436917752003058064731308767664446E-2L
+static const _Float128 RNr19[NRNr19 + 1] =
+{
+ L(-1.139180936454157193495882956565663294826E3),
+ L(6.134903129086899737514712477207945973616E2),
+ L(-4.628909024715329562325555164720732868263E2),
+ L(4.165702387210732352564932347500364010833E1),
+ L(-2.286979913515229747204101330405771801610E1),
+ L(1.870695256449872743066783202326943667722E0),
+ L(-4.177486601273105752879868187237000032364E0),
+ L(7.533980372789646140112424811291782526263E-1),
+ L(-8.629945436917752003058064731308767664446E-2)
};
#define NRDr19 7
-static const long double RDr19[NRDr19 + 1] =
-{
- 2.744303447981132701432716278363418643778E3L,
- 1.266396359526187065222528050591302171471E3L,
- 1.466739461422073351497972255511919814273E3L,
- 4.868710570759693955597496520298058147162E2L,
- 2.993694301559756046478189634131722579643E2L,
- 6.868976819510254139741559102693828237440E1L,
- 2.801505816247677193480190483913753613630E1L,
- 3.604439909194350263552750347742663954481E0L,
+static const _Float128 RDr19[NRDr19 + 1] =
+{
+ L(2.744303447981132701432716278363418643778E3),
+ L(1.266396359526187065222528050591302171471E3),
+ L(1.466739461422073351497972255511919814273E3),
+ L(4.868710570759693955597496520298058147162E2),
+ L(2.993694301559756046478189634131722579643E2),
+ L(6.868976819510254139741559102693828237440E1),
+ L(2.801505816247677193480190483913753613630E1),
+ L(3.604439909194350263552750347742663954481E0),
/* 1.0E0 */
};
/* erfc(1.0) = C19a + C19b to extra precision. */
-static const long double C19a = 0.15728759765625L;
-static const long double C19b = 1.1609394035130658779364917390740703933002E-5L;
+static const _Float128 C19a = L(0.15728759765625);
+static const _Float128 C19b = L(1.1609394035130658779364917390740703933002E-5);
/* erfc(x + 1.125) = erfc(1.125) + x R(x)
0 <= x < 0.125
Peak relative error 3.6e-36 */
#define NRNr20 8
-static const long double RNr20[NRNr20 + 1] =
-{
- -9.652706916457973956366721379612508047640E2L,
- 5.577066396050932776683469951773643880634E2L,
- -4.406335508848496713572223098693575485978E2L,
- 5.202893466490242733570232680736966655434E1L,
- -1.931311847665757913322495948705563937159E1L,
- -9.364318268748287664267341457164918090611E-2L,
- -3.306390351286352764891355375882586201069E0L,
- 7.573806045289044647727613003096916516475E-1L,
- -9.611744011489092894027478899545635991213E-2L
+static const _Float128 RNr20[NRNr20 + 1] =
+{
+ L(-9.652706916457973956366721379612508047640E2),
+ L(5.577066396050932776683469951773643880634E2),
+ L(-4.406335508848496713572223098693575485978E2),
+ L(5.202893466490242733570232680736966655434E1),
+ L(-1.931311847665757913322495948705563937159E1),
+ L(-9.364318268748287664267341457164918090611E-2),
+ L(-3.306390351286352764891355375882586201069E0),
+ L(7.573806045289044647727613003096916516475E-1),
+ L(-9.611744011489092894027478899545635991213E-2)
};
#define NRDr20 7
-static const long double RDr20[NRDr20 + 1] =
-{
- 3.032829629520142564106649167182428189014E3L,
- 1.659648470721967719961167083684972196891E3L,
- 1.703545128657284619402511356932569292535E3L,
- 6.393465677731598872500200253155257708763E2L,
- 3.489131397281030947405287112726059221934E2L,
- 8.848641738570783406484348434387611713070E1L,
- 3.132269062552392974833215844236160958502E1L,
- 4.430131663290563523933419966185230513168E0L
+static const _Float128 RDr20[NRDr20 + 1] =
+{
+ L(3.032829629520142564106649167182428189014E3),
+ L(1.659648470721967719961167083684972196891E3),
+ L(1.703545128657284619402511356932569292535E3),
+ L(6.393465677731598872500200253155257708763E2),
+ L(3.489131397281030947405287112726059221934E2),
+ L(8.848641738570783406484348434387611713070E1),
+ L(3.132269062552392974833215844236160958502E1),
+ L(4.430131663290563523933419966185230513168E0)
/* 1.0E0 */
};
/* erfc(1.125) = C20a + C20b to extra precision. */
-static const long double C20a = 0.111602783203125L;
-static const long double C20b = 8.9850951672359304215530728365232161564636E-6L;
+static const _Float128 C20a = L(0.111602783203125);
+static const _Float128 C20b = L(8.9850951672359304215530728365232161564636E-6);
/* erfc(1/x) = 1/x exp (-1/x^2 - 0.5625 + R(1/x^2))
7/8 <= 1/x < 1
Peak relative error 1.4e-35 */
#define NRNr8 9
-static const long double RNr8[NRNr8 + 1] =
-{
- 3.587451489255356250759834295199296936784E1L,
- 5.406249749087340431871378009874875889602E2L,
- 2.931301290625250886238822286506381194157E3L,
- 7.359254185241795584113047248898753470923E3L,
- 9.201031849810636104112101947312492532314E3L,
- 5.749697096193191467751650366613289284777E3L,
- 1.710415234419860825710780802678697889231E3L,
- 2.150753982543378580859546706243022719599E2L,
- 8.740953582272147335100537849981160931197E0L,
- 4.876422978828717219629814794707963640913E-2L
+static const _Float128 RNr8[NRNr8 + 1] =
+{
+ L(3.587451489255356250759834295199296936784E1),
+ L(5.406249749087340431871378009874875889602E2),
+ L(2.931301290625250886238822286506381194157E3),
+ L(7.359254185241795584113047248898753470923E3),
+ L(9.201031849810636104112101947312492532314E3),
+ L(5.749697096193191467751650366613289284777E3),
+ L(1.710415234419860825710780802678697889231E3),
+ L(2.150753982543378580859546706243022719599E2),
+ L(8.740953582272147335100537849981160931197E0),
+ L(4.876422978828717219629814794707963640913E-2)
};
#define NRDr8 8
-static const long double RDr8[NRDr8 + 1] =
-{
- 6.358593134096908350929496535931630140282E1L,
- 9.900253816552450073757174323424051765523E2L,
- 5.642928777856801020545245437089490805186E3L,
- 1.524195375199570868195152698617273739609E4L,
- 2.113829644500006749947332935305800887345E4L,
- 1.526438562626465706267943737310282977138E4L,
- 5.561370922149241457131421914140039411782E3L,
- 9.394035530179705051609070428036834496942E2L,
- 6.147019596150394577984175188032707343615E1L
+static const _Float128 RDr8[NRDr8 + 1] =
+{
+ L(6.358593134096908350929496535931630140282E1),
+ L(9.900253816552450073757174323424051765523E2),
+ L(5.642928777856801020545245437089490805186E3),
+ L(1.524195375199570868195152698617273739609E4),
+ L(2.113829644500006749947332935305800887345E4),
+ L(1.526438562626465706267943737310282977138E4),
+ L(5.561370922149241457131421914140039411782E3),
+ L(9.394035530179705051609070428036834496942E2),
+ L(6.147019596150394577984175188032707343615E1)
/* 1.0E0 */
};
@@ -513,32 +515,32 @@ static const long double RDr8[NRDr8 + 1] =
0.75 <= 1/x <= 0.875
Peak relative error 2.0e-36 */
#define NRNr7 9
-static const long double RNr7[NRNr7 + 1] =
-{
- 1.686222193385987690785945787708644476545E1L,
- 1.178224543567604215602418571310612066594E3L,
- 1.764550584290149466653899886088166091093E4L,
- 1.073758321890334822002849369898232811561E5L,
- 3.132840749205943137619839114451290324371E5L,
- 4.607864939974100224615527007793867585915E5L,
- 3.389781820105852303125270837910972384510E5L,
- 1.174042187110565202875011358512564753399E5L,
- 1.660013606011167144046604892622504338313E4L,
- 6.700393957480661937695573729183733234400E2L
+static const _Float128 RNr7[NRNr7 + 1] =
+{
+ L(1.686222193385987690785945787708644476545E1),
+ L(1.178224543567604215602418571310612066594E3),
+ L(1.764550584290149466653899886088166091093E4),
+ L(1.073758321890334822002849369898232811561E5),
+ L(3.132840749205943137619839114451290324371E5),
+ L(4.607864939974100224615527007793867585915E5),
+ L(3.389781820105852303125270837910972384510E5),
+ L(1.174042187110565202875011358512564753399E5),
+ L(1.660013606011167144046604892622504338313E4),
+ L(6.700393957480661937695573729183733234400E2)
};
#define NRDr7 9
-static const long double RDr7[NRDr7 + 1] =
-{
--1.709305024718358874701575813642933561169E3L,
--3.280033887481333199580464617020514788369E4L,
--2.345284228022521885093072363418750835214E5L,
--8.086758123097763971926711729242327554917E5L,
--1.456900414510108718402423999575992450138E6L,
--1.391654264881255068392389037292702041855E6L,
--6.842360801869939983674527468509852583855E5L,
--1.597430214446573566179675395199807533371E5L,
--1.488876130609876681421645314851760773480E4L,
--3.511762950935060301403599443436465645703E2L
+static const _Float128 RDr7[NRDr7 + 1] =
+{
+L(-1.709305024718358874701575813642933561169E3),
+L(-3.280033887481333199580464617020514788369E4),
+L(-2.345284228022521885093072363418750835214E5),
+L(-8.086758123097763971926711729242327554917E5),
+L(-1.456900414510108718402423999575992450138E6),
+L(-1.391654264881255068392389037292702041855E6),
+L(-6.842360801869939983674527468509852583855E5),
+L(-1.597430214446573566179675395199807533371E5),
+L(-1.488876130609876681421645314851760773480E4),
+L(-3.511762950935060301403599443436465645703E2)
/* 1.0E0 */
};
@@ -546,32 +548,32 @@ static const long double RDr7[NRDr7 + 1] =
5/8 <= 1/x < 3/4
Peak relative error 1.9e-35 */
#define NRNr6 9
-static const long double RNr6[NRNr6 + 1] =
-{
- 1.642076876176834390623842732352935761108E0L,
- 1.207150003611117689000664385596211076662E2L,
- 2.119260779316389904742873816462800103939E3L,
- 1.562942227734663441801452930916044224174E4L,
- 5.656779189549710079988084081145693580479E4L,
- 1.052166241021481691922831746350942786299E5L,
- 9.949798524786000595621602790068349165758E4L,
- 4.491790734080265043407035220188849562856E4L,
- 8.377074098301530326270432059434791287601E3L,
- 4.506934806567986810091824791963991057083E2L
+static const _Float128 RNr6[NRNr6 + 1] =
+{
+ L(1.642076876176834390623842732352935761108E0),
+ L(1.207150003611117689000664385596211076662E2),
+ L(2.119260779316389904742873816462800103939E3),
+ L(1.562942227734663441801452930916044224174E4),
+ L(5.656779189549710079988084081145693580479E4),
+ L(1.052166241021481691922831746350942786299E5),
+ L(9.949798524786000595621602790068349165758E4),
+ L(4.491790734080265043407035220188849562856E4),
+ L(8.377074098301530326270432059434791287601E3),
+ L(4.506934806567986810091824791963991057083E2)
};
#define NRDr6 9
-static const long double RDr6[NRDr6 + 1] =
-{
--1.664557643928263091879301304019826629067E2L,
--3.800035902507656624590531122291160668452E3L,
--3.277028191591734928360050685359277076056E4L,
--1.381359471502885446400589109566587443987E5L,
--3.082204287382581873532528989283748656546E5L,
--3.691071488256738343008271448234631037095E5L,
--2.300482443038349815750714219117566715043E5L,
--6.873955300927636236692803579555752171530E4L,
--8.262158817978334142081581542749986845399E3L,
--2.517122254384430859629423488157361983661E2L
+static const _Float128 RDr6[NRDr6 + 1] =
+{
+L(-1.664557643928263091879301304019826629067E2),
+L(-3.800035902507656624590531122291160668452E3),
+L(-3.277028191591734928360050685359277076056E4),
+L(-1.381359471502885446400589109566587443987E5),
+L(-3.082204287382581873532528989283748656546E5),
+L(-3.691071488256738343008271448234631037095E5),
+L(-2.300482443038349815750714219117566715043E5),
+L(-6.873955300927636236692803579555752171530E4),
+L(-8.262158817978334142081581542749986845399E3),
+L(-2.517122254384430859629423488157361983661E2)
/* 1.00 */
};
@@ -579,33 +581,33 @@ static const long double RDr6[NRDr6 + 1] =
1/2 <= 1/x < 5/8
Peak relative error 4.6e-36 */
#define NRNr5 10
-static const long double RNr5[NRNr5 + 1] =
-{
--3.332258927455285458355550878136506961608E-3L,
--2.697100758900280402659586595884478660721E-1L,
--6.083328551139621521416618424949137195536E0L,
--6.119863528983308012970821226810162441263E1L,
--3.176535282475593173248810678636522589861E2L,
--8.933395175080560925809992467187963260693E2L,
--1.360019508488475978060917477620199499560E3L,
--1.075075579828188621541398761300910213280E3L,
--4.017346561586014822824459436695197089916E2L,
--5.857581368145266249509589726077645791341E1L,
--2.077715925587834606379119585995758954399E0L
+static const _Float128 RNr5[NRNr5 + 1] =
+{
+L(-3.332258927455285458355550878136506961608E-3),
+L(-2.697100758900280402659586595884478660721E-1),
+L(-6.083328551139621521416618424949137195536E0),
+L(-6.119863528983308012970821226810162441263E1),
+L(-3.176535282475593173248810678636522589861E2),
+L(-8.933395175080560925809992467187963260693E2),
+L(-1.360019508488475978060917477620199499560E3),
+L(-1.075075579828188621541398761300910213280E3),
+L(-4.017346561586014822824459436695197089916E2),
+L(-5.857581368145266249509589726077645791341E1),
+L(-2.077715925587834606379119585995758954399E0)
};
#define NRDr5 9
-static const long double RDr5[NRDr5 + 1] =
-{
- 3.377879570417399341550710467744693125385E-1L,
- 1.021963322742390735430008860602594456187E1L,
- 1.200847646592942095192766255154827011939E2L,
- 7.118915528142927104078182863387116942836E2L,
- 2.318159380062066469386544552429625026238E3L,
- 4.238729853534009221025582008928765281620E3L,
- 4.279114907284825886266493994833515580782E3L,
- 2.257277186663261531053293222591851737504E3L,
- 5.570475501285054293371908382916063822957E2L,
- 5.142189243856288981145786492585432443560E1L
+static const _Float128 RDr5[NRDr5 + 1] =
+{
+ L(3.377879570417399341550710467744693125385E-1),
+ L(1.021963322742390735430008860602594456187E1),
+ L(1.200847646592942095192766255154827011939E2),
+ L(7.118915528142927104078182863387116942836E2),
+ L(2.318159380062066469386544552429625026238E3),
+ L(4.238729853534009221025582008928765281620E3),
+ L(4.279114907284825886266493994833515580782E3),
+ L(2.257277186663261531053293222591851737504E3),
+ L(5.570475501285054293371908382916063822957E2),
+ L(5.142189243856288981145786492585432443560E1)
/* 1.0E0 */
};
@@ -613,34 +615,34 @@ static const long double RDr5[NRDr5 + 1] =
3/8 <= 1/x < 1/2
Peak relative error 2.0e-36 */
#define NRNr4 10
-static const long double RNr4[NRNr4 + 1] =
-{
- 3.258530712024527835089319075288494524465E-3L,
- 2.987056016877277929720231688689431056567E-1L,
- 8.738729089340199750734409156830371528862E0L,
- 1.207211160148647782396337792426311125923E2L,
- 8.997558632489032902250523945248208224445E2L,
- 3.798025197699757225978410230530640879762E3L,
- 9.113203668683080975637043118209210146846E3L,
- 1.203285891339933238608683715194034900149E4L,
- 8.100647057919140328536743641735339740855E3L,
- 2.383888249907144945837976899822927411769E3L,
- 2.127493573166454249221983582495245662319E2L
+static const _Float128 RNr4[NRNr4 + 1] =
+{
+ L(3.258530712024527835089319075288494524465E-3),
+ L(2.987056016877277929720231688689431056567E-1),
+ L(8.738729089340199750734409156830371528862E0),
+ L(1.207211160148647782396337792426311125923E2),
+ L(8.997558632489032902250523945248208224445E2),
+ L(3.798025197699757225978410230530640879762E3),
+ L(9.113203668683080975637043118209210146846E3),
+ L(1.203285891339933238608683715194034900149E4),
+ L(8.100647057919140328536743641735339740855E3),
+ L(2.383888249907144945837976899822927411769E3),
+ L(2.127493573166454249221983582495245662319E2)
};
#define NRDr4 10
-static const long double RDr4[NRDr4 + 1] =
-{
--3.303141981514540274165450687270180479586E-1L,
--1.353768629363605300707949368917687066724E1L,
--2.206127630303621521950193783894598987033E2L,
--1.861800338758066696514480386180875607204E3L,
--8.889048775872605708249140016201753255599E3L,
--2.465888106627948210478692168261494857089E4L,
--3.934642211710774494879042116768390014289E4L,
--3.455077258242252974937480623730228841003E4L,
--1.524083977439690284820586063729912653196E4L,
--2.810541887397984804237552337349093953857E3L,
--1.343929553541159933824901621702567066156E2L
+static const _Float128 RDr4[NRDr4 + 1] =
+{
+L(-3.303141981514540274165450687270180479586E-1),
+L(-1.353768629363605300707949368917687066724E1),
+L(-2.206127630303621521950193783894598987033E2),
+L(-1.861800338758066696514480386180875607204E3),
+L(-8.889048775872605708249140016201753255599E3),
+L(-2.465888106627948210478692168261494857089E4),
+L(-3.934642211710774494879042116768390014289E4),
+L(-3.455077258242252974937480623730228841003E4),
+L(-1.524083977439690284820586063729912653196E4),
+L(-2.810541887397984804237552337349093953857E3),
+L(-1.343929553541159933824901621702567066156E2)
/* 1.0E0 */
};
@@ -648,35 +650,35 @@ static const long double RDr4[NRDr4 + 1] =
1/4 <= 1/x < 3/8
Peak relative error 8.4e-37 */
#define NRNr3 11
-static const long double RNr3[NRNr3 + 1] =
-{
--1.952401126551202208698629992497306292987E-6L,
--2.130881743066372952515162564941682716125E-4L,
--8.376493958090190943737529486107282224387E-3L,
--1.650592646560987700661598877522831234791E-1L,
--1.839290818933317338111364667708678163199E0L,
--1.216278715570882422410442318517814388470E1L,
--4.818759344462360427612133632533779091386E1L,
--1.120994661297476876804405329172164436784E2L,
--1.452850765662319264191141091859300126931E2L,
--9.485207851128957108648038238656777241333E1L,
--2.563663855025796641216191848818620020073E1L,
--1.787995944187565676837847610706317833247E0L
+static const _Float128 RNr3[NRNr3 + 1] =
+{
+L(-1.952401126551202208698629992497306292987E-6),
+L(-2.130881743066372952515162564941682716125E-4),
+L(-8.376493958090190943737529486107282224387E-3),
+L(-1.650592646560987700661598877522831234791E-1),
+L(-1.839290818933317338111364667708678163199E0),
+L(-1.216278715570882422410442318517814388470E1),
+L(-4.818759344462360427612133632533779091386E1),
+L(-1.120994661297476876804405329172164436784E2),
+L(-1.452850765662319264191141091859300126931E2),
+L(-9.485207851128957108648038238656777241333E1),
+L(-2.563663855025796641216191848818620020073E1),
+L(-1.787995944187565676837847610706317833247E0)
};
#define NRDr3 10
-static const long double RDr3[NRDr3 + 1] =
-{
- 1.979130686770349481460559711878399476903E-4L,
- 1.156941716128488266238105813374635099057E-2L,
- 2.752657634309886336431266395637285974292E-1L,
- 3.482245457248318787349778336603569327521E0L,
- 2.569347069372696358578399521203959253162E1L,
- 1.142279000180457419740314694631879921561E2L,
- 3.056503977190564294341422623108332700840E2L,
- 4.780844020923794821656358157128719184422E2L,
- 4.105972727212554277496256802312730410518E2L,
- 1.724072188063746970865027817017067646246E2L,
- 2.815939183464818198705278118326590370435E1L
+static const _Float128 RDr3[NRDr3 + 1] =
+{
+ L(1.979130686770349481460559711878399476903E-4),
+ L(1.156941716128488266238105813374635099057E-2),
+ L(2.752657634309886336431266395637285974292E-1),
+ L(3.482245457248318787349778336603569327521E0),
+ L(2.569347069372696358578399521203959253162E1),
+ L(1.142279000180457419740314694631879921561E2),
+ L(3.056503977190564294341422623108332700840E2),
+ L(4.780844020923794821656358157128719184422E2),
+ L(4.105972727212554277496256802312730410518E2),
+ L(1.724072188063746970865027817017067646246E2),
+ L(2.815939183464818198705278118326590370435E1)
/* 1.0E0 */
};
@@ -684,35 +686,35 @@ static const long double RDr3[NRDr3 + 1] =
1/8 <= 1/x < 1/4
Peak relative error 1.5e-36 */
#define NRNr2 11
-static const long double RNr2[NRNr2 + 1] =
-{
--2.638914383420287212401687401284326363787E-8L,
--3.479198370260633977258201271399116766619E-6L,
--1.783985295335697686382487087502222519983E-4L,
--4.777876933122576014266349277217559356276E-3L,
--7.450634738987325004070761301045014986520E-2L,
--7.068318854874733315971973707247467326619E-1L,
--4.113919921935944795764071670806867038732E0L,
--1.440447573226906222417767283691888875082E1L,
--2.883484031530718428417168042141288943905E1L,
--2.990886974328476387277797361464279931446E1L,
--1.325283914915104866248279787536128997331E1L,
--1.572436106228070195510230310658206154374E0L
+static const _Float128 RNr2[NRNr2 + 1] =
+{
+L(-2.638914383420287212401687401284326363787E-8),
+L(-3.479198370260633977258201271399116766619E-6),
+L(-1.783985295335697686382487087502222519983E-4),
+L(-4.777876933122576014266349277217559356276E-3),
+L(-7.450634738987325004070761301045014986520E-2),
+L(-7.068318854874733315971973707247467326619E-1),
+L(-4.113919921935944795764071670806867038732E0),
+L(-1.440447573226906222417767283691888875082E1),
+L(-2.883484031530718428417168042141288943905E1),
+L(-2.990886974328476387277797361464279931446E1),
+L(-1.325283914915104866248279787536128997331E1),
+L(-1.572436106228070195510230310658206154374E0)
};
#define NRDr2 10
-static const long double RDr2[NRDr2 + 1] =
-{
- 2.675042728136731923554119302571867799673E-6L,
- 2.170997868451812708585443282998329996268E-4L,
- 7.249969752687540289422684951196241427445E-3L,
- 1.302040375859768674620410563307838448508E-1L,
- 1.380202483082910888897654537144485285549E0L,
- 8.926594113174165352623847870299170069350E0L,
- 3.521089584782616472372909095331572607185E1L,
- 8.233547427533181375185259050330809105570E1L,
- 1.072971579885803033079469639073292840135E2L,
- 6.943803113337964469736022094105143158033E1L,
- 1.775695341031607738233608307835017282662E1L
+static const _Float128 RDr2[NRDr2 + 1] =
+{
+ L(2.675042728136731923554119302571867799673E-6),
+ L(2.170997868451812708585443282998329996268E-4),
+ L(7.249969752687540289422684951196241427445E-3),
+ L(1.302040375859768674620410563307838448508E-1),
+ L(1.380202483082910888897654537144485285549E0),
+ L(8.926594113174165352623847870299170069350E0),
+ L(3.521089584782616472372909095331572607185E1),
+ L(8.233547427533181375185259050330809105570E1),
+ L(1.072971579885803033079469639073292840135E2),
+ L(6.943803113337964469736022094105143158033E1),
+ L(1.775695341031607738233608307835017282662E1)
/* 1.0E0 */
};
@@ -720,39 +722,39 @@ static const long double RDr2[NRDr2 + 1] =
1/128 <= 1/x < 1/8
Peak relative error 2.2e-36 */
#define NRNr1 9
-static const long double RNr1[NRNr1 + 1] =
-{
--4.250780883202361946697751475473042685782E-8L,
--5.375777053288612282487696975623206383019E-6L,
--2.573645949220896816208565944117382460452E-4L,
--6.199032928113542080263152610799113086319E-3L,
--8.262721198693404060380104048479916247786E-2L,
--6.242615227257324746371284637695778043982E-1L,
--2.609874739199595400225113299437099626386E0L,
--5.581967563336676737146358534602770006970E0L,
--5.124398923356022609707490956634280573882E0L,
--1.290865243944292370661544030414667556649E0L
+static const _Float128 RNr1[NRNr1 + 1] =
+{
+L(-4.250780883202361946697751475473042685782E-8),
+L(-5.375777053288612282487696975623206383019E-6),
+L(-2.573645949220896816208565944117382460452E-4),
+L(-6.199032928113542080263152610799113086319E-3),
+L(-8.262721198693404060380104048479916247786E-2),
+L(-6.242615227257324746371284637695778043982E-1),
+L(-2.609874739199595400225113299437099626386E0),
+L(-5.581967563336676737146358534602770006970E0),
+L(-5.124398923356022609707490956634280573882E0),
+L(-1.290865243944292370661544030414667556649E0)
};
#define NRDr1 8
-static const long double RDr1[NRDr1 + 1] =
-{
- 4.308976661749509034845251315983612976224E-6L,
- 3.265390126432780184125233455960049294580E-4L,
- 9.811328839187040701901866531796570418691E-3L,
- 1.511222515036021033410078631914783519649E-1L,
- 1.289264341917429958858379585970225092274E0L,
- 6.147640356182230769548007536914983522270E0L,
- 1.573966871337739784518246317003956180750E1L,
- 1.955534123435095067199574045529218238263E1L,
- 9.472613121363135472247929109615785855865E0L
+static const _Float128 RDr1[NRDr1 + 1] =
+{
+ L(4.308976661749509034845251315983612976224E-6),
+ L(3.265390126432780184125233455960049294580E-4),
+ L(9.811328839187040701901866531796570418691E-3),
+ L(1.511222515036021033410078631914783519649E-1),
+ L(1.289264341917429958858379585970225092274E0),
+ L(6.147640356182230769548007536914983522270E0),
+ L(1.573966871337739784518246317003956180750E1),
+ L(1.955534123435095067199574045529218238263E1),
+ L(9.472613121363135472247929109615785855865E0)
/* 1.0E0 */
};
-long double
-__erfl (long double x)
+_Float128
+__erfl (_Float128 x)
{
- long double a, y, z;
+ _Float128 a, y, z;
int32_t i, ix, sign;
ieee854_long_double_shape_type u;
@@ -763,7 +765,7 @@ __erfl (long double x)
if (ix >= 0x7fff0000)
{ /* erf(nan)=nan */
i = ((sign & 0xffff0000) >> 31) << 1;
- return (long double) (1 - i) + one / x; /* erf(+-inf)=+-1 */
+ return (_Float128) (1 - i) + one / x; /* erf(+-inf)=+-1 */
}
if (ix >= 0x3fff0000) /* |x| >= 1.0 */
@@ -784,7 +786,7 @@ __erfl (long double x)
if (ix < 0x00080000)
{
/* Avoid spurious underflow. */
- long double ret = 0.0625 * (16.0 * x + (16.0 * efx) * x);
+ _Float128 ret = 0.0625 * (16.0 * x + (16.0 * efx) * x);
math_check_force_underflow (ret);
return ret;
}
@@ -803,11 +805,11 @@ __erfl (long double x)
return( y );
}
-weak_alias (__erfl, erfl)
-long double
-__erfcl (long double x)
+libm_alias_ldouble (__erf, erf)
+_Float128
+__erfcl (_Float128 x)
{
- long double y, z, p, r;
+ _Float128 y, z, p, r;
int32_t i, ix, sign;
ieee854_long_double_shape_type u;
@@ -819,7 +821,7 @@ __erfcl (long double x)
if (ix >= 0x7fff0000)
{ /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
- return (long double) (((u_int32_t) sign >> 31) << 1) + one / x;
+ return (_Float128) (((uint32_t) sign >> 31) << 1) + one / x;
}
if (ix < 0x3ffd0000) /* |x| <1/4 */
@@ -835,48 +837,48 @@ __erfcl (long double x)
switch (i)
{
case 2:
- z = x - 0.25L;
+ z = x - L(0.25);
y = C13b + z * neval (z, RNr13, NRNr13) / deval (z, RDr13, NRDr13);
y += C13a;
break;
case 3:
- z = x - 0.375L;
+ z = x - L(0.375);
y = C14b + z * neval (z, RNr14, NRNr14) / deval (z, RDr14, NRDr14);
y += C14a;
break;
case 4:
- z = x - 0.5L;
+ z = x - L(0.5);
y = C15b + z * neval (z, RNr15, NRNr15) / deval (z, RDr15, NRDr15);
y += C15a;
break;
case 5:
- z = x - 0.625L;
+ z = x - L(0.625);
y = C16b + z * neval (z, RNr16, NRNr16) / deval (z, RDr16, NRDr16);
y += C16a;
break;
case 6:
- z = x - 0.75L;
+ z = x - L(0.75);
y = C17b + z * neval (z, RNr17, NRNr17) / deval (z, RDr17, NRDr17);
y += C17a;
break;
case 7:
- z = x - 0.875L;
+ z = x - L(0.875);
y = C18b + z * neval (z, RNr18, NRNr18) / deval (z, RDr18, NRDr18);
y += C18a;
break;
case 8:
- z = x - 1.0L;
+ z = x - 1;
y = C19b + z * neval (z, RNr19, NRNr19) / deval (z, RDr19, NRDr19);
y += C19a;
break;
default: /* i == 9. */
- z = x - 1.125L;
+ z = x - L(1.125);
y = C20b + z * neval (z, RNr20, NRNr20) / deval (z, RDr20, NRDr20);
y += C20a;
break;
}
if (sign & 0x80000000)
- y = 2.0L - y;
+ y = 2 - y;
return y;
}
/* 1.25 < |x| < 107 */
@@ -925,7 +927,7 @@ __erfcl (long double x)
__ieee754_expl ((z - x) * (z + x) + p);
if ((sign & 0x80000000) == 0)
{
- long double ret = r / x;
+ _Float128 ret = r / x;
if (ret == 0)
__set_errno (ERANGE);
return ret;
@@ -945,4 +947,4 @@ __erfcl (long double x)
}
}
-weak_alias (__erfcl, erfcl)
+libm_alias_ldouble (__erfc, erfc)
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index b1100a9d0e..66881af01a 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -57,41 +57,43 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
/* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x)
-.5 ln 2 < x < .5 ln 2
Theoretical peak relative error = 8.1e-36 */
-static const long double
- P0 = 2.943520915569954073888921213330863757240E8L,
- P1 = -5.722847283900608941516165725053359168840E7L,
- P2 = 8.944630806357575461578107295909719817253E6L,
- P3 = -7.212432713558031519943281748462837065308E5L,
- P4 = 4.578962475841642634225390068461943438441E4L,
- P5 = -1.716772506388927649032068540558788106762E3L,
- P6 = 4.401308817383362136048032038528753151144E1L,
- P7 = -4.888737542888633647784737721812546636240E-1L,
- Q0 = 1.766112549341972444333352727998584753865E9L,
- Q1 = -7.848989743695296475743081255027098295771E8L,
- Q2 = 1.615869009634292424463780387327037251069E8L,
- Q3 = -2.019684072836541751428967854947019415698E7L,
- Q4 = 1.682912729190313538934190635536631941751E6L,
- Q5 = -9.615511549171441430850103489315371768998E4L,
- Q6 = 3.697714952261803935521187272204485251835E3L,
- Q7 = -8.802340681794263968892934703309274564037E1L,
+static const _Float128
+ P0 = L(2.943520915569954073888921213330863757240E8),
+ P1 = L(-5.722847283900608941516165725053359168840E7),
+ P2 = L(8.944630806357575461578107295909719817253E6),
+ P3 = L(-7.212432713558031519943281748462837065308E5),
+ P4 = L(4.578962475841642634225390068461943438441E4),
+ P5 = L(-1.716772506388927649032068540558788106762E3),
+ P6 = L(4.401308817383362136048032038528753151144E1),
+ P7 = L(-4.888737542888633647784737721812546636240E-1),
+ Q0 = L(1.766112549341972444333352727998584753865E9),
+ Q1 = L(-7.848989743695296475743081255027098295771E8),
+ Q2 = L(1.615869009634292424463780387327037251069E8),
+ Q3 = L(-2.019684072836541751428967854947019415698E7),
+ Q4 = L(1.682912729190313538934190635536631941751E6),
+ Q5 = L(-9.615511549171441430850103489315371768998E4),
+ Q6 = L(3.697714952261803935521187272204485251835E3),
+ Q7 = L(-8.802340681794263968892934703309274564037E1),
/* Q8 = 1.000000000000000000000000000000000000000E0 */
/* C1 + C2 = ln 2 */
- C1 = 6.93145751953125E-1L,
- C2 = 1.428606820309417232121458176568075500134E-6L,
+ C1 = L(6.93145751953125E-1),
+ C2 = L(1.428606820309417232121458176568075500134E-6),
/* ln 2^-114 */
- minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e4932L;
+ minarg = L(-7.9018778583833765273564461846232128760607E1), big = L(1e4932);
-long double
-__expm1l (long double x)
+_Float128
+__expm1l (_Float128 x)
{
- long double px, qx, xx;
+ _Float128 px, qx, xx;
int32_t ix, sign;
ieee854_long_double_shape_type u;
int k;
@@ -110,9 +112,9 @@ __expm1l (long double x)
{
/* Infinity (which must be negative infinity). */
if (((ix & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
- return -1.0L;
- /* NaN. No invalid exception. */
- return x;
+ return -1;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
@@ -121,12 +123,12 @@ __expm1l (long double x)
/* Minimum value. */
if (x < minarg)
- return (4.0/big - 1.0L);
+ return (4.0/big - 1);
/* Avoid internal underflow when result does not underflow, while
ensuring underflow (without returning a zero of the wrong sign)
when the result does underflow. */
- if (fabsl (x) < 0x1p-113L)
+ if (fabsl (x) < L(0x1p-113))
{
math_check_force_underflow (x);
return x;
@@ -158,9 +160,9 @@ __expm1l (long double x)
exp(x) - 1 = 2^k (qx + 1) - 1
= 2^k qx + 2^k - 1. */
- px = __ldexpl (1.0L, k);
+ px = __ldexpl (1, k);
x = px * qx + (px - 1.0);
return x;
}
libm_hidden_def (__expm1l)
-weak_alias (__expm1l, expm1l)
+libm_alias_ldouble (__expm1, expm1)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c b/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c
new file mode 100644
index 0000000000..545c7b93fd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xaddf128.c
@@ -0,0 +1,38 @@
+/* Add _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xaddf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_ADD_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_ADD_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c b/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c
new file mode 100644
index 0000000000..64356bbdd7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xdivf128.c
@@ -0,0 +1,38 @@
+/* Divide _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xdivf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_DIV_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_DIV_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c b/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c
new file mode 100644
index 0000000000..ed88eabe40
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xmulf128.c
@@ -0,0 +1,38 @@
+/* Multiply _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xmulf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_MUL_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_MUL_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c b/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c
new file mode 100644
index 0000000000..c9a63d9e84
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_f64xsubf128.c
@@ -0,0 +1,38 @@
+/* Subtract _Float128 values, converting the result to _Float64x.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+/* math_ldbl.h defines _Float128 to long double for this directory,
+ but when they are different, this function must be defined with
+ _Float128 arguments to avoid defining an alias with an incompatible
+ type. */
+#undef _Float128
+
+_Float64x
+__f64xsubf128 (_Float128 x, _Float128 y)
+{
+#if __HAVE_FLOAT64X_LONG_DOUBLE && __HAVE_DISTINCT_FLOAT128
+ NARROW_SUB_ROUND_TO_ODD (x, y, _Float64x, union ieee854_long_double, l,
+ mantissa3);
+#else
+ NARROW_SUB_TRIVIAL (x, y, _Float64x);
+#endif
+}
+libm_alias_float64x_float128 (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c
index a1bb6c5dff..8d554531be 100644
--- a/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -23,12 +23,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __fabsl(long double x)
+_Float128 __fabsl(_Float128 x)
{
- u_int64_t hx;
+ uint64_t hx;
GET_LDOUBLE_MSW64(hx,x);
SET_LDOUBLE_MSW64(x,hx&0x7fffffffffffffffLL);
return x;
}
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/ieee754/ldbl-128/s_faddl.c b/sysdeps/ieee754/ldbl-128/s_faddl.c
new file mode 100644
index 0000000000..edbaa2103b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_faddl.c
@@ -0,0 +1,33 @@
+/* Add long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <math.h>
+#undef f32addf64x
+#undef f32addf128
+
+#include <math-narrow.h>
+
+float
+__faddl (_Float128 x, _Float128 y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128/s_fdivl.c b/sysdeps/ieee754/ldbl-128/s_fdivl.c
new file mode 100644
index 0000000000..b00fdb4eaa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fdivl.c
@@ -0,0 +1,33 @@
+/* Divide long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <math.h>
+#undef f32divf64x
+#undef f32divf128
+
+#include <math-narrow.h>
+
+float
+__fdivl (_Float128 x, _Float128 y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index ea8a9ba379..d42b37815c 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -25,12 +25,12 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __finitel(long double x)
+int __finitel(_Float128 x)
{
int64_t hx;
GET_LDOUBLE_MSW64(hx,x);
- return (int)((u_int64_t)((hx&0x7fff000000000000LL)
- -0x7fff000000000000LL)>>63);
+ return (int)((uint64_t)((hx&0x7fff000000000000LL)
+ -0x7fff000000000000LL)>>63);
}
-hidden_def (__finitel)
+mathx_hidden_def (__finitel)
weak_alias (__finitel, finitel)
diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c
index c72d5d4330..f9c5e014f9 100644
--- a/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -22,35 +22,29 @@ static char rcsid[] = "$NetBSD: $";
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
- * Exception:
- * Inexact flag raised if x not equal to floor(x).
*/
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0e4930L;
-
-long double __floorl(long double x)
+_Float128 __floorl(_Float128 x)
{
int64_t i0,i1,j0;
- u_int64_t i,j;
+ uint64_t i,j;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<48) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0>=0) {i0=i1=0;}
- else if(((i0&0x7fffffffffffffffLL)|i1)!=0)
- { i0=0xbfff000000000000ULL;i1=0;}
- }
+ if(j0<0) {
+ /* return 0*sign(x) if |x|<1 */
+ if(i0>=0) {i0=i1=0;}
+ else if(((i0&0x7fffffffffffffffLL)|i1)!=0)
+ { i0=0xbfff000000000000ULL;i1=0;}
} else {
i = (0x0000ffffffffffffULL)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) i0 += (0x0001000000000000LL)>>j0;
- i0 &= (~i); i1=0;
- }
+ if(i0<0) i0 += (0x0001000000000000LL)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>111) {
if(j0==0x4000) return x+x; /* inf or NaN */
@@ -58,19 +52,17 @@ long double __floorl(long double x)
} else {
i = -1ULL>>(j0-48);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) {
- if(j0==48) i0+=1;
- else {
- j = i1+(1LL<<(112-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
+ if(i0<0) {
+ if(j0==48) i0+=1;
+ else {
+ j = i1+(1LL<<(112-j0));
+ if(j<i1) i0 +=1 ; /* got a carry */
+ i1=j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
SET_LDOUBLE_WORDS64(x,i0,i1);
return x;
}
-weak_alias (__floorl, floorl)
+libm_alias_ldouble (__floor, floor)
diff --git a/sysdeps/ieee754/ldbl-128/s_fma.c b/sysdeps/ieee754/ldbl-128/s_fma.c
index cbe708f4b8..19620dca5c 100644
--- a/sysdeps/ieee754/ldbl-128/s_fma.c
+++ b/sysdeps/ieee754/ldbl-128/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -20,6 +20,7 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <libm-alias-double.h>
/* This implementation relies on long double being more than twice as
precise as double and uses rounding to odd in order to avoid problems
@@ -51,5 +52,5 @@ __fma (double x, double y, double z)
return (double) u.d;
}
#ifndef __fma
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index 728949c916..4eba9253df 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,15 +21,17 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
double rounding. See a paper by Boldo and Melquiond:
http://www.lri.fr/~melquion/doc/08-tc.pdf */
-long double
-__fmal (long double x, long double y, long double z)
+_Float128
+__fmal (_Float128 x, _Float128 y, _Float128 z)
{
union ieee854_long_double u, v, w;
int adjust = 0;
@@ -75,7 +77,7 @@ __fmal (long double x, long double y, long double z)
< IEEE854_LONG_DOUBLE_BIAS - LDBL_MANT_DIG - 2)
{
int neg = u.ieee.negative ^ v.ieee.negative;
- long double tiny = neg ? -0x1p-16494L : 0x1p-16494L;
+ _Float128 tiny = neg ? L(-0x1p-16494) : L(0x1p-16494);
if (w.ieee.exponent >= 3)
return tiny + z;
/* Scaling up, adding TINY and scaling down produces the
@@ -83,7 +85,7 @@ __fmal (long double x, long double y, long double z)
TINY has no effect and in other modes double rounding is
harmless. But it may not produce required underflow
exceptions. */
- v.d = z * 0x1p114L + tiny;
+ v.d = z * L(0x1p114) + tiny;
if (TININESS_AFTER_ROUNDING
? v.ieee.exponent < 115
: (w.ieee.exponent == 0
@@ -94,10 +96,10 @@ __fmal (long double x, long double y, long double z)
&& w.ieee.mantissa1 == 0
&& w.ieee.mantissa0 == 0)))
{
- long double force_underflow = x * y;
+ _Float128 force_underflow = x * y;
math_force_eval (force_underflow);
}
- return v.d * 0x1p-114L;
+ return v.d * L(0x1p-114);
}
if (u.ieee.exponent + v.ieee.exponent
>= 0x7fff + IEEE854_LONG_DOUBLE_BIAS - LDBL_MANT_DIG)
@@ -144,7 +146,7 @@ __fmal (long double x, long double y, long double z)
if (v.ieee.exponent)
v.ieee.exponent += LDBL_MANT_DIG;
else
- v.d *= 0x1p113L;
+ v.d *= L(0x1p113);
}
else if (v.ieee.exponent >= 0x7fff - LDBL_MANT_DIG)
{
@@ -152,7 +154,7 @@ __fmal (long double x, long double y, long double z)
if (u.ieee.exponent)
u.ieee.exponent += LDBL_MANT_DIG;
else
- u.d *= 0x1p113L;
+ u.d *= L(0x1p113);
}
else /* if (u.ieee.exponent + v.ieee.exponent
<= IEEE854_LONG_DOUBLE_BIAS + LDBL_MANT_DIG) */
@@ -166,7 +168,7 @@ __fmal (long double x, long double y, long double z)
if (w.ieee.exponent)
w.ieee.exponent += 2 * LDBL_MANT_DIG + 2;
else
- w.d *= 0x1p228L;
+ w.d *= L(0x1p228);
adjust = -1;
}
/* Otherwise x * y should just affect inexact
@@ -190,22 +192,22 @@ __fmal (long double x, long double y, long double z)
/* Multiplication m1 + m2 = x * y using Dekker's algorithm. */
#define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
- long double m1 = x * y;
+ _Float128 x1 = x * C;
+ _Float128 y1 = y * C;
+ _Float128 m1 = x * y;
x1 = (x - x1) + x1;
y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- long double m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
+ _Float128 x2 = x - x1;
+ _Float128 y2 = y - y1;
+ _Float128 m2 = (((x1 * y1 - m1) + x1 * y2) + x2 * y1) + x2 * y2;
/* Addition a1 + a2 = z + m1 using Knuth's algorithm. */
- long double a1 = z + m1;
- long double t1 = a1 - z;
- long double t2 = a1 - t1;
+ _Float128 a1 = z + m1;
+ _Float128 t1 = a1 - z;
+ _Float128 t2 = a1 - t1;
t1 = m1 - t1;
t2 = z - t2;
- long double a2 = t1 + t2;
+ _Float128 a2 = t1 + t2;
/* Ensure the arithmetic is not scheduled after feclearexcept call. */
math_force_eval (m2);
math_force_eval (a2);
@@ -238,7 +240,7 @@ __fmal (long double x, long double y, long double z)
u.ieee.mantissa3 |= fetestexcept (FE_INEXACT) != 0;
feupdateenv (&env);
/* Result is a1 + u.d, scaled up. */
- return (a1 + u.d) * 0x1p113L;
+ return (a1 + u.d) * L(0x1p113);
}
else
{
@@ -255,11 +257,11 @@ __fmal (long double x, long double y, long double z)
/* If a1 + u.d is exact, the only rounding happens during
scaling down. */
if (j == 0)
- return v.d * 0x1p-228L;
+ return v.d * L(0x1p-228);
/* If result rounded to zero is not subnormal, no double
rounding will occur. */
if (v.ieee.exponent > 228)
- return (a1 + u.d) * 0x1p-228L;
+ return (a1 + u.d) * L(0x1p-228);
/* If v.d * 0x1p-228L with round to zero is a subnormal above
or equal to LDBL_MIN / 2, then v.d * 0x1p-228L shifts mantissa
down just by 1 bit, which means v.ieee.mantissa3 |= j would
@@ -278,21 +280,21 @@ __fmal (long double x, long double y, long double z)
{
w.d = a1 + u.d;
if (w.ieee.exponent == 229)
- return w.d * 0x1p-228L;
+ return w.d * L(0x1p-228);
}
/* v.ieee.mantissa3 & 2 is LSB bit of the result before rounding,
v.ieee.mantissa3 & 1 is the round bit and j is our sticky
bit. */
- w.d = 0.0L;
+ w.d = 0;
w.ieee.mantissa3 = ((v.ieee.mantissa3 & 3) << 1) | j;
w.ieee.negative = v.ieee.negative;
v.ieee.mantissa3 &= ~3U;
- v.d *= 0x1p-228L;
- w.d *= 0x1p-2L;
+ v.d *= L(0x1p-228);
+ w.d *= L(0x1p-2);
return v.d + w.d;
}
v.ieee.mantissa3 |= j;
- return v.d * 0x1p-228L;
+ return v.d * L(0x1p-228);
}
}
-weak_alias (__fmal, fmal)
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/ldbl-128/s_fmull.c b/sysdeps/ieee754/ldbl-128/s_fmull.c
new file mode 100644
index 0000000000..dd399f9590
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fmull.c
@@ -0,0 +1,33 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <math.h>
+#undef f32mulf64x
+#undef f32mulf128
+
+#include <math-narrow.h>
+
+float
+__fmull (_Float128 x, _Float128 y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
index c89686f8f9..6deaa5cc45 100644
--- a/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,9 +24,9 @@
int
-__fpclassifyl (long double x)
+__fpclassifyl (_Float128 x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS64 (hx, lx, x);
diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c
index d61dddaaaa..bab0779e23 100644
--- a/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -29,17 +29,18 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L; /* 0x4071000000000000, 0 */
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34); /* 0x4071000000000000, 0 */
-long double __frexpl(long double x, int *eptr)
+_Float128 __frexpl(_Float128 x, int *eptr)
{
- u_int64_t hx, lx, ix;
+ uint64_t hx, lx, ix;
GET_LDOUBLE_WORDS64(hx,lx,x);
ix = 0x7fffffffffffffffULL&hx;
*eptr = 0;
- if(ix>=0x7fff000000000000ULL||((ix|lx)==0)) return x; /* 0,inf,nan */
+ if(ix>=0x7fff000000000000ULL||((ix|lx)==0)) return x + x;/* 0,inf,nan */
if (ix<0x0001000000000000ULL) { /* subnormal */
x *= two114;
GET_LDOUBLE_MSW64(hx,x);
@@ -51,4 +52,4 @@ long double __frexpl(long double x, int *eptr)
SET_LDOUBLE_MSW64(x,hx);
return x;
}
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl.c b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
new file mode 100644
index 0000000000..bcedceea8e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
new file mode 100644
index 0000000000..5b9c1a84b2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
@@ -0,0 +1,91 @@
+/* Round to integer type. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 113
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (_Float128 x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ bool negative = (hx & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ hx &= 0x7fffffffffffffffULL;
+ if ((hx | lx) == 0)
+ return 0;
+ int exponent = hx >> (MANT_DIG - 1 - 64);
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ hx &= ((1ULL << (MANT_DIG - 1 - 64)) - 1);
+ hx |= 1ULL << (MANT_DIG - 1 - 64);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ /* The exponent is at most 63, so we are shifting right by at least
+ 49 bits. */
+ if (exponent >= -1)
+ {
+ int shift = MANT_DIG - 1 - exponent;
+ if (shift <= 64)
+ {
+ uint64_t h = 1ULL << (shift - 1);
+ half_bit = (lx & h) != 0;
+ more_bits = (lx & (h - 1)) != 0;
+ uret = hx << (64 - shift);
+ if (shift != 64)
+ uret |= lx >> shift;
+ }
+ else
+ {
+ uint64_t h = 1ULL << (shift - 1 - 64);
+ half_bit = (hx & h) != 0;
+ more_bits = ((hx & (h - 1)) | lx) != 0;
+ uret = hx >> (shift - 64);
+ }
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
new file mode 100644
index 0000000000..0a342a22d1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/ldbl-128/s_fsubl.c b/sysdeps/ieee754/ldbl-128/s_fsubl.c
new file mode 100644
index 0000000000..6a5e6b3173
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_fsubl.c
@@ -0,0 +1,33 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <math.h>
+#undef f32subf64x
+#undef f32subf128
+
+#include <math-narrow.h>
+
+float
+__fsubl (_Float128 x, _Float128 y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa3);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
new file mode 100644
index 0000000000..3bdc429de6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
@@ -0,0 +1,59 @@
+/* Get NaN payload. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdint.h>
+
+_Float128
+__getpayloadl (const _Float128 *x)
+{
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, *x);
+ hx &= 0x7fffffffffffULL;
+ /* Construct the representation of the return value directly, since
+ 128-bit integers may not be available. */
+ int lz;
+ if (hx == 0)
+ {
+ if (lx == 0)
+ return 0.0L;
+ else
+ lz = __builtin_clzll (lx) + 64;
+ }
+ else
+ lz = __builtin_clzll (hx);
+ int shift = lz - 15;
+ if (shift >= 64)
+ {
+ hx = lx << (shift - 64);
+ lx = 0;
+ }
+ else
+ {
+ /* 2 <= SHIFT <= 63. */
+ hx = (hx << shift) | (lx >> (64 - shift));
+ lx <<= shift;
+ }
+ hx = (hx & 0xffffffffffffULL) | ((0x3fffULL + 127 - lz) << 48);
+ _Float128 ret;
+ SET_LDOUBLE_WORDS64 (ret, hx, lx);
+ return ret;
+}
+libm_alias_ldouble (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index 03e4d13371..a41e8cf44b 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -17,7 +17,7 @@ static char rcsid[] = "$NetBSD: $";
#include <math_private.h>
int
-__isinfl (long double x)
+__isinfl (_Float128 x)
{
int64_t hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
@@ -25,5 +25,5 @@ __isinfl (long double x)
lx |= -lx;
return ~(lx >> 63) & (hx >> 62);
}
-hidden_def (__isinfl)
+mathx_hidden_def (__isinfl)
weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 74960e7ff2..8ebef00d24 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -25,14 +25,14 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-int __isnanl(long double x)
+int __isnanl(_Float128 x)
{
int64_t hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
hx &= 0x7fffffffffffffffLL;
- hx |= (u_int64_t)(lx|(-lx))>>63;
+ hx |= (uint64_t)(lx|(-lx))>>63;
hx = 0x7fff000000000000LL - hx;
- return (int)((u_int64_t)hx>>63);
+ return (int)((uint64_t)hx>>63);
}
-hidden_def (__isnanl)
+mathx_hidden_def (__isnanl)
weak_alias (__isnanl, isnanl)
diff --git a/sysdeps/ieee754/ldbl-128/s_issignalingl.c b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
index c06f14dd12..1893e80293 100644
--- a/sysdeps/ieee754/ldbl-128/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
-__issignalingl (long double x)
+__issignalingl (_Float128 x)
{
- u_int64_t hxi, lxi __attribute__ ((unused));
+ uint64_t hxi, lxi __attribute__ ((unused));
GET_LDOUBLE_WORDS64 (hxi, lxi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
used to designate infinity. */
diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c
index 84fc576ab6..ce17cf962a 100644
--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,21 +24,22 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <fix-fp-int-convert-overflow.h>
-static const long double two112[2] =
+static const _Float128 two112[2] =
{
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
long long int
-__llrintl (long double x)
+__llrintl (_Float128 x)
{
int32_t j0;
- u_int64_t i0,i1;
- long double w;
- long double t;
+ uint64_t i0,i1;
+ _Float128 w;
+ _Float128 t;
long long int result;
int sx;
@@ -52,7 +53,7 @@ __llrintl (long double x)
{
#if defined FE_INVALID || defined FE_INEXACT
/* X < LLONG_MAX + 1 implied by J0 < 63. */
- if (x > (long double) LLONG_MAX)
+ if (x > (_Float128) LLONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -83,8 +84,8 @@ __llrintl (long double x)
FE_INVALID must be raised and the return value is
unspecified. */
#if defined FE_INVALID || defined FE_INEXACT
- if (x < (long double) LLONG_MIN
- && x > (long double) LLONG_MIN - 1.0L)
+ if (x < (_Float128) LLONG_MIN
+ && x > (_Float128) LLONG_MIN - 1)
{
/* If truncation produces LLONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -92,7 +93,7 @@ __llrintl (long double x)
feraiseexcept (t == LLONG_MIN ? FE_INEXACT : FE_INVALID);
return LLONG_MIN;
}
- else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (long double) LLONG_MIN)
+ else if (FIX_LDBL_LLONG_CONVERT_OVERFLOW && x != (_Float128) LLONG_MIN)
{
feraiseexcept (FE_INVALID);
return sx == 0 ? LLONG_MAX : LLONG_MIN;
@@ -105,4 +106,4 @@ __llrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index bfc81cc534..1973e1bffd 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -23,13 +23,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <fix-fp-int-convert-overflow.h>
long long int
-__llroundl (long double x)
+__llroundl (_Float128 x)
{
int64_t j0;
- u_int64_t i1, i0;
+ uint64_t i1, i0;
long long int result;
int sign;
@@ -55,7 +56,7 @@ __llroundl (long double x)
result = ((long long int) i0 << (j0 - 48)) | (i1 << (j0 - 112));
else
{
- u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
+ uint64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
if (j < i1)
++i0;
@@ -79,13 +80,13 @@ __llroundl (long double x)
unspecified. */
#ifdef FE_INVALID
if (FIX_LDBL_LLONG_CONVERT_OVERFLOW
- && !(sign == -1 && x > (long double) LLONG_MIN - 0.5L))
+ && !(sign == -1 && x > (_Float128) LLONG_MIN - L(0.5)))
{
feraiseexcept (FE_INVALID);
return sign == 1 ? LLONG_MAX : LLONG_MIN;
}
else if (!FIX_LDBL_LLONG_CONVERT_OVERFLOW
- && x <= (long double) LLONG_MIN - 0.5L)
+ && x <= (_Float128) LLONG_MIN - L(0.5))
{
/* If truncation produces LLONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -99,4 +100,4 @@ __llroundl (long double x)
return sign * result;
}
-weak_alias (__llroundl, llroundl)
+libm_alias_ldouble (__llround, llround)
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index b348f41e55..f3181dbc8e 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -56,39 +56,40 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
/* Coefficients for log(1+x) = x - x^2 / 2 + x^3 P(x)/Q(x)
* 1/sqrt(2) <= 1+x < sqrt(2)
* Theoretical peak relative error = 5.3e-37,
* relative peak error spread = 2.3e-14
*/
-static const long double
- P12 = 1.538612243596254322971797716843006400388E-6L,
- P11 = 4.998469661968096229986658302195402690910E-1L,
- P10 = 2.321125933898420063925789532045674660756E1L,
- P9 = 4.114517881637811823002128927449878962058E2L,
- P8 = 3.824952356185897735160588078446136783779E3L,
- P7 = 2.128857716871515081352991964243375186031E4L,
- P6 = 7.594356839258970405033155585486712125861E4L,
- P5 = 1.797628303815655343403735250238293741397E5L,
- P4 = 2.854829159639697837788887080758954924001E5L,
- P3 = 3.007007295140399532324943111654767187848E5L,
- P2 = 2.014652742082537582487669938141683759923E5L,
- P1 = 7.771154681358524243729929227226708890930E4L,
- P0 = 1.313572404063446165910279910527789794488E4L,
+static const _Float128
+ P12 = L(1.538612243596254322971797716843006400388E-6),
+ P11 = L(4.998469661968096229986658302195402690910E-1),
+ P10 = L(2.321125933898420063925789532045674660756E1),
+ P9 = L(4.114517881637811823002128927449878962058E2),
+ P8 = L(3.824952356185897735160588078446136783779E3),
+ P7 = L(2.128857716871515081352991964243375186031E4),
+ P6 = L(7.594356839258970405033155585486712125861E4),
+ P5 = L(1.797628303815655343403735250238293741397E5),
+ P4 = L(2.854829159639697837788887080758954924001E5),
+ P3 = L(3.007007295140399532324943111654767187848E5),
+ P2 = L(2.014652742082537582487669938141683759923E5),
+ P1 = L(7.771154681358524243729929227226708890930E4),
+ P0 = L(1.313572404063446165910279910527789794488E4),
/* Q12 = 1.000000000000000000000000000000000000000E0L, */
- Q11 = 4.839208193348159620282142911143429644326E1L,
- Q10 = 9.104928120962988414618126155557301584078E2L,
- Q9 = 9.147150349299596453976674231612674085381E3L,
- Q8 = 5.605842085972455027590989944010492125825E4L,
- Q7 = 2.248234257620569139969141618556349415120E5L,
- Q6 = 6.132189329546557743179177159925690841200E5L,
- Q5 = 1.158019977462989115839826904108208787040E6L,
- Q4 = 1.514882452993549494932585972882995548426E6L,
- Q3 = 1.347518538384329112529391120390701166528E6L,
- Q2 = 7.777690340007566932935753241556479363645E5L,
- Q1 = 2.626900195321832660448791748036714883242E5L,
- Q0 = 3.940717212190338497730839731583397586124E4L;
+ Q11 = L(4.839208193348159620282142911143429644326E1),
+ Q10 = L(9.104928120962988414618126155557301584078E2),
+ Q9 = L(9.147150349299596453976674231612674085381E3),
+ Q8 = L(5.605842085972455027590989944010492125825E4),
+ Q7 = L(2.248234257620569139969141618556349415120E5),
+ Q6 = L(6.132189329546557743179177159925690841200E5),
+ Q5 = L(1.158019977462989115839826904108208787040E6),
+ Q4 = L(1.514882452993549494932585972882995548426E6),
+ Q3 = L(1.347518538384329112529391120390701166528E6),
+ Q2 = L(7.777690340007566932935753241556479363645E5),
+ Q1 = L(2.626900195321832660448791748036714883242E5),
+ Q0 = L(3.940717212190338497730839731583397586124E4);
/* Coefficients for log(x) = z + z^3 P(z^2)/Q(z^2),
* where z = 2(x-1)/(x+1)
@@ -96,33 +97,33 @@ static const long double
* Theoretical peak relative error = 1.1e-35,
* relative peak error spread 1.1e-9
*/
-static const long double
- R5 = -8.828896441624934385266096344596648080902E-1L,
- R4 = 8.057002716646055371965756206836056074715E1L,
- R3 = -2.024301798136027039250415126250455056397E3L,
- R2 = 2.048819892795278657810231591630928516206E4L,
- R1 = -8.977257995689735303686582344659576526998E4L,
- R0 = 1.418134209872192732479751274970992665513E5L,
+static const _Float128
+ R5 = L(-8.828896441624934385266096344596648080902E-1),
+ R4 = L(8.057002716646055371965756206836056074715E1),
+ R3 = L(-2.024301798136027039250415126250455056397E3),
+ R2 = L(2.048819892795278657810231591630928516206E4),
+ R1 = L(-8.977257995689735303686582344659576526998E4),
+ R0 = L(1.418134209872192732479751274970992665513E5),
/* S6 = 1.000000000000000000000000000000000000000E0L, */
- S5 = -1.186359407982897997337150403816839480438E2L,
- S4 = 3.998526750980007367835804959888064681098E3L,
- S3 = -5.748542087379434595104154610899551484314E4L,
- S2 = 4.001557694070773974936904547424676279307E5L,
- S1 = -1.332535117259762928288745111081235577029E6L,
- S0 = 1.701761051846631278975701529965589676574E6L;
+ S5 = L(-1.186359407982897997337150403816839480438E2),
+ S4 = L(3.998526750980007367835804959888064681098E3),
+ S3 = L(-5.748542087379434595104154610899551484314E4),
+ S2 = L(4.001557694070773974936904547424676279307E5),
+ S1 = L(-1.332535117259762928288745111081235577029E6),
+ S0 = L(1.701761051846631278975701529965589676574E6);
/* C1 + C2 = ln 2 */
-static const long double C1 = 6.93145751953125E-1L;
-static const long double C2 = 1.428606820309417232121458176568075500134E-6L;
+static const _Float128 C1 = L(6.93145751953125E-1);
+static const _Float128 C2 = L(1.428606820309417232121458176568075500134E-6);
-static const long double sqrth = 0.7071067811865475244008443621048490392848L;
+static const _Float128 sqrth = L(0.7071067811865475244008443621048490392848);
/* ln (2^16384 * (1 - 2^-113)) */
-static const long double zero = 0.0L;
+static const _Float128 zero = 0;
-long double
-__log1pl (long double xm1)
+_Float128
+__log1pl (_Float128 xm1)
{
- long double x, y, z, r, s;
+ _Float128 x, y, z, r, s;
ieee854_long_double_shape_type u;
int32_t hx;
int e;
@@ -145,16 +146,16 @@ __log1pl (long double xm1)
return xm1;
}
- if (xm1 >= 0x1p113L)
+ if (xm1 >= L(0x1p113))
x = xm1;
else
- x = xm1 + 1.0L;
+ x = xm1 + 1;
/* log1p(-1) = -inf */
- if (x <= 0.0L)
+ if (x <= 0)
{
- if (x == 0.0L)
- return (-1.0L / zero); /* log1p(-1) = -inf */
+ if (x == 0)
+ return (-1 / zero); /* log1p(-1) = -inf */
else
return (zero / (x - x));
}
@@ -171,14 +172,14 @@ __log1pl (long double xm1)
if (x < sqrth)
{ /* 2( 2x-1 )/( 2x+1 ) */
e -= 1;
- z = x - 0.5L;
- y = 0.5L * z + 0.5L;
+ z = x - L(0.5);
+ y = L(0.5) * z + L(0.5);
}
else
{ /* 2 (x-1)/(x+1) */
- z = x - 0.5L;
- z -= 0.5L;
- y = 0.5L * x + 0.5L;
+ z = x - L(0.5);
+ z -= L(0.5);
+ y = L(0.5) * x + L(0.5);
}
x = z / y;
z = x * x;
@@ -209,14 +210,14 @@ __log1pl (long double xm1)
{
e -= 1;
if (e != 0)
- x = 2.0L * x - 1.0L; /* 2x - 1 */
+ x = 2 * x - 1; /* 2x - 1 */
else
x = xm1;
}
else
{
if (e != 0)
- x = x - 1.0L;
+ x = x - 1;
else
x = xm1;
}
@@ -249,7 +250,7 @@ __log1pl (long double xm1)
+ Q0;
y = x * (z * r / s);
y = y + e * C2;
- z = y - 0.5L * z;
+ z = y - L(0.5) * z;
z = z + x;
z = z + e * C1;
return (z);
diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c
index 3ba67b7bd2..9264fe6616 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -25,16 +25,17 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double
-__logbl (long double x)
+_Float128
+__logbl (_Float128 x)
{
int64_t lx, hx, ex;
GET_LDOUBLE_WORDS64 (hx, lx, x);
hx &= 0x7fffffffffffffffLL; /* high |x| */
if ((hx | lx) == 0)
- return -1.0 / fabs (x);
+ return -1.0 / fabsl (x);
if (hx >= 0x7fff000000000000LL)
return x * x;
if ((ex = hx >> 48) == 0) /* IEEE 754 logb */
@@ -48,7 +49,7 @@ __logbl (long double x)
ma = __builtin_clzll (hx);
ex -= ma - 16;
}
- return (long double) (ex - 16383);
+ return (_Float128) (ex - 16383);
}
-weak_alias (__logbl, logbl)
+libm_alias_ldouble (__logb, logb)
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 23f828f862..c1233a45dc 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -24,21 +24,22 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <fix-fp-int-convert-overflow.h>
-static const long double two112[2] =
+static const _Float128 two112[2] =
{
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
long int
-__lrintl (long double x)
+__lrintl (_Float128 x)
{
int32_t j0;
- u_int64_t i0,i1;
- long double w;
- long double t;
+ uint64_t i0,i1;
+ _Float128 w;
+ _Float128 t;
long int result;
int sx;
@@ -55,7 +56,7 @@ __lrintl (long double x)
#if defined FE_INVALID || defined FE_INEXACT
/* X < LONG_MAX + 1 implied by J0 < 31. */
if (sizeof (long int) == 4
- && x > (long double) LONG_MAX)
+ && x > (_Float128) LONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -82,7 +83,7 @@ __lrintl (long double x)
#if defined FE_INVALID || defined FE_INEXACT
/* X < LONG_MAX + 1 implied by J0 < 63. */
if (sizeof (long int) == 8
- && x > (long double) LONG_MAX)
+ && x > (_Float128) LONG_MAX)
{
/* In the event of overflow we must raise the "invalid"
exception, but not "inexact". */
@@ -112,8 +113,8 @@ __lrintl (long double x)
FE_INVALID must be raised and the return value is
unspecified. */
#if defined FE_INVALID || defined FE_INEXACT
- if (x < (long double) LONG_MIN
- && x > (long double) LONG_MIN - 1.0L)
+ if (x < (_Float128) LONG_MIN
+ && x > (_Float128) LONG_MIN - 1)
{
/* If truncation produces LONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -121,7 +122,7 @@ __lrintl (long double x)
feraiseexcept (t == LONG_MIN ? FE_INEXACT : FE_INVALID);
return LONG_MIN;
}
- else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (long double) LONG_MIN)
+ else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (_Float128) LONG_MIN)
{
feraiseexcept (FE_INVALID);
return sx == 0 ? LONG_MAX : LONG_MIN;
@@ -134,4 +135,4 @@ __lrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index f03262543f..f109157d67 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -23,13 +23,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <fix-fp-int-convert-overflow.h>
long int
-__lroundl (long double x)
+__lroundl (_Float128 x)
{
int64_t j0;
- u_int64_t i1, i0;
+ uint64_t i1, i0;
long int result;
int sign;
@@ -62,7 +63,7 @@ __lroundl (long double x)
result = ((long int) i0 << (j0 - 48)) | (i1 << (j0 - 112));
else
{
- u_int64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
+ uint64_t j = i1 + (0x8000000000000000ULL >> (j0 - 48));
if (j < i1)
++i0;
@@ -88,13 +89,13 @@ __lroundl (long double x)
unspecified. */
#ifdef FE_INVALID
if (FIX_LDBL_LONG_CONVERT_OVERFLOW
- && !(sign == -1 && x > (long double) LONG_MIN - 0.5L))
+ && !(sign == -1 && x > (_Float128) LONG_MIN - L(0.5)))
{
feraiseexcept (FE_INVALID);
return sign == 1 ? LONG_MAX : LONG_MIN;
}
else if (!FIX_LDBL_LONG_CONVERT_OVERFLOW
- && x <= (long double) LONG_MIN - 0.5L)
+ && x <= (_Float128) LONG_MIN - L(0.5))
{
/* If truncation produces LONG_MIN, the cast will not raise
the exception, but may raise "inexact". */
@@ -110,4 +111,4 @@ __lroundl (long double x)
return sign * result;
}
-weak_alias (__lroundl, lroundl)
+libm_alias_ldouble (__lround, lround)
diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c
index 597a5c9a0c..2d0a2d739f 100644
--- a/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -29,13 +29,14 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double one = 1.0;
+static const _Float128 one = 1.0;
-long double __modfl(long double x, long double *iptr)
+_Float128 __modfl(_Float128 x, _Float128 *iptr)
{
int64_t i0,i1,j0;
- u_int64_t i;
+ uint64_t i;
GET_LDOUBLE_WORDS64(i0,i1,x);
j0 = ((i0>>48)&0x7fff)-0x3fff; /* exponent of x */
if(j0<48) { /* integer part in high x */
@@ -76,4 +77,4 @@ long double __modfl(long double x, long double *iptr)
}
}
}
-weak_alias (__modfl, modfl)
+libm_alias_ldouble (__modf, modf)
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index 2017c04207..f044cb4334 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -25,27 +25,29 @@
#include <fenv.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double
+static const _Float128
TWO112[2]={
- 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
+ L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */
+ L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */
};
-long double __nearbyintl(long double x)
+_Float128 __nearbyintl(_Float128 x)
{
fenv_t env;
int64_t i0,j0,sx;
- u_int64_t i1 __attribute__ ((unused));
- long double w,t;
+ uint64_t i1 __attribute__ ((unused));
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
- sx = (((u_int64_t)i0)>>63);
+ sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<112) {
if(j0<0) {
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);
@@ -58,10 +60,10 @@ long double __nearbyintl(long double x)
else return x; /* x is integral */
}
feholdexcept (&env);
- w = TWO112[sx]+x;
+ w = TWO112[sx] + math_opt_barrier (x);
t = w-TWO112[sx];
math_force_eval (t);
fesetenv (&env);
return t;
}
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 4e9a2ce520..60fdae648f 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -26,12 +26,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __nextafterl(long double x, long double y)
+_Float128 __nextafterl(_Float128 x, _Float128 y)
{
int64_t hx,hy,ix,iy;
- u_int64_t lx,ly;
+ uint64_t lx,ly;
GET_LDOUBLE_WORDS64(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -43,7 +45,7 @@ long double __nextafterl(long double x, long double y)
return x+y;
if(x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
- long double u;
+ _Float128 u;
SET_LDOUBLE_WORDS64(x,hy&0x8000000000000000ULL,1);/* return +-minsubnormal */
u = math_opt_barrier (x);
u = u * u;
@@ -69,18 +71,18 @@ long double __nextafterl(long double x, long double y)
}
hy = hx&0x7fff000000000000LL;
if(hy==0x7fff000000000000LL) {
- long double u = x + x; /* overflow */
+ _Float128 u = x + x; /* overflow */
math_force_eval (u);
__set_errno (ERANGE);
}
if(hy==0) {
- long double u = x*x; /* underflow */
+ _Float128 u = x*x; /* underflow */
math_force_eval (u); /* raise underflow flag */
__set_errno (ERANGE);
}
SET_LDOUBLE_WORDS64(x,hx,lx);
return x;
}
-weak_alias (__nextafterl, nextafterl)
+libm_alias_ldouble (__nextafter, nextafter)
strong_alias (__nextafterl, __nexttowardl)
weak_alias (__nextafterl, nexttowardl)
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttoward.c b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
index 4343fe83f8..6db8b7f15f 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttoward.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
@@ -34,8 +35,8 @@ double __nexttoward(double x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
- u_int32_t lx;
- u_int64_t ly;
+ uint32_t lx;
+ uint64_t ly;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -49,7 +50,7 @@ double __nexttoward(double x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */
double u;
- INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
+ INSERT_WORDS(x,(uint32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
index 8703359d4f..7840cb382e 100644
--- a/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128/s_nexttowardf.c
@@ -20,13 +20,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
float __nexttowardf(float x, long double y)
{
int32_t hx,ix;
int64_t hy,iy;
- u_int64_t ly;
+ uint64_t ly;
GET_FLOAT_WORD(hx,x);
GET_LDOUBLE_WORDS64(hy,ly,y);
@@ -40,7 +41,7 @@ float __nexttowardf(float x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128/s_nextupl.c b/sysdeps/ieee754/ldbl-128/s_nextupl.c
new file mode 100644
index 0000000000..20827e6d09
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_nextupl.c
@@ -0,0 +1,58 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+
+/* Return the least floating-point number greater than X. */
+_Float128
+__nextupl (_Float128 x)
+{
+ int64_t hx, ix;
+ uint64_t lx;
+
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ ix = hx & 0x7fffffffffffffffLL;
+
+ /* x is nan. */
+ if (((ix >= 0x7fff000000000000LL)
+ && ((ix - 0x7fff000000000000LL) | lx) != 0))
+ return x + x;
+ if ((ix | lx) == 0)
+ return LDBL_TRUE_MIN;
+ if (hx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx++;
+ if (lx == 0)
+ hx++;
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ hx--;
+ lx--;
+ }
+ SET_LDOUBLE_WORDS64 (x, hx, lx);
+ return x;
+}
+
+libm_alias_ldouble (__nextup, nextup)
diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c
index 7356f5f4ef..2fcea6ecdf 100644
--- a/sysdeps/ieee754/ldbl-128/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,16 +21,17 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double zero = 0.0;
+static const _Float128 zero = 0.0;
-long double
-__remquol (long double x, long double y, int *quo)
+_Float128
+__remquol (_Float128 x, _Float128 y, int *quo)
{
int64_t hx,hy;
- u_int64_t sx,lx,ly,qs;
+ uint64_t sx,lx,ly,qs;
int cquo;
GET_LDOUBLE_WORDS64 (hx, lx, x);
@@ -87,7 +88,7 @@ __remquol (long double x, long double y, int *quo)
}
else
{
- long double y_half = 0.5L * y;
+ _Float128 y_half = L(0.5) * y;
if (x > y_half)
{
x -= y;
@@ -103,10 +104,10 @@ __remquol (long double x, long double y, int *quo)
*quo = qs ? -cquo : cquo;
/* Ensure correct sign of zero result in round-downward mode. */
- if (x == 0.0L)
- x = 0.0L;
+ if (x == 0)
+ x = 0;
if (sx)
x = -x;
return x;
}
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index ae2142b2c9..9e6637a225 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -29,20 +29,21 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double
+static const _Float128
TWO112[2]={
5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
-5.19229685853482762853049632922009600E+33L /* 0xC06F000000000000, 0 */
};
-long double __rintl(long double x)
+_Float128 __rintl(_Float128 x)
{
int64_t i0,j0,sx;
- u_int64_t i1 __attribute__ ((unused));
- long double w,t;
+ uint64_t i1 __attribute__ ((unused));
+ _Float128 w,t;
GET_LDOUBLE_WORDS64(i0,i1,x);
- sx = (((u_int64_t)i0)>>63);
+ sx = (((uint64_t)i0)>>63);
j0 = ((i0>>48)&0x7fff)-0x3fff;
if(j0<112) {
if(j0<0) {
@@ -59,4 +60,4 @@ long double __rintl(long double x)
w = TWO112[sx]+x;
return w-TWO112[sx];
}
-weak_alias (__rintl, rintl)
+libm_alias_ldouble (__rint, rint)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundevenl.c b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
new file mode 100644
index 0000000000..5fc59af4ee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
@@ -0,0 +1,104 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 113
+#define MAX_EXP (2 * BIAS + 1)
+
+_Float128
+__roundevenl (_Float128 x)
+{
+ uint64_t hx, lx, uhx;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ uhx = hx & 0x7fffffffffffffffULL;
+ int exponent = uhx >> (MANT_DIG - 1 - 64);
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 64)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* Carry into the exponent works correctly. No need to test
+ whether HALF_BIT is set. */
+ lx += half_bit;
+ hx += lx < half_bit;
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 65)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffffffffffffULL)) != 0)
+ {
+ lx += 0x8000000000000000ULL;
+ hx += lx < 0x8000000000000000ULL;
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1 (when the unbiased exponent is 0, the bit with
+ exponent 0 is implicit, but as the bias is odd it is OK to
+ take it from the low bit of the exponent). */
+ int int_pos = (BIAS + MANT_DIG - 65) - exponent;
+ int half_pos = int_pos - 1;
+ uint64_t half_bit = 1ULL << half_pos;
+ uint64_t int_bit = 1ULL << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ hx += half_bit;
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (uhx > 0x3ffe000000000000ULL || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ hx = (hx & 0x8000000000000000ULL) | 0x3fff000000000000ULL;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ hx &= 0x8000000000000000ULL;
+ lx = 0;
+ }
+ SET_LDOUBLE_WORDS64 (x, hx, lx);
+ return x;
+}
+libm_alias_ldouble (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c
index 98b448e4f3..22789cedf3 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundl.c
@@ -1,5 +1,5 @@
/* Round long double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,16 +21,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-static const long double huge = 1.0E4930L;
-
-
-long double
-__roundl (long double x)
+_Float128
+__roundl (_Float128 x)
{
int32_t j0;
- u_int64_t i1, i0;
+ uint64_t i1, i0;
GET_LDOUBLE_WORDS64 (i0, i1, x);
j0 = ((i0 >> 48) & 0x7fff) - 0x3fff;
@@ -38,27 +36,21 @@ __roundl (long double x)
{
if (j0 < 0)
{
- if (huge + x > 0.0)
- {
- i0 &= 0x8000000000000000ULL;
- if (j0 == -1)
- i0 |= 0x3fff000000000000LL;
- i1 = 0;
- }
+ i0 &= 0x8000000000000000ULL;
+ if (j0 == -1)
+ i0 |= 0x3fff000000000000LL;
+ i1 = 0;
}
else
{
- u_int64_t i = 0x0000ffffffffffffLL >> j0;
+ uint64_t i = 0x0000ffffffffffffLL >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- i0 += 0x0000800000000000LL >> j0;
- i0 &= ~i;
- i1 = 0;
- }
+
+ i0 += 0x0000800000000000LL >> j0;
+ i0 &= ~i;
+ i1 = 0;
}
}
else if (j0 > 111)
@@ -71,23 +63,19 @@ __roundl (long double x)
}
else
{
- u_int64_t i = -1ULL >> (j0 - 48);
+ uint64_t i = -1ULL >> (j0 - 48);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- u_int64_t j = i1 + (1LL << (111 - j0));
- if (j < i1)
- i0 += 1;
- i1 = j;
- }
+ uint64_t j = i1 + (1LL << (111 - j0));
+ if (j < i1)
+ i0 += 1;
+ i1 = j;
i1 &= ~i;
}
SET_LDOUBLE_WORDS64 (x, i0, i1);
return x;
}
-weak_alias (__roundl, roundl)
+libm_alias_ldouble (__round, round)
diff --git a/sysdeps/ieee754/ldbl-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
index 1e24197c63..5864eaf93c 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalblnl.c
@@ -28,13 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
-twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
-huge = 1.0E+4900L,
-tiny = 1.0E-4900L;
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34), /* 0x4071000000000000, 0 */
+twom114 = L(4.8148248609680896326399448564623183E-35), /* 0x3F8D000000000000, 0 */
+huge = L(1.0E+4900),
+tiny = L(1.0E-4900);
-long double __scalblnl (long double x, long int n)
+_Float128 __scalblnl (_Float128 x, long int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
index a5cbd0d9d2..e6fe796079 100644
--- a/sysdeps/ieee754/ldbl-128/s_scalbnl.c
+++ b/sysdeps/ieee754/ldbl-128/s_scalbnl.c
@@ -28,13 +28,13 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
-static const long double
-two114 = 2.0769187434139310514121985316880384E+34L, /* 0x4071000000000000, 0 */
-twom114 = 4.8148248609680896326399448564623183E-35L, /* 0x3F8D000000000000, 0 */
-huge = 1.0E+4900L,
-tiny = 1.0E-4900L;
+static const _Float128
+two114 = L(2.0769187434139310514121985316880384E+34), /* 0x4071000000000000, 0 */
+twom114 = L(4.8148248609680896326399448564623183E-35), /* 0x3F8D000000000000, 0 */
+huge = L(1.0E+4900),
+tiny = L(1.0E-4900);
-long double __scalbnl (long double x, int n)
+_Float128 __scalbnl (_Float128 x, int n)
{
int64_t k,hx,lx;
GET_LDOUBLE_WORDS64(hx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
new file mode 100644
index 0000000000..9f43c259ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
new file mode 100644
index 0000000000..bb3fc8d9fb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
@@ -0,0 +1,70 @@
+/* Set NaN payload. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3fff
+#define PAYLOAD_DIG 111
+#define EXPLICIT_MANT_DIG 112
+
+int
+FUNC (_Float128 *x, _Float128 payload)
+{
+ uint64_t hx, lx;
+ GET_LDOUBLE_WORDS64 (hx, lx, payload);
+ int exponent = hx >> (EXPLICIT_MANT_DIG - 64);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0 && lx == 0)))
+ {
+ SET_LDOUBLE_WORDS64 (*x, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 64
+ ? (lx & ((1ULL << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1ULL << (shift - 64)) - 1)) != 0))
+ {
+ SET_LDOUBLE_WORDS64 (*x, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ hx &= (1ULL << (EXPLICIT_MANT_DIG - 64)) - 1;
+ hx |= 1ULL << (EXPLICIT_MANT_DIG - 64);
+ if (shift >= 64)
+ {
+ lx = hx >> (shift - 64);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (64 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x7fff000000000000ULL | (SET_HIGH_BIT ? 0x800000000000ULL : 0);
+ SET_LDOUBLE_WORDS64 (*x, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
new file mode 100644
index 0000000000..cd82f295aa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/ldbl-128/s_signbitl.c b/sysdeps/ieee754/ldbl-128/s_signbitl.c
index ee5d77e27a..1aa93f709d 100644
--- a/sysdeps/ieee754/ldbl-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -18,9 +18,10 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
int
-__signbitl (long double x)
+__signbitl (_Float128 x)
{
return __builtin_signbitl (x);
}
diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c
index 1abdb4419e..dfcb0be301 100644
--- a/sysdeps/ieee754/ldbl-128/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>.
@@ -22,9 +22,10 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
void
-__sincosl (long double x, long double *sinx, long double *cosx)
+__sincosl (_Float128 x, _Float128 *sinx, _Float128 *cosx)
{
int64_t ix;
@@ -34,7 +35,7 @@ __sincosl (long double x, long double *sinx, long double *cosx)
/* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL;
if (ix <= 0x3ffe921fb54442d1LL)
- __kernel_sincosl (x, 0.0L, sinx, cosx, 0);
+ __kernel_sincosl (x, 0, sinx, cosx, 0);
else if (ix >= 0x7fff000000000000LL)
{
/* sin(Inf or NaN) is NaN */
@@ -45,7 +46,7 @@ __sincosl (long double x, long double *sinx, long double *cosx)
else
{
/* Argument reduction needed. */
- long double y[2];
+ _Float128 y[2];
int n;
n = __ieee754_rem_pio2l (x, y);
@@ -70,4 +71,4 @@ __sincosl (long double x, long double *sinx, long double *cosx)
}
}
}
-weak_alias (__sincosl, sincosl)
+libm_alias_ldouble (__sincos, sincos)
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 582a53fd7a..773b2fa7ee 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __sinl(long double x)
+_Float128 __sinl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
@@ -83,4 +84,4 @@ long double __sinl(long double x)
}
}
}
-weak_alias (__sinl, sinl)
+libm_alias_ldouble (__sin, sin)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanhl.c b/sysdeps/ieee754/ldbl-128/s_tanhl.c
index f7a1d20f79..fc309dab0a 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -44,14 +44,16 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
-static const long double one = 1.0, two = 2.0, tiny = 1.0e-4900L;
+static const _Float128 one = 1.0, two = 2.0, tiny = L(1.0e-4900);
-long double
-__tanhl (long double x)
+_Float128
+__tanhl (_Float128 x)
{
- long double t, z;
- u_int32_t jx, ix;
+ _Float128 t, z;
+ uint32_t jx, ix;
ieee854_long_double_shape_type u;
/* Words of |x|. */
@@ -97,4 +99,4 @@ __tanhl (long double x)
}
return (jx & 0x80000000) ? -z : z;
}
-weak_alias (__tanhl, tanhl)
+libm_alias_ldouble (__tanh, tanh)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index c7d637402b..77db10f077 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -47,10 +47,11 @@
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double __tanl(long double x)
+_Float128 __tanl(_Float128 x)
{
- long double y[2],z=0.0L;
+ _Float128 y[2],z=0;
int64_t n, ix;
/* High word of x. */
@@ -77,4 +78,4 @@ long double __tanl(long double x)
-1 -- n odd */
}
}
-weak_alias (__tanl, tanl)
+libm_alias_ldouble (__tan, tan)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalorderl.c b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
new file mode 100644
index 0000000000..080c9597b9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
@@ -0,0 +1,56 @@
+/* Total order operation. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorderl (_Float128 x, _Float128 y)
+{
+ int64_t hx, hy;
+ uint64_t lx, ly;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ GET_LDOUBLE_WORDS64 (hy, ly, y);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ uint64_t uhx = hx & 0x7fffffffffffffffULL;
+ uint64_t uhy = hy & 0x7fffffffffffffffULL;
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the arguments interpreted as
+ sign-magnitude integers. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((uhx > 0x7fff000000000000ULL || (uhx == 0x7fff000000000000ULL
+ && lx != 0))
+ && (uhy > 0x7fff000000000000ULL || (uhy == 0x7fff000000000000ULL
+ && ly != 0)))
+ {
+ hx ^= 0x0000800000000000ULL;
+ hy ^= 0x0000800000000000ULL;
+ }
+#endif
+ uint64_t hx_sign = hx >> 63;
+ uint64_t hy_sign = hy >> 63;
+ hx ^= hx_sign >> 1;
+ lx ^= hx_sign;
+ hy ^= hy_sign >> 1;
+ ly ^= hy_sign;
+ return hx < hy || (hx == hy && lx <= ly);
+}
+libm_alias_ldouble (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
new file mode 100644
index 0000000000..642c48e8f5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
@@ -0,0 +1,50 @@
+/* Total order operation on absolute values. ldbl-128 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagl (_Float128 x, _Float128 y)
+{
+ uint64_t hx, hy;
+ uint64_t lx, ly;
+ GET_LDOUBLE_WORDS64 (hx, lx, x);
+ GET_LDOUBLE_WORDS64 (hy, ly, y);
+ hx &= 0x7fffffffffffffffULL;
+ hy &= 0x7fffffffffffffffULL;
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* For the preferred quiet NaN convention, this operation is a
+ comparison of the representations of the absolute values of the
+ arguments. If both arguments are NaNs, invert the
+ quiet/signaling bit so comparing that way works. */
+ if ((hx > 0x7fff000000000000ULL || (hx == 0x7fff000000000000ULL
+ && lx != 0))
+ && (hy > 0x7fff000000000000ULL || (hy == 0x7fff000000000000ULL
+ && ly != 0)))
+ {
+ hx ^= 0x0000800000000000ULL;
+ hy ^= 0x0000800000000000ULL;
+ }
+#endif
+ return hx < hy || (hx == hy && lx <= ly);
+}
+libm_alias_ldouble (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c
index c71f0aba92..f858ede3d2 100644
--- a/sysdeps/ieee754/ldbl-128/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128/s_truncl.c
@@ -1,5 +1,5 @@
/* Truncate argument to nearest integral value not larger than the argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -21,13 +21,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
-long double
-__truncl (long double x)
+_Float128
+__truncl (_Float128 x)
{
int32_t j0;
- u_int64_t i0, i1, sx;
+ uint64_t i0, i1, sx;
GET_LDOUBLE_WORDS64 (i0, i1, x);
sx = i0 & 0x8000000000000000ULL;
@@ -53,4 +54,4 @@ __truncl (long double x)
return x;
}
-weak_alias (__truncl, truncl)
+libm_alias_ldouble (__trunc, trunc)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
new file mode 100644
index 0000000000..22935e6ef7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
new file mode 100644
index 0000000000..77a5423de8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-128/strtold_l.c b/sysdeps/ieee754/ldbl-128/strtold_l.c
index 12ccd93ee5..4b72ae1e33 100644
--- a/sysdeps/ieee754/ldbl-128/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-128/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,34 @@
#define MPN2FLOAT __mpn_construct_long_double
#define FLOAT_HUGE_VAL HUGE_VALL
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define strtof128_l __hide_strtof128_l
+# define wcstof128_l __hide_wcstof128_l
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <strtod_l.c>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# undef strtof128_l
+# undef wcstof128_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof128_l)
+# else
+weak_alias (strtold_l, strtof128_l)
+# endif
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-128/t_expl.h b/sysdeps/ieee754/ldbl-128/t_expl.h
index a23d3d9344..b386fc1f54 100644
--- a/sysdeps/ieee754/ldbl-128/t_expl.h
+++ b/sysdeps/ieee754/ldbl-128/t_expl.h
@@ -1,5 +1,5 @@
/* Accurate table for expl().
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -29,942 +29,942 @@
__expl_table[T_EXPL_ARGN+2*i] == i/S+s
where absl(s) <= 2^-54 and absl(r) <= 2^-212. */
-static const long double __expl_table [] = {
- -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
- 6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
- -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
- -7.16021898043268093462818380603370350E-33L, /* bf94296c8219427edc1431ac2498583e */
- -3.39843750000000013418643523138766329E-01L, /* bffd5c000000000003de1f027a30e000 */
- 8.16920774283317801641347327589583265E-32L, /* 3f97a82b65774bdca1b4440d749ed8d3 */
- -3.35937500000000014998092453039303051E-01L, /* bffd5800000000000452a9f4d8857000 */
- -6.55865578425428447938248396879359670E-32L, /* bf97548b7d240f3d034b395e6eecfac8 */
- -3.32031250000000000981984049529998541E-01L, /* bffd540000000000004875277cda5000 */
- 6.91213046334032232108944519541512737E-32L, /* 3f9766e5f925338a19045c94443b66e1 */
- -3.28124999999999986646017645350399708E-01L, /* bffd4ffffffffffffc26a667bf44d000 */
- -6.16281060996110316602421505683742661E-32L, /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
- -3.24218749999999991645717430645867963E-01L, /* bffd4bfffffffffffd97901063e48000 */
- -7.90797211087760527593856542417304137E-32L, /* bf979a9afaaca1ada6a8ed1c80584d60 */
- -3.20312499999999998918211610690789652E-01L, /* bffd47ffffffffffffb02d9856d71000 */
- 8.64024799457616856987630373786503376E-32L, /* 3f97c0a098623f95579d5d9b2b67342d */
- -3.16406249999999998153974811017181883E-01L, /* bffd43ffffffffffff77c991f1076000 */
- -2.73176610180696076418536105483668404E-32L, /* bf961baeccb32f9b1fcbb8e60468e95a */
- -3.12500000000000011420976192575972779E-01L, /* bffd400000000000034ab8240483d000 */
- 7.16573502812389453744433792609989420E-32L, /* 3f977410f4c2cfc4335f28446c0fb363 */
- -3.08593750000000001735496343854851414E-01L, /* bffd3c000000000000800e995c176000 */
- -1.56292999645122272621237565671593071E-32L, /* bf95449b9cbdaff6ac1246adb2c826ac */
- -3.04687499999999982592401295899221626E-01L, /* bffd37fffffffffffafb8bc1e061a000 */
- 6.48993208584888904958594509625158417E-32L, /* 3f9750f9fe8366d82d77afa0031a92e1 */
- -3.00781249999999999230616898937763959E-01L, /* bffd33ffffffffffffc73ac39da54000 */
- 6.57082437496961397305801409357792029E-32L, /* 3f97552d3cb598ea80135cf3feb27ec4 */
- -2.96874999999999998788769281703245722E-01L, /* bffd2fffffffffffffa6a07fa5021000 */
- -3.26588297198283968096426564544269170E-32L, /* bf9653260fc1802f46b629aee171809b */
- -2.92968750000000015318089182805941695E-01L, /* bffd2c0000000000046a468614bd6000 */
- -1.73291974845198589684358727559290718E-32L, /* bf9567e9d158f52e483c8d8dcb5961dd */
- -2.89062500000000007736778942676309681E-01L, /* bffd280000000000023adf9f4c3d3000 */
- -6.83629745986675744404029225571026236E-32L, /* bf9762f5face6281c1daf1c6aedbdb45 */
- -2.85156250000000001367091555763661937E-01L, /* bffd2400000000000064dfa11e3fb000 */
- -5.44898442619766878281110054067026237E-32L, /* bf971aed6d2db9f542986a785edae072 */
- -2.81249999999999986958718100227029406E-01L, /* bffd1ffffffffffffc3db9265ca9d000 */
- 1.13007318374506125723591889451107046E-32L, /* 3f94d569fe387f456a97902907ac3856 */
- -2.77343750000000000356078829380495179E-01L, /* bffd1c0000000000001a462390083000 */
- -4.98979365468978332358409063436543102E-32L, /* bf970315bbf3e0d14b5c94c900702d4c */
- -2.73437499999999990276993957508540484E-01L, /* bffd17fffffffffffd32919bcdc94000 */
- -8.79390484115892344533724650295100871E-32L, /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
- -2.69531250000000002434203866460082225E-01L, /* bffd14000000000000b39ccf9e130000 */
- 9.44060754687026590886751809927191596E-32L, /* 3f97ea2f32cfecca5c64a26137a9210f */
- -2.65624999999999997296320716986257179E-01L, /* bffd0fffffffffffff3880f13a2bc000 */
- 2.07142664067265697791007875348396921E-32L, /* 3f95ae37ee685b9122fbe377bd205ee4 */
- -2.61718750000000010237478733739017956E-01L, /* bffd0c000000000002f3648179d40000 */
- -6.10552936159265665298996309192680256E-32L, /* bf973d0467d31e407515a3cca0f3b4e2 */
- -2.57812500000000011948220522778370303E-01L, /* bffd08000000000003719f81275bd000 */
- 6.72477169058908902499239631466443836E-32L, /* 3f975d2b8c475d3160cf72d227d8e6f9 */
- -2.53906249999999991822993360536596860E-01L, /* bffd03fffffffffffda4a4b62f818000 */
- -2.44868296623215865054704392917190994E-32L, /* bf95fc92516c6d057d29fc2528855976 */
- -2.49999999999999986862019457428548084E-01L, /* bffcfffffffffffff86d2d20d5ff4000 */
- -3.85302898949105073614122724961613078E-32L, /* bf96901f147cb7d643af71b6129ce929 */
- -2.46093750000000000237554160737318435E-01L, /* bffcf8000000000000230e8ade26b000 */
- -1.52823675242678363494345369284988589E-32L, /* bf953d6700c5f3fc303f79d0ec8c680a */
- -2.42187500000000003023380963205457065E-01L, /* bffcf0000000000001be2c1a78bb0000 */
- -7.78402037952209709489481182714311699E-34L, /* bf9102ab1f3998e887f0ee4cf940faa5 */
- -2.38281249999999995309623303145485725E-01L, /* bffce7fffffffffffd4bd2940f43f000 */
- -3.54307216794236899443913216397197696E-32L, /* bf966fef03ab69c3f289436205b21d02 */
- -2.34374999999999998425804947623207526E-01L, /* bffcdfffffffffffff17b097a6092000 */
- -2.86038428948386602859761879407549696E-32L, /* bf96290a0eba0131efe3a05fe188f2e3 */
- -2.30468749999999993822207406785200832E-01L, /* bffcd7fffffffffffc70519834eae000 */
- -2.54339521031747516806893838749365762E-32L, /* bf96081f0ad7f9107ae6cddb32c178ab */
- -2.26562499999999997823524030344489884E-01L, /* bffccffffffffffffebecf10093df000 */
- 4.31904611473158635644635628922959401E-32L, /* 3f96c083f0b1faa7c4c686193e38d67c */
- -2.22656250000000004835132405125162742E-01L, /* bffcc8000000000002c98a233f19f000 */
- 2.54709791629335691650310168420597566E-33L, /* 3f92a735903f5eed07a716ab931e20d9 */
- -2.18749999999999988969454021829236626E-01L, /* bffcbffffffffffff9a42dc14ce36000 */
- -3.77236096429336082213752014054909454E-32L, /* bf9687be8e5b2fca54d3e81157eac660 */
- -2.14843750000000010613256919115758495E-01L, /* bffcb80000000000061e3d828ecac000 */
- -4.55194148712216691177097854305964738E-32L, /* bf96d8b35c776aa3e1a4768271380503 */
- -2.10937499999999993204656148110447201E-01L, /* bffcaffffffffffffc152f2aea118000 */
- -2.95044199165561453749332254271716417E-32L, /* bf96326433b00b2439094d9bef22ddd1 */
- -2.07031250000000012233944895423355677E-01L, /* bffca80000000000070d695ee0e94000 */
- 1.93146788688385419095981415411012357E-32L, /* 3f959126729135a5e390d4bb802a0bde */
- -2.03125000000000008030983633336321863E-01L, /* bffca0000000000004a129fbc51af000 */
- 2.37361904671826193563212931215900137E-32L, /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
- -1.99218750000000001763815712796132779E-01L, /* bffc98000000000001044b12d9950000 */
- -3.63171243370923753295192486732883239E-33L, /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
- -1.95312500000000004883660234506677272E-01L, /* bffc90000000000002d0b3779d1f9000 */
- -3.19989507343607877747980892249711601E-33L, /* bf9309d63de96bb3ef744c865f22f1bd */
- -1.91406250000000013720152363227519348E-01L, /* bffc88000000000007e8bcb387121000 */
- -1.89295754093147174148371614722178860E-32L, /* bf958926e2e67dfe812c508290add2e7 */
- -1.87500000000000000182342082774432620E-01L, /* bffc800000000000001ae8b06a39f000 */
- -2.96812835183184815200854214892983927E-32L, /* bf96343a62d156bbe71f55d14ca4b6e5 */
- -1.83593750000000012410147185883290345E-01L, /* bffc78000000000007276a1adda8d000 */
- -2.02191931237489669058466239995304587E-32L, /* bf95a3efab92d26ec2df90df036a117f */
- -1.79687499999999997439177363346082917E-01L, /* bffc6ffffffffffffe8616db2927d000 */
- -9.92752326937775530007399526834009465E-33L, /* bf949c5f88ed17041e1a3f1829d543cd */
- -1.75781249999999995824373974504785174E-01L, /* bffc67fffffffffffd97c94f13ea3000 */
- 1.44184772065335613487885714828816178E-32L, /* 3f952b75c63476e7fcc2f5841c27bcce */
- -1.71874999999999986685050259043077809E-01L, /* bffc5ffffffffffff8530f6bc531a000 */
- -3.49007014971241147689894940544402482E-32L, /* bf966a6dfaa012aea8ffe6d90b02330f */
- -1.67968749999999997316058782350439701E-01L, /* bffc57fffffffffffe73eb914f2aa000 */
- 3.34025733574205019081305778794376391E-32L, /* 3f965adf4572561fd5456a6c13d8babf */
- -1.64062499999999993322730602128318480E-01L, /* bffc4ffffffffffffc269be4f68f3000 */
- -1.83345916769684984022099095506340635E-32L, /* bf957ccb69026cb2f6024c211576d5f4 */
- -1.60156249999999992419000744447607979E-01L, /* bffc47fffffffffffba13df21784a000 */
- 2.73442789798110494773517431626534726E-32L, /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
- -1.56249999999999987665010524130393080E-01L, /* bffc3ffffffffffff8e3ad45e7508000 */
- 2.02695576464836145806428118889332191E-32L, /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
- -1.52343749999999989905291167951491803E-01L, /* bffc37fffffffffffa2e48aecfc24000 */
- -3.61436631548815190395331054871041524E-32L, /* bf967756567ebd108075ae527cc2e7f0 */
- -1.48437500000000006686107754967759751E-01L, /* bffc30000000000003dab20261b3c000 */
- -2.15524270159131591469319477922198390E-32L, /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
- -1.44531250000000005132889939177166485E-01L, /* bffc28000000000002f57b1969e7b000 */
- 2.74741116529653547935086189244019604E-32L, /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
- -1.40625000000000000707469094533647325E-01L, /* bffc2000000000000068676d3d5c4000 */
- 4.40607097220049957013547629906723266E-33L, /* 3f936e0ac425daf795b42913cf0ef881 */
- -1.36718749999999995713752139187543306E-01L, /* bffc17fffffffffffd87762255991000 */
- -3.73751317180116492404578048203389108E-32L, /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
- -1.32812500000000007198453630478482191E-01L, /* bffc10000000000004264de3a4379000 */
- -3.97050085179660203884930593717220728E-32L, /* bf969c52048de14be3c9c1971e50869c */
- -1.28906250000000006070486371645733082E-01L, /* bffc080000000000037fd87db2cb0000 */
- 3.59610068058504988294019521946586131E-32L, /* 3f967570c10687cb8e9ebd0b280abf5a */
- -1.25000000000000003700729208608337966E-01L, /* bffc00000000000002222198bbc74000 */
- 3.23464851393124362331846965931995969E-33L, /* 3f930cb95da3bfc847e593716c91d57a */
- -1.21093750000000013729038501177102555E-01L, /* bffbf000000000000fd418d1f5fda000 */
- 2.45242487730722066611358741283977619E-32L, /* 3f95fd5945ad86a464292e26ac192a84 */
- -1.17187499999999999765305306880205578E-01L, /* bffbdfffffffffffffbabaf869845000 */
- -1.14557520298960389903199646350205537E-32L, /* bf94dbda735322179d9bcf392e1dd06d */
- -1.13281250000000009579647893740755690E-01L, /* bffbd000000000000b0b69bae7ab9000 */
- 2.37873962873837390105423621772752350E-32L, /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
- -1.09375000000000008981153004560108539E-01L, /* bffbc000000000000a5ac4bc1d2c3000 */
- 1.53152444860014076105003555837231015E-32L, /* 3f953e15ce931e12ef9a152522e32bdd */
- -1.05468749999999992399063850363228723E-01L, /* bffbaffffffffffff73c998091408000 */
- -8.75920903597804862471749360196688834E-33L, /* bf946bd7e310a01bae5687ebdc47fcc5 */
- -1.01562500000000007685885179918350550E-01L, /* bffba0000000000008dc7910a648c000 */
- -4.63820993797174451904075397785059501E-33L, /* bf938153d0e54001a472da180fb5e8aa */
- -9.76562499999999887262211517861331814E-02L, /* bffb8ffffffffffff300915aa6fd6000 */
- -2.63767025974952608658936466715705903E-33L, /* bf92b64215bb8d520be5404620d38088 */
- -9.37499999999999939650246024457439795E-02L, /* bffb7ffffffffffff90aca26bd0fc000 */
- -1.72047822349322956713582039121348377E-32L, /* bf9565545015c5b9b56d02cfefca2c7d */
- -8.98437500000000033088896383977486369E-02L, /* bffb70000000000003d09ca1e3cbe000 */
- 3.04831994420989436248526129869697270E-33L, /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
- -8.59374999999999947312400115121319225E-02L, /* bffb5ffffffffffff9ecefc03376e000 */
- 1.50416954438393392150792422537312281E-32L, /* 3f9538675ee99bd722fad0023c09c915 */
- -8.20312500000000054182280847004695514E-02L, /* bffb500000000000063f2dbd40200000 */
- 2.68399664523430004488075638997207289E-33L, /* 3f92bdf49766629882c49a3da88928ed */
- -7.81250000000000114767533968079748798E-02L, /* bffb4000000000000d3b56f81ba70000 */
- 1.72318124201659121296305402819694281E-32L, /* 3f9565e407aaabfb359e8a567d760de3 */
- -7.42187500000000035531829472486812869E-02L, /* bffb3000000000000418b6e9b5388000 */
- 2.09401756478514117051383998628099655E-32L, /* 3f95b2e91221fcd74be0a86d8ad658d2 */
- -7.03124999999999987474933134860732535E-02L, /* bffb1ffffffffffffe8e53453d2ac000 */
- 2.28515798224350800271565551341211666E-32L, /* 3f95da9bd6adf00894f05b5cc5530125 */
- -6.64062500000000042267533361089054159E-02L, /* bffb10000000000004df8473dbcf2000 */
- 1.97576478800281368377376002585430031E-32L, /* 3f959a59acbddb2f53bd3096b66370e9 */
- -6.25000000000000066329769382774201686E-02L, /* bffb00000000000007a5b5914e336000 */
- -1.46422615813786836245343723048221678E-33L, /* bf91e69295f069fc0c4a9db181ea25a3 */
- -5.85937500000000002823707957982406053E-02L, /* bffae0000000000000a6aeab10592000 */
- 9.25637741701318872896718218457555829E-33L, /* 3f94807eb021f1f40a37d4015b1eb76b */
- -5.46875000000000081586888005226044448E-02L, /* bffac0000000000012d00a3171e3a000 */
- -4.87144542459404765480424673678105050E-33L, /* bf9394b42faba6b7036fe7b36269daf3 */
- -5.07812499999999927720348253140567013E-02L, /* bffa9fffffffffffef555cc8dd914000 */
- -3.01901021987395945826043649523451725E-33L, /* bf92f59e7e3025691f290f8f67277faf */
- -4.68749999999999935349476738962633103E-02L, /* bffa7ffffffffffff117b4ea2b876000 */
- 1.21521638219189777347767475937119750E-32L, /* 3f94f8c7f88c5b56674b94d984ac8ecb */
- -4.29687500000000056305562847814228219E-02L, /* bffa6000000000000cfbb19be30c0000 */
- -1.18643699217679276275559592978275214E-32L, /* bf94ecd39f0833a876550e83eb012b99 */
- -3.90624999999999962692914526031373542E-02L, /* bffa3ffffffffffff765c743922f9000 */
- -4.91277156857520035712509544689973679E-33L, /* bf939823189996193872e58ac0dececb */
- -3.51562500000000108152468207687602886E-02L, /* bffa20000000000018f031e41177f000 */
- 1.18599806302656253755207072755609820E-32L, /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
- -3.12500000000000077376981036742289578E-02L, /* bffa00000000000011d787e0b386f000 */
- 9.97730386477005171963635210799577079E-33L, /* 3f949e70e498c46a0173ac0d46c699fc */
- -2.73437500000000139436129596418623235E-02L, /* bff9c00000000000404db66e70a08000 */
- 2.25755321633070123579875157841633859E-33L, /* 3f927719b1a93074bdf9f3c2cb784785 */
- -2.34375000000000088003629211828324876E-02L, /* bff98000000000002895a27d45feb000 */
- 2.84374279216848803102126617873942975E-33L, /* 3f92d87f70e749d6da6c260b68dc210b */
- -1.95312500000000107408831063404855424E-02L, /* bff9400000000000318898ba69f71000 */
- 2.47348089686935458989103979140011912E-33L, /* 3f929afa3de45086fe909fdddb41edce */
- -1.56250000000000081443917555362290635E-02L, /* bff9000000000000258f335e9cdd6000 */
- -2.43379314483517422161458863218426254E-33L, /* bf9294621c8a9ccacf2b020ec19cad27 */
- -1.17187500000000051490597418161403184E-02L, /* bff88000000000002f7ddfa26221f000 */
- 1.83405297208145390679150568810924707E-33L, /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
- -7.81249999999999715861805208310174953E-03L, /* bff7ffffffffffffcb95f3fff157d000 */
- 3.51548384878710915171654413641872451E-34L, /* 3f8fd349b76c22966f77a39fc37ed704 */
- -3.90625000000000309326013918295097128E-03L, /* bff7000000000000390f820c8e153000 */
- 6.38058004651791109324060099097251911E-36L, /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+static const _Float128 __expl_table [] = {
+ L(-3.47656250000000000584188889839535373E-01), /* bffd640000000000002b1b04213cf000 */
+ L(6.90417668990715641167244540876988960E-32), /* 3f97667c3fdb588a6ae1af8748357a17 */
+ L(-3.43749999999999981853132895957607418E-01), /* bffd5ffffffffffffac4ff5f4050b000 */
+ L(-7.16021898043268093462818380603370350E-33), /* bf94296c8219427edc1431ac2498583e */
+ L(-3.39843750000000013418643523138766329E-01), /* bffd5c000000000003de1f027a30e000 */
+ L(8.16920774283317801641347327589583265E-32), /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ L(-3.35937500000000014998092453039303051E-01), /* bffd5800000000000452a9f4d8857000 */
+ L(-6.55865578425428447938248396879359670E-32), /* bf97548b7d240f3d034b395e6eecfac8 */
+ L(-3.32031250000000000981984049529998541E-01), /* bffd540000000000004875277cda5000 */
+ L(6.91213046334032232108944519541512737E-32), /* 3f9766e5f925338a19045c94443b66e1 */
+ L(-3.28124999999999986646017645350399708E-01), /* bffd4ffffffffffffc26a667bf44d000 */
+ L(-6.16281060996110316602421505683742661E-32), /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ L(-3.24218749999999991645717430645867963E-01), /* bffd4bfffffffffffd97901063e48000 */
+ L(-7.90797211087760527593856542417304137E-32), /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ L(-3.20312499999999998918211610690789652E-01), /* bffd47ffffffffffffb02d9856d71000 */
+ L(8.64024799457616856987630373786503376E-32), /* 3f97c0a098623f95579d5d9b2b67342d */
+ L(-3.16406249999999998153974811017181883E-01), /* bffd43ffffffffffff77c991f1076000 */
+ L(-2.73176610180696076418536105483668404E-32), /* bf961baeccb32f9b1fcbb8e60468e95a */
+ L(-3.12500000000000011420976192575972779E-01), /* bffd400000000000034ab8240483d000 */
+ L(7.16573502812389453744433792609989420E-32), /* 3f977410f4c2cfc4335f28446c0fb363 */
+ L(-3.08593750000000001735496343854851414E-01), /* bffd3c000000000000800e995c176000 */
+ L(-1.56292999645122272621237565671593071E-32), /* bf95449b9cbdaff6ac1246adb2c826ac */
+ L(-3.04687499999999982592401295899221626E-01), /* bffd37fffffffffffafb8bc1e061a000 */
+ L(6.48993208584888904958594509625158417E-32), /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ L(-3.00781249999999999230616898937763959E-01), /* bffd33ffffffffffffc73ac39da54000 */
+ L(6.57082437496961397305801409357792029E-32), /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ L(-2.96874999999999998788769281703245722E-01), /* bffd2fffffffffffffa6a07fa5021000 */
+ L(-3.26588297198283968096426564544269170E-32), /* bf9653260fc1802f46b629aee171809b */
+ L(-2.92968750000000015318089182805941695E-01), /* bffd2c0000000000046a468614bd6000 */
+ L(-1.73291974845198589684358727559290718E-32), /* bf9567e9d158f52e483c8d8dcb5961dd */
+ L(-2.89062500000000007736778942676309681E-01), /* bffd280000000000023adf9f4c3d3000 */
+ L(-6.83629745986675744404029225571026236E-32), /* bf9762f5face6281c1daf1c6aedbdb45 */
+ L(-2.85156250000000001367091555763661937E-01), /* bffd2400000000000064dfa11e3fb000 */
+ L(-5.44898442619766878281110054067026237E-32), /* bf971aed6d2db9f542986a785edae072 */
+ L(-2.81249999999999986958718100227029406E-01), /* bffd1ffffffffffffc3db9265ca9d000 */
+ L(1.13007318374506125723591889451107046E-32), /* 3f94d569fe387f456a97902907ac3856 */
+ L(-2.77343750000000000356078829380495179E-01), /* bffd1c0000000000001a462390083000 */
+ L(-4.98979365468978332358409063436543102E-32), /* bf970315bbf3e0d14b5c94c900702d4c */
+ L(-2.73437499999999990276993957508540484E-01), /* bffd17fffffffffffd32919bcdc94000 */
+ L(-8.79390484115892344533724650295100871E-32), /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ L(-2.69531250000000002434203866460082225E-01), /* bffd14000000000000b39ccf9e130000 */
+ L(9.44060754687026590886751809927191596E-32), /* 3f97ea2f32cfecca5c64a26137a9210f */
+ L(-2.65624999999999997296320716986257179E-01), /* bffd0fffffffffffff3880f13a2bc000 */
+ L(2.07142664067265697791007875348396921E-32), /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ L(-2.61718750000000010237478733739017956E-01), /* bffd0c000000000002f3648179d40000 */
+ L(-6.10552936159265665298996309192680256E-32), /* bf973d0467d31e407515a3cca0f3b4e2 */
+ L(-2.57812500000000011948220522778370303E-01), /* bffd08000000000003719f81275bd000 */
+ L(6.72477169058908902499239631466443836E-32), /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ L(-2.53906249999999991822993360536596860E-01), /* bffd03fffffffffffda4a4b62f818000 */
+ L(-2.44868296623215865054704392917190994E-32), /* bf95fc92516c6d057d29fc2528855976 */
+ L(-2.49999999999999986862019457428548084E-01), /* bffcfffffffffffff86d2d20d5ff4000 */
+ L(-3.85302898949105073614122724961613078E-32), /* bf96901f147cb7d643af71b6129ce929 */
+ L(-2.46093750000000000237554160737318435E-01), /* bffcf8000000000000230e8ade26b000 */
+ L(-1.52823675242678363494345369284988589E-32), /* bf953d6700c5f3fc303f79d0ec8c680a */
+ L(-2.42187500000000003023380963205457065E-01), /* bffcf0000000000001be2c1a78bb0000 */
+ L(-7.78402037952209709489481182714311699E-34), /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ L(-2.38281249999999995309623303145485725E-01), /* bffce7fffffffffffd4bd2940f43f000 */
+ L(-3.54307216794236899443913216397197696E-32), /* bf966fef03ab69c3f289436205b21d02 */
+ L(-2.34374999999999998425804947623207526E-01), /* bffcdfffffffffffff17b097a6092000 */
+ L(-2.86038428948386602859761879407549696E-32), /* bf96290a0eba0131efe3a05fe188f2e3 */
+ L(-2.30468749999999993822207406785200832E-01), /* bffcd7fffffffffffc70519834eae000 */
+ L(-2.54339521031747516806893838749365762E-32), /* bf96081f0ad7f9107ae6cddb32c178ab */
+ L(-2.26562499999999997823524030344489884E-01), /* bffccffffffffffffebecf10093df000 */
+ L(4.31904611473158635644635628922959401E-32), /* 3f96c083f0b1faa7c4c686193e38d67c */
+ L(-2.22656250000000004835132405125162742E-01), /* bffcc8000000000002c98a233f19f000 */
+ L(2.54709791629335691650310168420597566E-33), /* 3f92a735903f5eed07a716ab931e20d9 */
+ L(-2.18749999999999988969454021829236626E-01), /* bffcbffffffffffff9a42dc14ce36000 */
+ L(-3.77236096429336082213752014054909454E-32), /* bf9687be8e5b2fca54d3e81157eac660 */
+ L(-2.14843750000000010613256919115758495E-01), /* bffcb80000000000061e3d828ecac000 */
+ L(-4.55194148712216691177097854305964738E-32), /* bf96d8b35c776aa3e1a4768271380503 */
+ L(-2.10937499999999993204656148110447201E-01), /* bffcaffffffffffffc152f2aea118000 */
+ L(-2.95044199165561453749332254271716417E-32), /* bf96326433b00b2439094d9bef22ddd1 */
+ L(-2.07031250000000012233944895423355677E-01), /* bffca80000000000070d695ee0e94000 */
+ L(1.93146788688385419095981415411012357E-32), /* 3f959126729135a5e390d4bb802a0bde */
+ L(-2.03125000000000008030983633336321863E-01), /* bffca0000000000004a129fbc51af000 */
+ L(2.37361904671826193563212931215900137E-32), /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ L(-1.99218750000000001763815712796132779E-01), /* bffc98000000000001044b12d9950000 */
+ L(-3.63171243370923753295192486732883239E-33), /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ L(-1.95312500000000004883660234506677272E-01), /* bffc90000000000002d0b3779d1f9000 */
+ L(-3.19989507343607877747980892249711601E-33), /* bf9309d63de96bb3ef744c865f22f1bd */
+ L(-1.91406250000000013720152363227519348E-01), /* bffc88000000000007e8bcb387121000 */
+ L(-1.89295754093147174148371614722178860E-32), /* bf958926e2e67dfe812c508290add2e7 */
+ L(-1.87500000000000000182342082774432620E-01), /* bffc800000000000001ae8b06a39f000 */
+ L(-2.96812835183184815200854214892983927E-32), /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ L(-1.83593750000000012410147185883290345E-01), /* bffc78000000000007276a1adda8d000 */
+ L(-2.02191931237489669058466239995304587E-32), /* bf95a3efab92d26ec2df90df036a117f */
+ L(-1.79687499999999997439177363346082917E-01), /* bffc6ffffffffffffe8616db2927d000 */
+ L(-9.92752326937775530007399526834009465E-33), /* bf949c5f88ed17041e1a3f1829d543cd */
+ L(-1.75781249999999995824373974504785174E-01), /* bffc67fffffffffffd97c94f13ea3000 */
+ L(1.44184772065335613487885714828816178E-32), /* 3f952b75c63476e7fcc2f5841c27bcce */
+ L(-1.71874999999999986685050259043077809E-01), /* bffc5ffffffffffff8530f6bc531a000 */
+ L(-3.49007014971241147689894940544402482E-32), /* bf966a6dfaa012aea8ffe6d90b02330f */
+ L(-1.67968749999999997316058782350439701E-01), /* bffc57fffffffffffe73eb914f2aa000 */
+ L(3.34025733574205019081305778794376391E-32), /* 3f965adf4572561fd5456a6c13d8babf */
+ L(-1.64062499999999993322730602128318480E-01), /* bffc4ffffffffffffc269be4f68f3000 */
+ L(-1.83345916769684984022099095506340635E-32), /* bf957ccb69026cb2f6024c211576d5f4 */
+ L(-1.60156249999999992419000744447607979E-01), /* bffc47fffffffffffba13df21784a000 */
+ L(2.73442789798110494773517431626534726E-32), /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ L(-1.56249999999999987665010524130393080E-01), /* bffc3ffffffffffff8e3ad45e7508000 */
+ L(2.02695576464836145806428118889332191E-32), /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ L(-1.52343749999999989905291167951491803E-01), /* bffc37fffffffffffa2e48aecfc24000 */
+ L(-3.61436631548815190395331054871041524E-32), /* bf967756567ebd108075ae527cc2e7f0 */
+ L(-1.48437500000000006686107754967759751E-01), /* bffc30000000000003dab20261b3c000 */
+ L(-2.15524270159131591469319477922198390E-32), /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ L(-1.44531250000000005132889939177166485E-01), /* bffc28000000000002f57b1969e7b000 */
+ L(2.74741116529653547935086189244019604E-32), /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ L(-1.40625000000000000707469094533647325E-01), /* bffc2000000000000068676d3d5c4000 */
+ L(4.40607097220049957013547629906723266E-33), /* 3f936e0ac425daf795b42913cf0ef881 */
+ L(-1.36718749999999995713752139187543306E-01), /* bffc17fffffffffffd87762255991000 */
+ L(-3.73751317180116492404578048203389108E-32), /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ L(-1.32812500000000007198453630478482191E-01), /* bffc10000000000004264de3a4379000 */
+ L(-3.97050085179660203884930593717220728E-32), /* bf969c52048de14be3c9c1971e50869c */
+ L(-1.28906250000000006070486371645733082E-01), /* bffc080000000000037fd87db2cb0000 */
+ L(3.59610068058504988294019521946586131E-32), /* 3f967570c10687cb8e9ebd0b280abf5a */
+ L(-1.25000000000000003700729208608337966E-01), /* bffc00000000000002222198bbc74000 */
+ L(3.23464851393124362331846965931995969E-33), /* 3f930cb95da3bfc847e593716c91d57a */
+ L(-1.21093750000000013729038501177102555E-01), /* bffbf000000000000fd418d1f5fda000 */
+ L(2.45242487730722066611358741283977619E-32), /* 3f95fd5945ad86a464292e26ac192a84 */
+ L(-1.17187499999999999765305306880205578E-01), /* bffbdfffffffffffffbabaf869845000 */
+ L(-1.14557520298960389903199646350205537E-32), /* bf94dbda735322179d9bcf392e1dd06d */
+ L(-1.13281250000000009579647893740755690E-01), /* bffbd000000000000b0b69bae7ab9000 */
+ L(2.37873962873837390105423621772752350E-32), /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ L(-1.09375000000000008981153004560108539E-01), /* bffbc000000000000a5ac4bc1d2c3000 */
+ L(1.53152444860014076105003555837231015E-32), /* 3f953e15ce931e12ef9a152522e32bdd */
+ L(-1.05468749999999992399063850363228723E-01), /* bffbaffffffffffff73c998091408000 */
+ L(-8.75920903597804862471749360196688834E-33), /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ L(-1.01562500000000007685885179918350550E-01), /* bffba0000000000008dc7910a648c000 */
+ L(-4.63820993797174451904075397785059501E-33), /* bf938153d0e54001a472da180fb5e8aa */
+ L(-9.76562499999999887262211517861331814E-02), /* bffb8ffffffffffff300915aa6fd6000 */
+ L(-2.63767025974952608658936466715705903E-33), /* bf92b64215bb8d520be5404620d38088 */
+ L(-9.37499999999999939650246024457439795E-02), /* bffb7ffffffffffff90aca26bd0fc000 */
+ L(-1.72047822349322956713582039121348377E-32), /* bf9565545015c5b9b56d02cfefca2c7d */
+ L(-8.98437500000000033088896383977486369E-02), /* bffb70000000000003d09ca1e3cbe000 */
+ L(3.04831994420989436248526129869697270E-33), /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ L(-8.59374999999999947312400115121319225E-02), /* bffb5ffffffffffff9ecefc03376e000 */
+ L(1.50416954438393392150792422537312281E-32), /* 3f9538675ee99bd722fad0023c09c915 */
+ L(-8.20312500000000054182280847004695514E-02), /* bffb500000000000063f2dbd40200000 */
+ L(2.68399664523430004488075638997207289E-33), /* 3f92bdf49766629882c49a3da88928ed */
+ L(-7.81250000000000114767533968079748798E-02), /* bffb4000000000000d3b56f81ba70000 */
+ L(1.72318124201659121296305402819694281E-32), /* 3f9565e407aaabfb359e8a567d760de3 */
+ L(-7.42187500000000035531829472486812869E-02), /* bffb3000000000000418b6e9b5388000 */
+ L(2.09401756478514117051383998628099655E-32), /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ L(-7.03124999999999987474933134860732535E-02), /* bffb1ffffffffffffe8e53453d2ac000 */
+ L(2.28515798224350800271565551341211666E-32), /* 3f95da9bd6adf00894f05b5cc5530125 */
+ L(-6.64062500000000042267533361089054159E-02), /* bffb10000000000004df8473dbcf2000 */
+ L(1.97576478800281368377376002585430031E-32), /* 3f959a59acbddb2f53bd3096b66370e9 */
+ L(-6.25000000000000066329769382774201686E-02), /* bffb00000000000007a5b5914e336000 */
+ L(-1.46422615813786836245343723048221678E-33), /* bf91e69295f069fc0c4a9db181ea25a3 */
+ L(-5.85937500000000002823707957982406053E-02), /* bffae0000000000000a6aeab10592000 */
+ L(9.25637741701318872896718218457555829E-33), /* 3f94807eb021f1f40a37d4015b1eb76b */
+ L(-5.46875000000000081586888005226044448E-02), /* bffac0000000000012d00a3171e3a000 */
+ L(-4.87144542459404765480424673678105050E-33), /* bf9394b42faba6b7036fe7b36269daf3 */
+ L(-5.07812499999999927720348253140567013E-02), /* bffa9fffffffffffef555cc8dd914000 */
+ L(-3.01901021987395945826043649523451725E-33), /* bf92f59e7e3025691f290f8f67277faf */
+ L(-4.68749999999999935349476738962633103E-02), /* bffa7ffffffffffff117b4ea2b876000 */
+ L(1.21521638219189777347767475937119750E-32), /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ L(-4.29687500000000056305562847814228219E-02), /* bffa6000000000000cfbb19be30c0000 */
+ L(-1.18643699217679276275559592978275214E-32), /* bf94ecd39f0833a876550e83eb012b99 */
+ L(-3.90624999999999962692914526031373542E-02), /* bffa3ffffffffffff765c743922f9000 */
+ L(-4.91277156857520035712509544689973679E-33), /* bf939823189996193872e58ac0dececb */
+ L(-3.51562500000000108152468207687602886E-02), /* bffa20000000000018f031e41177f000 */
+ L(1.18599806302656253755207072755609820E-32), /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ L(-3.12500000000000077376981036742289578E-02), /* bffa00000000000011d787e0b386f000 */
+ L(9.97730386477005171963635210799577079E-33), /* 3f949e70e498c46a0173ac0d46c699fc */
+ L(-2.73437500000000139436129596418623235E-02), /* bff9c00000000000404db66e70a08000 */
+ L(2.25755321633070123579875157841633859E-33), /* 3f927719b1a93074bdf9f3c2cb784785 */
+ L(-2.34375000000000088003629211828324876E-02), /* bff98000000000002895a27d45feb000 */
+ L(2.84374279216848803102126617873942975E-33), /* 3f92d87f70e749d6da6c260b68dc210b */
+ L(-1.95312500000000107408831063404855424E-02), /* bff9400000000000318898ba69f71000 */
+ L(2.47348089686935458989103979140011912E-33), /* 3f929afa3de45086fe909fdddb41edce */
+ L(-1.56250000000000081443917555362290635E-02), /* bff9000000000000258f335e9cdd6000 */
+ L(-2.43379314483517422161458863218426254E-33), /* bf9294621c8a9ccacf2b020ec19cad27 */
+ L(-1.17187500000000051490597418161403184E-02), /* bff88000000000002f7ddfa26221f000 */
+ L(1.83405297208145390679150568810924707E-33), /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ L(-7.81249999999999715861805208310174953E-03), /* bff7ffffffffffffcb95f3fff157d000 */
+ L(3.51548384878710915171654413641872451E-34), /* 3f8fd349b76c22966f77a39fc37ed704 */
+ L(-3.90625000000000309326013918295097128E-03), /* bff7000000000000390f820c8e153000 */
+ L(6.38058004651791109324060099097251911E-36), /* 3f8a0f665d3ac25a1ac94d688273dbcd */
#define T_EXPL_ARG1 (2*89)
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 3.90625000000000245479958859972588985E-03L, /* 3ff70000000000002d48769ac9874000 */
- -6.58439598384342854976169982902779828E-36L, /* bf8a1811b923e6c626b07ef29761482a */
- 7.81250000000001311374391093664996358E-03L, /* 3ff800000000000078f3f3cd89111000 */
- 2.60265650555493781464273319671555602E-33L, /* 3f92b070c3b635b87af426735a71fc87 */
- 1.17187500000000269581156218247101912E-02L, /* 3ff8800000000000f8a50d02fe20d000 */
- 1.00961747974945520631836275894919326E-33L, /* 3f914f80c1a4f8042044fe3b757b030b */
- 1.56249999999999797878275270751825475E-02L, /* 3ff8ffffffffffff45935b69da62e000 */
- 2.03174577741375590087897353146748580E-33L, /* 3f925194e863496e0f6e91cbf6b22e26 */
- 1.95312499999999760319884511789111533E-02L, /* 3ff93fffffffffff917790ff9a8f4000 */
- 4.62788519658803722282100289809515007E-33L, /* 3f9380783ba81295feeb3e4879d7d52d */
- 2.34374999999999822953909016349145918E-02L, /* 3ff97fffffffffffae5a163bd3cd5000 */
- -3.19499956304699705390404384504876533E-33L, /* bf93096e2037ced8194cf344c692f8d6 */
- 2.73437500000000137220327275871555682E-02L, /* 3ff9c000000000003f481dea5dd51000 */
- -2.25757776523031994464630107442723424E-33L, /* bf92771abcf988a02b414bf2614e3734 */
- 3.12499999999999790857640618332718621E-02L, /* 3ff9ffffffffffff9f8cd40b51509000 */
- -4.22479470489989916319395454536511458E-33L, /* bf935efb7245612f371deca17cb7b30c */
- 3.51562499999999840753382405747597346E-02L, /* 3ffa1fffffffffffdb47bd275f722000 */
- 1.08459658374118041980976756063083500E-34L, /* 3f8e2055d18b7117c9db1c318b1e889b */
- 3.90624999999999989384433621470426757E-02L, /* 3ffa3ffffffffffffd8d5e18b042e000 */
- -7.41674226146122000759491297811091830E-33L, /* bf94341454e48029e5b0205d91baffdc */
- 4.29687500000000107505739500500200462E-02L, /* 3ffa60000000000018ca04cd9085c000 */
- -4.74689012756713017494437969420919847E-34L, /* bf903b7c268103c6f7fbaaa24142e287 */
- 4.68749999999999978700749928325717352E-02L, /* 3ffa7ffffffffffffb16b6d5479e3000 */
- -1.06208165308448830117773486334902917E-32L, /* bf94b92be4b3b5b5a596a0a5187cc955 */
- 5.07812499999999815072625435955786253E-02L, /* 3ffa9fffffffffffd55bd086d5cbc000 */
- -9.37038897148383660401929567549111394E-33L, /* bf94853b111b0175b491c80d00419416 */
- 5.46874999999999809511553152189867394E-02L, /* 3ffabfffffffffffd4138bfa74a61000 */
- 1.06642963074562437340498606682822123E-32L, /* 3f94bafa3fe991b39255d563dfa05d89 */
- 5.85937500000000184331996330905145551E-02L, /* 3ffae000000000002a810a5f2f8bf000 */
- -1.76639977694797200820296641773791945E-34L, /* bf8ed596f07ce4408f1705c8ec16864c */
- 6.25000000000000021544696744852045001E-02L, /* 3ffb000000000000027be32045e2b000 */
- 1.68616371995798354366633034788947149E-32L, /* 3f955e33d7440794d8a1b25233d086ab */
- 6.64062499999999965563110718495802889E-02L, /* 3ffb0ffffffffffffc079a38a3fed000 */
- -1.82463217667830160048872113565316215E-32L, /* bf957af6163bcdb97cefab44a942482a */
- 7.03124999999999759989183341261898222E-02L, /* 3ffb1fffffffffffe454218acea05000 */
- -1.07843770101525495515646940862541503E-32L, /* bf94bff72aada26d94e76e71c07e0580 */
- 7.42187499999999898968873730710101412E-02L, /* 3ffb2ffffffffffff45a166496dc1000 */
- 1.28629441689592874462780757154138223E-32L, /* 3f950b2724597b8b93ce1e9d1cf4d035 */
- 7.81249999999999957198938523510804668E-02L, /* 3ffb3ffffffffffffb10bc52adbc5000 */
- 1.13297573459968118467100063135856856E-33L, /* 3f91787eea895b3c245899cf34ad0abd */
- 8.20312500000000199911640621145851159E-02L, /* 3ffb500000000000170c59a661a89000 */
- -1.51161335208135146756554123073528707E-32L, /* bf9539f326c5ca84e7db5401566f3775 */
- 8.59375000000000134175373433347670743E-02L, /* 3ffb6000000000000f78287547af0000 */
- 1.09763629458404270323909815379924900E-32L, /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
- 8.98437500000000036533922600308306335E-02L, /* 3ffb70000000000004364a83b7a14000 */
- 3.11459653680110433194288029777718358E-33L, /* 3f9302c0248136d65cebeab69488d949 */
- 9.37500000000000184977946245216914691E-02L, /* 3ffb800000000000155395d870b17000 */
- -4.66656154468277949130395786965043927E-33L, /* bf9383aec9b993b6db492b1ede786d8a */
- 9.76562500000000237839723100419376084E-02L, /* 3ffb9000000000001b6bca237f6c4000 */
- -1.03028043424658760249140747856831301E-32L, /* bf94abf6352e3d2bb398e47919a343fb */
- 1.01562500000000012345545575236836572E-01L, /* 3ffba000000000000e3bc30cd9a1f000 */
- 2.15755372310795701322789783729456319E-32L, /* 3f95c01b3b819edd9d07548fafd61550 */
- 1.05468749999999976493840484471911438E-01L, /* 3ffbafffffffffffe4e634cd77985000 */
- 1.78771847038773333029677216592309083E-32L, /* 3f95734b6ae650f33dd43c49a1df9fc0 */
- 1.09375000000000002267015055992785402E-01L, /* 3ffbc00000000000029d1ad08de7b000 */
- 6.23263106693943817730045115112427717E-33L, /* 3f9402e4b39ce2198a45e1d045868cd6 */
- 1.13281250000000022354208618429577398E-01L, /* 3ffbd0000000000019c5cc3f9d2b5000 */
- 5.40514416644786448581426756221178868E-33L, /* 3f93c10ab4021472c662f69435de9269 */
- 1.17187500000000013252367133076817603E-01L, /* 3ffbe000000000000f47688cc561b000 */
- -7.12412585457324989451327215568641325E-33L, /* bf9427ecb343a8d1758990565fcfbf45 */
- 1.21093750000000020759863992944300792E-01L, /* 3ffbf0000000000017ef3af97bf04000 */
- 6.26591408357572503875647872077266444E-33L, /* 3f940446a09a2da771b45fc075514d12 */
- 1.25000000000000004739659392396765618E-01L, /* 3ffc00000000000002bb7344ecd89000 */
- -1.55611398459729463981000080101758830E-32L, /* bf95433135febefa9e6aa4db39e263d2 */
- 1.28906249999999982360888081057894783E-01L, /* 3ffc07fffffffffff5d4ed3154361000 */
- -1.77531518652835570781208599686606474E-32L, /* bf9570b7f225ea076f97f418d11359c1 */
- 1.32812500000000010568583998727400436E-01L, /* 3ffc1000000000000617a5d09526a000 */
- 2.12104021624990594668286391598300893E-32L, /* 3f95b885d767a1048d93055927a27adc */
- 1.36718749999999998434125157367005292E-01L, /* 3ffc17ffffffffffff18eaebc7970000 */
- 2.50454798592543203967309921276955297E-32L, /* 3f9604164e5598528a76faff26cd1c97 */
- 1.40625000000000015550032422969330356E-01L, /* 3ffc20000000000008f6c79d8928c000 */
- 7.80972982879849783680252962992639832E-33L, /* 3f9444674acf2b3225c7647e0d95edf3 */
- 1.44531250000000012402535562111122522E-01L, /* 3ffc28000000000007264a8bc1ff1000 */
- 2.79662468716455159585514763921671876E-32L, /* 3f96226b095bd78aa650faf95a221993 */
- 1.48437500000000007761020440087419948E-01L, /* 3ffc3000000000000479530ff8fe3000 */
- 2.15518492972728435680556239996258527E-32L, /* 3f95bf9d49295e73a957906a029768cb */
- 1.52343750000000001733189947520484032E-01L, /* 3ffc38000000000000ffc6109f71f000 */
- 8.34032236093545825619420380704500188E-33L, /* 3f945a71851226a1d0ce5e656693153e */
- 1.56249999999999988073295321246958484E-01L, /* 3ffc3ffffffffffff91fedd62ae0f000 */
- 2.44119337150624789345260194989620908E-32L, /* 3f95fb041a57bc1c1280680ac1620bea */
- 1.60156250000000002076894210913572460E-01L, /* 3ffc48000000000001327ed84a199000 */
- -7.36124501128859978061216696286151753E-33L, /* bf9431c62f01e59d2c1e00f195a0037f */
- 1.64062500000000000950861276373482172E-01L, /* 3ffc500000000000008c5285fba85000 */
- -4.80566184447001164583855800470217373E-33L, /* bf938f3d1fcafd390f22f80e6c19421f */
- 1.67968749999999989878071706155265999E-01L, /* 3ffc57fffffffffffa2a445c548c5000 */
- -4.42154428718618459799673088733365064E-32L, /* bf96cb28cf1c1b28006d53ffe633b22a */
- 1.71874999999999999459734108403218175E-01L, /* 3ffc5fffffffffffffb04554e9dd4000 */
- -3.29736288190321377985697972236270628E-32L, /* bf96566af0ebc852e84be12859b24a31 */
- 1.75781249999999997987525759778901845E-01L, /* 3ffc67fffffffffffed702df6ffff000 */
- -1.28800728638468399687523924685844352E-32L, /* bf950b8236b88ca0c1b739dc91a7e3fc */
- 1.79687500000000004929565820437175783E-01L, /* 3ffc70000000000002d779bb32d2e000 */
- 1.60624461317978482424582320675174225E-32L, /* 3f954d9a9cc0c963fd081f3dc922d04e */
- 1.83593750000000016873727045739708856E-01L, /* 3ffc78000000000009ba1f6263c9a000 */
- -3.83390389582056606880506003118452558E-32L, /* bf968e22a5d826f77f19ee788474df22 */
- 1.87500000000000013443068740761666872E-01L, /* 3ffc80000000000007bfd8c72a1bf000 */
- -2.74141662712926256150154726565203091E-32L, /* bf961caf5ac59c7f941f928e324c2cc1 */
- 1.91406249999999981494101786848611970E-01L, /* 3ffc87fffffffffff55502eeae001000 */
- 3.68992437075565165346469517256118001E-32L, /* 3f967f2f03f9096793372a27b92ad79d */
- 1.95312499999999989069921848800501648E-01L, /* 3ffc8ffffffffffff9b3015280394000 */
- 3.69712249337856518452988332367785220E-32L, /* 3f967fee5fdb5bd501ff93516999faa0 */
- 1.99218750000000021148042946919300804E-01L, /* 3ffc9800000000000c30e67939095000 */
- 2.50142536781142175091322844848566649E-32L, /* 3f9603c34ae58e10b300b07137ee618a */
- 2.03124999999999977732559198825437141E-01L, /* 3ffc9ffffffffffff329e7df079e4000 */
- -2.41951877287895024779300892731537816E-32L, /* bf95f683aefe6965f080df8f59dd34a1 */
- 2.07031249999999996744030653771913124E-01L, /* 3ffca7fffffffffffe1f80f4b73ca000 */
- -1.94346475904454000031592792989765585E-32L, /* bf9593a44f87870a3d100d498501ecc7 */
- 2.10937500000000000251399259834392298E-01L, /* 3ffcb000000000000025199873310000 */
- -1.33528748788094249098998693871759411E-33L, /* bf91bbb9b25c813668d6103d08acac35 */
- 2.14843749999999993936323609611875097E-01L, /* 3ffcb7fffffffffffc8128c866236000 */
- 1.14839877977014974625242788556545292E-32L, /* 3f94dd06b4655c9b83a1305b240e7a42 */
- 2.18750000000000015181732784749663837E-01L, /* 3ffcc0000000000008c06da5fff24000 */
- 1.42689085313142539755499441881408391E-32L, /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
- 2.22656249999999992172647770539596569E-01L, /* 3ffcc7fffffffffffb7ce2fe531f6000 */
- -3.34421462850496887359128610229650547E-32L, /* bf965b487962b5c2d9056ca6ac0c2e5c */
- 2.26562499999999989595607223847082419E-01L, /* 3ffccffffffffffffa0095277be5c000 */
- -3.08983588107248752517344356508205569E-32L, /* bf9640dded57157f8eded311213bdbcd */
- 2.30468749999999979130462438434567117E-01L, /* 3ffcd7fffffffffff3f8332996560000 */
- -3.01407539802851697849105682795217019E-32L, /* bf9638ffde35dbdfe1a1ffe45185de5d */
- 2.34375000000000012194252337217891971E-01L, /* 3ffce0000000000007078dd402c86000 */
- -8.46879710915628592284714319904522657E-33L, /* bf945fc7b29a2ac6c9eff9eb258a510f */
- 2.38281249999999982991877076137149870E-01L, /* 3ffce7fffffffffff6320b486eece000 */
- -2.93563878880439245627127095245798544E-32L, /* bf9630daaa4f40ff05caf29ace2ea7d4 */
- 2.42187499999999981447559841442773990E-01L, /* 3ffceffffffffffff54e24a09a8d5000 */
- -4.56766746558806021264215486909850481E-32L, /* bf96da556dee11f3113e5a3467b908e6 */
- 2.46093749999999991067720539980207318E-01L, /* 3ffcf7fffffffffffad9d405dcb5d000 */
- 2.14033004219908074003010247652128251E-32L, /* 3f95bc8776e8f9ae098884aa664cc3df */
- 2.50000000000000016613825838126835953E-01L, /* 3ffd00000000000004c9e24c12bb3000 */
- 2.57617532593749185996714235009382870E-32L, /* 3f960b867cc01178c0ec68226c6cb47d */
- 2.53906250000000013372004437827044321E-01L, /* 3ffd04000000000003daae05b3168000 */
- 7.20177123439204414298152646284640101E-32L, /* 3f9775eff59ddad7e7530b83934af87f */
- 2.57812499999999995765234725413886085E-01L, /* 3ffd07fffffffffffec7878bad9d5000 */
- 6.51253187532920882777046064603770602E-32L, /* 3f975226659ca241402e71c2011583b0 */
- 2.61718750000000007647689994011222248E-01L, /* 3ffd0c000000000002344cc793a0f000 */
- 3.02370610028725823590045201871491395E-32L, /* 3f9639ffe55fa2fa011674448b4e5b96 */
- 2.65624999999999986893899042596554269E-01L, /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
- -2.07683715950724761146070082510569258E-32L, /* bf95af579a92e872fef81abfdf06bae8 */
- 2.69531249999999979842788204900639327E-01L, /* 3ffd13fffffffffffa30a908d67db000 */
- 8.71465252506557329027658736641075706E-32L, /* 3f97c47d99e19830447a42b1c0ffac61 */
- 2.73437500000000006712165837793818271E-01L, /* 3ffd18000000000001ef453a58edb000 */
- -6.62704045767568912140550474455810301E-32L, /* bf9758187a204dcb06ece46588aeeaba */
- 2.77343749999999994411329302988535617E-01L, /* 3ffd1bfffffffffffe63a0fec9c9e000 */
- -4.87273466291944117406493607771338767E-32L, /* bf96fa0381b0844a0be46bac2d673f0c */
- 2.81250000000000012677892447379453135E-01L, /* 3ffd20000000000003a7769e125d6000 */
- -8.55871796664700790726282049552906783E-32L, /* bf97bc64e01332cf7616b0091b8dff2c */
- 2.85156249999999998558643013736363981E-01L, /* 3ffd23ffffffffffff95a5894bccf000 */
- -1.33068334720606220176455289635046875E-32L, /* bf95145f43290ecf5b7adcb24697bc73 */
- 2.89062500000000008831431235621753924E-01L, /* 3ffd280000000000028ba504fac59000 */
- -9.34157398616814623985483776710704237E-32L, /* bf97e50ad1115b941fcb5f0c88a428f7 */
- 2.92968750000000019840235286110877063E-01L, /* 3ffd2c000000000005b7f372d184f000 */
- 4.99302093775173155906059132992249671E-33L, /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
- 2.96875000000000015867911730971630513E-01L, /* 3ffd3000000000000492d860c79db000 */
- 7.86107787827057767235127454590866211E-33L, /* 3f944689517ee8f16cdb97d6a6938f32 */
- 3.00781250000000015814100002286124758E-01L, /* 3ffd340000000000048edfe73a17d000 */
- -1.65419431293024229981937172317171504E-32L, /* bf9557900e3efca16c89646b57f68dc0 */
- 3.04687499999999985213157159965287195E-01L, /* 3ffd37fffffffffffbbcec6f99b36000 */
- 9.68753602893894024018934325652944198E-32L, /* 3f97f70170e5458660c33a7e8d43d049 */
- 3.08593749999999989969324338045156215E-01L, /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
- 7.10268609610294706092252562643261106E-32L, /* 3f9770cae45cdf615010401a4b37d8d4 */
- 3.12500000000000002971606591018488854E-01L, /* 3ffd40000000000000db440fbc06b000 */
- 6.38924218802905979887732294952782964E-32L, /* 3f974bbf988bb5622bd8fbaa46e8b811 */
- 3.16406250000000006594921047402056305E-01L, /* 3ffd44000000000001e69e8954814000 */
- 3.96079878754651470094149874444850097E-32L, /* 3f969b5017b9fa7a1e86975258c73d3d */
- 3.20312500000000006713799366908329147E-01L, /* 3ffd48000000000001ef64159c065000 */
- -1.86401314975634286055150437995880517E-32L, /* bf958323f0434911794e5fb8bfe136ba */
- 3.24218749999999987061246567584951210E-01L, /* 3ffd4bfffffffffffc4549db9b928000 */
- -3.18643523744758601387071062700407431E-32L, /* bf964ae5fa7e26c2c3981bed12e14372 */
- 3.28124999999999991782776266707412953E-01L, /* 3ffd4ffffffffffffda1ad0840ca8000 */
- -4.46964199751314296839915534813144652E-32L, /* bf96d0277729ffd74727150df6d15547 */
- 3.32031250000000000393816557756032682E-01L, /* 3ffd540000000000001d0efc04fad000 */
- -9.03246333902065439930373230002688649E-33L, /* bf947731a008748cc6dee948839ef7ae */
- 3.35937499999999983810482995064392173E-01L, /* 3ffd57fffffffffffb556cab8ae61000 */
- 5.27742727066129518825981597650621794E-32L, /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
- 3.39843750000000004310441349760912471E-01L, /* 3ffd5c0000000000013e0def5ddc4000 */
- -3.85927263474732591932884416445586106E-32L, /* bf9690c51088ef3db9ca000829c450c2 */
- 3.43749999999999990248130003997484364E-01L, /* 3ffd5ffffffffffffd3070624a0af000 */
- 9.62005170171527308106468341512327487E-34L, /* 3f913fae595cea84432eb01430817fca */
- 3.47656250000000004085726414568625697E-01L, /* 3ffd640000000000012d79309e291000 */
- -6.59664093705705297250259434519072507E-32L, /* bf97568465eafb0e662e64a5dbfaf35f */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(3.90625000000000245479958859972588985E-03), /* 3ff70000000000002d48769ac9874000 */
+ L(-6.58439598384342854976169982902779828E-36), /* bf8a1811b923e6c626b07ef29761482a */
+ L(7.81250000000001311374391093664996358E-03), /* 3ff800000000000078f3f3cd89111000 */
+ L(2.60265650555493781464273319671555602E-33), /* 3f92b070c3b635b87af426735a71fc87 */
+ L(1.17187500000000269581156218247101912E-02), /* 3ff8800000000000f8a50d02fe20d000 */
+ L(1.00961747974945520631836275894919326E-33), /* 3f914f80c1a4f8042044fe3b757b030b */
+ L(1.56249999999999797878275270751825475E-02), /* 3ff8ffffffffffff45935b69da62e000 */
+ L(2.03174577741375590087897353146748580E-33), /* 3f925194e863496e0f6e91cbf6b22e26 */
+ L(1.95312499999999760319884511789111533E-02), /* 3ff93fffffffffff917790ff9a8f4000 */
+ L(4.62788519658803722282100289809515007E-33), /* 3f9380783ba81295feeb3e4879d7d52d */
+ L(2.34374999999999822953909016349145918E-02), /* 3ff97fffffffffffae5a163bd3cd5000 */
+ L(-3.19499956304699705390404384504876533E-33), /* bf93096e2037ced8194cf344c692f8d6 */
+ L(2.73437500000000137220327275871555682E-02), /* 3ff9c000000000003f481dea5dd51000 */
+ L(-2.25757776523031994464630107442723424E-33), /* bf92771abcf988a02b414bf2614e3734 */
+ L(3.12499999999999790857640618332718621E-02), /* 3ff9ffffffffffff9f8cd40b51509000 */
+ L(-4.22479470489989916319395454536511458E-33), /* bf935efb7245612f371deca17cb7b30c */
+ L(3.51562499999999840753382405747597346E-02), /* 3ffa1fffffffffffdb47bd275f722000 */
+ L(1.08459658374118041980976756063083500E-34), /* 3f8e2055d18b7117c9db1c318b1e889b */
+ L(3.90624999999999989384433621470426757E-02), /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ L(-7.41674226146122000759491297811091830E-33), /* bf94341454e48029e5b0205d91baffdc */
+ L(4.29687500000000107505739500500200462E-02), /* 3ffa60000000000018ca04cd9085c000 */
+ L(-4.74689012756713017494437969420919847E-34), /* bf903b7c268103c6f7fbaaa24142e287 */
+ L(4.68749999999999978700749928325717352E-02), /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ L(-1.06208165308448830117773486334902917E-32), /* bf94b92be4b3b5b5a596a0a5187cc955 */
+ L(5.07812499999999815072625435955786253E-02), /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ L(-9.37038897148383660401929567549111394E-33), /* bf94853b111b0175b491c80d00419416 */
+ L(5.46874999999999809511553152189867394E-02), /* 3ffabfffffffffffd4138bfa74a61000 */
+ L(1.06642963074562437340498606682822123E-32), /* 3f94bafa3fe991b39255d563dfa05d89 */
+ L(5.85937500000000184331996330905145551E-02), /* 3ffae000000000002a810a5f2f8bf000 */
+ L(-1.76639977694797200820296641773791945E-34), /* bf8ed596f07ce4408f1705c8ec16864c */
+ L(6.25000000000000021544696744852045001E-02), /* 3ffb000000000000027be32045e2b000 */
+ L(1.68616371995798354366633034788947149E-32), /* 3f955e33d7440794d8a1b25233d086ab */
+ L(6.64062499999999965563110718495802889E-02), /* 3ffb0ffffffffffffc079a38a3fed000 */
+ L(-1.82463217667830160048872113565316215E-32), /* bf957af6163bcdb97cefab44a942482a */
+ L(7.03124999999999759989183341261898222E-02), /* 3ffb1fffffffffffe454218acea05000 */
+ L(-1.07843770101525495515646940862541503E-32), /* bf94bff72aada26d94e76e71c07e0580 */
+ L(7.42187499999999898968873730710101412E-02), /* 3ffb2ffffffffffff45a166496dc1000 */
+ L(1.28629441689592874462780757154138223E-32), /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+ L(7.81249999999999957198938523510804668E-02), /* 3ffb3ffffffffffffb10bc52adbc5000 */
+ L(1.13297573459968118467100063135856856E-33), /* 3f91787eea895b3c245899cf34ad0abd */
+ L(8.20312500000000199911640621145851159E-02), /* 3ffb500000000000170c59a661a89000 */
+ L(-1.51161335208135146756554123073528707E-32), /* bf9539f326c5ca84e7db5401566f3775 */
+ L(8.59375000000000134175373433347670743E-02), /* 3ffb6000000000000f78287547af0000 */
+ L(1.09763629458404270323909815379924900E-32), /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+ L(8.98437500000000036533922600308306335E-02), /* 3ffb70000000000004364a83b7a14000 */
+ L(3.11459653680110433194288029777718358E-33), /* 3f9302c0248136d65cebeab69488d949 */
+ L(9.37500000000000184977946245216914691E-02), /* 3ffb800000000000155395d870b17000 */
+ L(-4.66656154468277949130395786965043927E-33), /* bf9383aec9b993b6db492b1ede786d8a */
+ L(9.76562500000000237839723100419376084E-02), /* 3ffb9000000000001b6bca237f6c4000 */
+ L(-1.03028043424658760249140747856831301E-32), /* bf94abf6352e3d2bb398e47919a343fb */
+ L(1.01562500000000012345545575236836572E-01), /* 3ffba000000000000e3bc30cd9a1f000 */
+ L(2.15755372310795701322789783729456319E-32), /* 3f95c01b3b819edd9d07548fafd61550 */
+ L(1.05468749999999976493840484471911438E-01), /* 3ffbafffffffffffe4e634cd77985000 */
+ L(1.78771847038773333029677216592309083E-32), /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+ L(1.09375000000000002267015055992785402E-01), /* 3ffbc00000000000029d1ad08de7b000 */
+ L(6.23263106693943817730045115112427717E-33), /* 3f9402e4b39ce2198a45e1d045868cd6 */
+ L(1.13281250000000022354208618429577398E-01), /* 3ffbd0000000000019c5cc3f9d2b5000 */
+ L(5.40514416644786448581426756221178868E-33), /* 3f93c10ab4021472c662f69435de9269 */
+ L(1.17187500000000013252367133076817603E-01), /* 3ffbe000000000000f47688cc561b000 */
+ L(-7.12412585457324989451327215568641325E-33), /* bf9427ecb343a8d1758990565fcfbf45 */
+ L(1.21093750000000020759863992944300792E-01), /* 3ffbf0000000000017ef3af97bf04000 */
+ L(6.26591408357572503875647872077266444E-33), /* 3f940446a09a2da771b45fc075514d12 */
+ L(1.25000000000000004739659392396765618E-01), /* 3ffc00000000000002bb7344ecd89000 */
+ L(-1.55611398459729463981000080101758830E-32), /* bf95433135febefa9e6aa4db39e263d2 */
+ L(1.28906249999999982360888081057894783E-01), /* 3ffc07fffffffffff5d4ed3154361000 */
+ L(-1.77531518652835570781208599686606474E-32), /* bf9570b7f225ea076f97f418d11359c1 */
+ L(1.32812500000000010568583998727400436E-01), /* 3ffc1000000000000617a5d09526a000 */
+ L(2.12104021624990594668286391598300893E-32), /* 3f95b885d767a1048d93055927a27adc */
+ L(1.36718749999999998434125157367005292E-01), /* 3ffc17ffffffffffff18eaebc7970000 */
+ L(2.50454798592543203967309921276955297E-32), /* 3f9604164e5598528a76faff26cd1c97 */
+ L(1.40625000000000015550032422969330356E-01), /* 3ffc20000000000008f6c79d8928c000 */
+ L(7.80972982879849783680252962992639832E-33), /* 3f9444674acf2b3225c7647e0d95edf3 */
+ L(1.44531250000000012402535562111122522E-01), /* 3ffc28000000000007264a8bc1ff1000 */
+ L(2.79662468716455159585514763921671876E-32), /* 3f96226b095bd78aa650faf95a221993 */
+ L(1.48437500000000007761020440087419948E-01), /* 3ffc3000000000000479530ff8fe3000 */
+ L(2.15518492972728435680556239996258527E-32), /* 3f95bf9d49295e73a957906a029768cb */
+ L(1.52343750000000001733189947520484032E-01), /* 3ffc38000000000000ffc6109f71f000 */
+ L(8.34032236093545825619420380704500188E-33), /* 3f945a71851226a1d0ce5e656693153e */
+ L(1.56249999999999988073295321246958484E-01), /* 3ffc3ffffffffffff91fedd62ae0f000 */
+ L(2.44119337150624789345260194989620908E-32), /* 3f95fb041a57bc1c1280680ac1620bea */
+ L(1.60156250000000002076894210913572460E-01), /* 3ffc48000000000001327ed84a199000 */
+ L(-7.36124501128859978061216696286151753E-33), /* bf9431c62f01e59d2c1e00f195a0037f */
+ L(1.64062500000000000950861276373482172E-01), /* 3ffc500000000000008c5285fba85000 */
+ L(-4.80566184447001164583855800470217373E-33), /* bf938f3d1fcafd390f22f80e6c19421f */
+ L(1.67968749999999989878071706155265999E-01), /* 3ffc57fffffffffffa2a445c548c5000 */
+ L(-4.42154428718618459799673088733365064E-32), /* bf96cb28cf1c1b28006d53ffe633b22a */
+ L(1.71874999999999999459734108403218175E-01), /* 3ffc5fffffffffffffb04554e9dd4000 */
+ L(-3.29736288190321377985697972236270628E-32), /* bf96566af0ebc852e84be12859b24a31 */
+ L(1.75781249999999997987525759778901845E-01), /* 3ffc67fffffffffffed702df6ffff000 */
+ L(-1.28800728638468399687523924685844352E-32), /* bf950b8236b88ca0c1b739dc91a7e3fc */
+ L(1.79687500000000004929565820437175783E-01), /* 3ffc70000000000002d779bb32d2e000 */
+ L(1.60624461317978482424582320675174225E-32), /* 3f954d9a9cc0c963fd081f3dc922d04e */
+ L(1.83593750000000016873727045739708856E-01), /* 3ffc78000000000009ba1f6263c9a000 */
+ L(-3.83390389582056606880506003118452558E-32), /* bf968e22a5d826f77f19ee788474df22 */
+ L(1.87500000000000013443068740761666872E-01), /* 3ffc80000000000007bfd8c72a1bf000 */
+ L(-2.74141662712926256150154726565203091E-32), /* bf961caf5ac59c7f941f928e324c2cc1 */
+ L(1.91406249999999981494101786848611970E-01), /* 3ffc87fffffffffff55502eeae001000 */
+ L(3.68992437075565165346469517256118001E-32), /* 3f967f2f03f9096793372a27b92ad79d */
+ L(1.95312499999999989069921848800501648E-01), /* 3ffc8ffffffffffff9b3015280394000 */
+ L(3.69712249337856518452988332367785220E-32), /* 3f967fee5fdb5bd501ff93516999faa0 */
+ L(1.99218750000000021148042946919300804E-01), /* 3ffc9800000000000c30e67939095000 */
+ L(2.50142536781142175091322844848566649E-32), /* 3f9603c34ae58e10b300b07137ee618a */
+ L(2.03124999999999977732559198825437141E-01), /* 3ffc9ffffffffffff329e7df079e4000 */
+ L(-2.41951877287895024779300892731537816E-32), /* bf95f683aefe6965f080df8f59dd34a1 */
+ L(2.07031249999999996744030653771913124E-01), /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ L(-1.94346475904454000031592792989765585E-32), /* bf9593a44f87870a3d100d498501ecc7 */
+ L(2.10937500000000000251399259834392298E-01), /* 3ffcb000000000000025199873310000 */
+ L(-1.33528748788094249098998693871759411E-33), /* bf91bbb9b25c813668d6103d08acac35 */
+ L(2.14843749999999993936323609611875097E-01), /* 3ffcb7fffffffffffc8128c866236000 */
+ L(1.14839877977014974625242788556545292E-32), /* 3f94dd06b4655c9b83a1305b240e7a42 */
+ L(2.18750000000000015181732784749663837E-01), /* 3ffcc0000000000008c06da5fff24000 */
+ L(1.42689085313142539755499441881408391E-32), /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+ L(2.22656249999999992172647770539596569E-01), /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ L(-3.34421462850496887359128610229650547E-32), /* bf965b487962b5c2d9056ca6ac0c2e5c */
+ L(2.26562499999999989595607223847082419E-01), /* 3ffccffffffffffffa0095277be5c000 */
+ L(-3.08983588107248752517344356508205569E-32), /* bf9640dded57157f8eded311213bdbcd */
+ L(2.30468749999999979130462438434567117E-01), /* 3ffcd7fffffffffff3f8332996560000 */
+ L(-3.01407539802851697849105682795217019E-32), /* bf9638ffde35dbdfe1a1ffe45185de5d */
+ L(2.34375000000000012194252337217891971E-01), /* 3ffce0000000000007078dd402c86000 */
+ L(-8.46879710915628592284714319904522657E-33), /* bf945fc7b29a2ac6c9eff9eb258a510f */
+ L(2.38281249999999982991877076137149870E-01), /* 3ffce7fffffffffff6320b486eece000 */
+ L(-2.93563878880439245627127095245798544E-32), /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+ L(2.42187499999999981447559841442773990E-01), /* 3ffceffffffffffff54e24a09a8d5000 */
+ L(-4.56766746558806021264215486909850481E-32), /* bf96da556dee11f3113e5a3467b908e6 */
+ L(2.46093749999999991067720539980207318E-01), /* 3ffcf7fffffffffffad9d405dcb5d000 */
+ L(2.14033004219908074003010247652128251E-32), /* 3f95bc8776e8f9ae098884aa664cc3df */
+ L(2.50000000000000016613825838126835953E-01), /* 3ffd00000000000004c9e24c12bb3000 */
+ L(2.57617532593749185996714235009382870E-32), /* 3f960b867cc01178c0ec68226c6cb47d */
+ L(2.53906250000000013372004437827044321E-01), /* 3ffd04000000000003daae05b3168000 */
+ L(7.20177123439204414298152646284640101E-32), /* 3f9775eff59ddad7e7530b83934af87f */
+ L(2.57812499999999995765234725413886085E-01), /* 3ffd07fffffffffffec7878bad9d5000 */
+ L(6.51253187532920882777046064603770602E-32), /* 3f975226659ca241402e71c2011583b0 */
+ L(2.61718750000000007647689994011222248E-01), /* 3ffd0c000000000002344cc793a0f000 */
+ L(3.02370610028725823590045201871491395E-32), /* 3f9639ffe55fa2fa011674448b4e5b96 */
+ L(2.65624999999999986893899042596554269E-01), /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ L(-2.07683715950724761146070082510569258E-32), /* bf95af579a92e872fef81abfdf06bae8 */
+ L(2.69531249999999979842788204900639327E-01), /* 3ffd13fffffffffffa30a908d67db000 */
+ L(8.71465252506557329027658736641075706E-32), /* 3f97c47d99e19830447a42b1c0ffac61 */
+ L(2.73437500000000006712165837793818271E-01), /* 3ffd18000000000001ef453a58edb000 */
+ L(-6.62704045767568912140550474455810301E-32), /* bf9758187a204dcb06ece46588aeeaba */
+ L(2.77343749999999994411329302988535617E-01), /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ L(-4.87273466291944117406493607771338767E-32), /* bf96fa0381b0844a0be46bac2d673f0c */
+ L(2.81250000000000012677892447379453135E-01), /* 3ffd20000000000003a7769e125d6000 */
+ L(-8.55871796664700790726282049552906783E-32), /* bf97bc64e01332cf7616b0091b8dff2c */
+ L(2.85156249999999998558643013736363981E-01), /* 3ffd23ffffffffffff95a5894bccf000 */
+ L(-1.33068334720606220176455289635046875E-32), /* bf95145f43290ecf5b7adcb24697bc73 */
+ L(2.89062500000000008831431235621753924E-01), /* 3ffd280000000000028ba504fac59000 */
+ L(-9.34157398616814623985483776710704237E-32), /* bf97e50ad1115b941fcb5f0c88a428f7 */
+ L(2.92968750000000019840235286110877063E-01), /* 3ffd2c000000000005b7f372d184f000 */
+ L(4.99302093775173155906059132992249671E-33), /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+ L(2.96875000000000015867911730971630513E-01), /* 3ffd3000000000000492d860c79db000 */
+ L(7.86107787827057767235127454590866211E-33), /* 3f944689517ee8f16cdb97d6a6938f32 */
+ L(3.00781250000000015814100002286124758E-01), /* 3ffd340000000000048edfe73a17d000 */
+ L(-1.65419431293024229981937172317171504E-32), /* bf9557900e3efca16c89646b57f68dc0 */
+ L(3.04687499999999985213157159965287195E-01), /* 3ffd37fffffffffffbbcec6f99b36000 */
+ L(9.68753602893894024018934325652944198E-32), /* 3f97f70170e5458660c33a7e8d43d049 */
+ L(3.08593749999999989969324338045156215E-01), /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+ L(7.10268609610294706092252562643261106E-32), /* 3f9770cae45cdf615010401a4b37d8d4 */
+ L(3.12500000000000002971606591018488854E-01), /* 3ffd40000000000000db440fbc06b000 */
+ L(6.38924218802905979887732294952782964E-32), /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+ L(3.16406250000000006594921047402056305E-01), /* 3ffd44000000000001e69e8954814000 */
+ L(3.96079878754651470094149874444850097E-32), /* 3f969b5017b9fa7a1e86975258c73d3d */
+ L(3.20312500000000006713799366908329147E-01), /* 3ffd48000000000001ef64159c065000 */
+ L(-1.86401314975634286055150437995880517E-32), /* bf958323f0434911794e5fb8bfe136ba */
+ L(3.24218749999999987061246567584951210E-01), /* 3ffd4bfffffffffffc4549db9b928000 */
+ L(-3.18643523744758601387071062700407431E-32), /* bf964ae5fa7e26c2c3981bed12e14372 */
+ L(3.28124999999999991782776266707412953E-01), /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ L(-4.46964199751314296839915534813144652E-32), /* bf96d0277729ffd74727150df6d15547 */
+ L(3.32031250000000000393816557756032682E-01), /* 3ffd540000000000001d0efc04fad000 */
+ L(-9.03246333902065439930373230002688649E-33), /* bf947731a008748cc6dee948839ef7ae */
+ L(3.35937499999999983810482995064392173E-01), /* 3ffd57fffffffffffb556cab8ae61000 */
+ L(5.27742727066129518825981597650621794E-32), /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+ L(3.39843750000000004310441349760912471E-01), /* 3ffd5c0000000000013e0def5ddc4000 */
+ L(-3.85927263474732591932884416445586106E-32), /* bf9690c51088ef3db9ca000829c450c2 */
+ L(3.43749999999999990248130003997484364E-01), /* 3ffd5ffffffffffffd3070624a0af000 */
+ L(9.62005170171527308106468341512327487E-34), /* 3f913fae595cea84432eb01430817fca */
+ L(3.47656250000000004085726414568625697E-01), /* 3ffd640000000000012d79309e291000 */
+ L(-6.59664093705705297250259434519072507E-32), /* bf97568465eafb0e662e64a5dbfaf35f */
- -1.98364257812501251077851763965418372E-03L, /* bff6040000000001cd90f658cf0b1000 */
- -3.71984513103117734260309047540278737E-34L, /* bf8fee73c54483194782aac4a6154d11 */
- -1.95312500000000378520649630233891879E-03L, /* bff60000000000008ba643bb5e2e8000 */
- -1.12194202736719050440745599339855038E-34L, /* bf8e2a436aeff7bc529873354f47a3f5 */
- -1.92260742187499397430259771221991482E-03L, /* bff5f7fffffffffe4361cb51170da000 */
- -2.30068299876822157331268484824540848E-34L, /* bf8f31d02f85cfe8c0cc02276ce0f437 */
- -1.89208984375001137424603270262074989E-03L, /* bff5f0000000000347456ed490c23000 */
- -1.15012507244426243338260435466985403E-34L, /* bf8e31c174d5677a937a34ad8d2a70b4 */
- -1.86157226562500172319250342061336738E-03L, /* bff5e800000000007f262fa3617b4000 */
- -3.12438344643346437509767736937785561E-34L, /* bf8f9f4d426a2457c273d34ef7d9bde9 */
- -1.83105468749999505256246872355430379E-03L, /* bff5dffffffffffe92f18c1c2b6fa000 */
- -5.91130415288336591179087455220308942E-35L, /* bf8d3a4c80b42dc036bae446c9807f78 */
- -1.80053710937499445182387245573120522E-03L, /* bff5d7fffffffffe669dea82b4a4c000 */
- -1.92396289352411531324908916321392100E-34L, /* bf8eff7a2123fb573ba9778550d669bd */
- -1.77001953125000387737631542516323906E-03L, /* bff5d000000000011e19915c3ddb7000 */
- 7.91101758977203355387806553469731354E-36L, /* 3f8a507f5a70faaccf469e3461873dea */
- -1.73950195312500034854670281415554486E-03L, /* bff5c8000000000019b7dc6ef97bd000 */
- 1.55906551582436824067407021178835755E-34L, /* 3f8e9e7880333e34955aebcde3cfb053 */
- -1.70898437499998955782591472611429852E-03L, /* bff5bffffffffffcfd80e88aa6b96000 */
- 8.22951661962611381718215899498500357E-35L, /* 3f8db58e6031a779b59f6ece191de7cc */
- -1.67846679687500586652037711131708544E-03L, /* bff5b80000000001b0df6fd21c133000 */
- -8.96642618848426299713145894522897419E-35L, /* bf8ddcbcab46d531801bfae4121f2f8a */
- -1.64794921875000109499161354039904782E-03L, /* bff5b0000000000050cbce8915575000 */
- -2.88077905394253859590587789680486639E-34L, /* bf8f7eebd4dd860ef73b674d5e707959 */
- -1.61743164062501133830507079150388351E-03L, /* bff5a80000000003449e8700c3e82000 */
- -3.68271725851639066312899986829350273E-34L, /* bf8fe9845fe20a5fe74059e0cae185d6 */
- -1.58691406249999015546015764131101956E-03L, /* bff59ffffffffffd2999e668cdd28000 */
- 8.48197657099957029953716507898788812E-35L, /* 3f8dc2faaebb97392e451b07b28c4b12 */
- -1.55639648437500317366570219290722587E-03L, /* bff5980000000000ea2cd9a40d256000 */
- -3.45156704719737676412949957712570373E-36L, /* bf8925a079505516c8e317ac1ff53255 */
- -1.52587890625000568759013197767046039E-03L, /* bff5900000000001a3ab8a3f6b698000 */
- -1.01902948542497496574967177677556729E-34L, /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
- -1.49536132812500945889014955936485340E-03L, /* bff5880000000002b9f1621b57743000 */
- -3.32264697086631598830366079048117140E-34L, /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
- -1.46484374999999931883259902869504725E-03L, /* bff57fffffffffffcdbd1c90e1b4a000 */
- -1.76487524793892929381101031660811433E-34L, /* bf8ed52f2f724bc1ae870b18356337b4 */
- -1.43432617187498876325946983333888768E-03L, /* bff577fffffffffcc2dff8faa5570000 */
- -3.54550084538495708816233114576143814E-34L, /* bf8fd74724576915868c1e8ce9f430f1 */
- -1.40380859374999215367421282192718062E-03L, /* bff56ffffffffffdbd0b18aac65ed000 */
- -1.90585907028351204486765167064669639E-34L, /* bf8efaaa0c0e23e50c11b2120348054f */
- -1.37329101562499692341771212945644892E-03L, /* bff567ffffffffff1cfd00f1b0577000 */
- -3.59631150411372589637918252836880320E-34L, /* bf8fde08239ac74942a46298ea4fb715 */
- -1.34277343749999137467356674296739172E-03L, /* bff55ffffffffffd839030b05d53d000 */
- -1.49571076125940368185068762485268117E-35L, /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
- -1.31225585937499247038404301859788734E-03L, /* bff557fffffffffdd469936e691e3000 */
- 3.10375845385355395586146533282311300E-34L, /* 3f8f9c8f6d63b7a4145716ffd92491fb */
- -1.28173828124999024755581675764821898E-03L, /* bff54ffffffffffd306589b0ab21d000 */
- -1.98541096105909793397376077900810019E-34L, /* bf8f07e808bbb1e35106c294ffbb9687 */
- -1.25122070312500340204619591143332523E-03L, /* bff5480000000000fb06d5f16ad2c000 */
- 3.62884195935761446237911443317457521E-34L, /* 3f8fe25b17d623178a386a6fa6c5afb2 */
- -1.22070312499999591578388993012071279E-03L, /* bff53ffffffffffed2a356c440074000 */
- -2.96756662615653130862526710937493307E-35L, /* bf8c3b90d8ff2a991e5bd16718fb0645 */
- -1.19018554687498821966212632349422735E-03L, /* bff537fffffffffc9ac3b585dda89000 */
- 1.44659971891167323357060028901142644E-34L, /* 3f8e809279ab249edf1dad9fe13fb0bf */
- -1.15966796875000160938908064907298384E-03L, /* bff530000000000076c0800db9639000 */
- 2.50088010538742402346270685365928513E-34L, /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
- -1.12915039062500267151512523291939657E-03L, /* bff5280000000000c51f7e7315137000 */
- 7.56402096465615210500092443924888831E-35L, /* 3f8d922c1e485d99aea2668ed32b55a6 */
- -1.09863281249998665006360103291051571E-03L, /* bff51ffffffffffc26f2d4c9ce2ba000 */
- 1.43982174467233642713619821353592061E-34L, /* 3f8e7ec530b3d92b6303bec1c81214d1 */
- -1.06811523437500522742248711752028025E-03L, /* bff518000000000181b7380f10446000 */
- 5.41265133745862349181293024531133174E-35L, /* 3f8d1fc9313d018b30e790e06b6be723 */
- -1.03759765624999980942114138999770552E-03L, /* bff50ffffffffffff1f01130490e1000 */
- 1.21525139612685854366189534669623436E-34L, /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
- -1.00708007812499602697537601515759439E-03L, /* bff507fffffffffedad7afcce7051000 */
- 1.00020246351201558505328236381833392E-34L, /* 3f8e09e640992512b1300744a7e984ed */
- -9.76562499999992592487302113340463694E-04L, /* bff4fffffffffffbbad8151f8adf6000 */
- -1.64984406575162932060422892046851002E-34L, /* bf8eb69a919986e8054b86fc34300f24 */
- -9.46044921874989085824996924138179594E-04L, /* bff4effffffffff9b55a204fd9792000 */
- -9.29539174108308550334255350011347171E-35L, /* bf8dee3a50ed896b4656fa577a1df3d7 */
- -9.15527343750013735214860599791540029E-04L, /* bff4e00000000007eaf5bf103f82d000 */
- 3.07557018309280519949818825519490586E-35L, /* 3f8c470cfbef77d32c74cb8042f6ee81 */
- -8.85009765625012292294986105781516428E-04L, /* bff4d000000000071605c65403b97000 */
- 4.77499983783821950338363358545463558E-35L, /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
- -8.54492187499986941239470706817188192E-04L, /* bff4bffffffffff878ddf9cab264a000 */
- -1.60128240346239526958630011447901568E-34L, /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
- -8.23974609374996290174598690241743810E-04L, /* bff4affffffffffddc86c249ebe06000 */
- 1.61677540391961912631535763471935882E-34L, /* 3f8eadd00841366b0dc2bc262c2c8c36 */
- -7.93457031249988696952538334288757473E-04L, /* bff49ffffffffff97bf6f0aa85a5f000 */
- 1.22318577008381887076634753347515709E-34L, /* 3f8e452db5b5d250878f71040da06d14 */
- -7.62939453124996723316499040007097041E-04L, /* bff48ffffffffffe1c7265b431108000 */
- -1.03845161748762410745671891558398468E-34L, /* bf8e14115ad884c96d1a820c73647220 */
- -7.32421874999998242520117923997325794E-04L, /* bff47ffffffffffefca4498b7aa8a000 */
- 5.64005211953031009549514026639438083E-35L, /* 3f8d2be06950f68f1a6d8ff829a6928e */
- -7.01904296874999772890934814265622012E-04L, /* bff46fffffffffffde7c0fe5d8041000 */
- 5.90245467325173644235991233229525762E-35L, /* 3f8d39d40cc49002189243c194b1db0e */
- -6.71386718750008699269643939210658742E-04L, /* bff460000000000503c91d798b60c000 */
- -5.20515801723324452151498579012322191E-35L, /* bf8d14c0f08a6a9285b32b8bda003eb5 */
- -6.40869140625005499535275057463709988E-04L, /* bff45000000000032b969184e9751000 */
- -6.69469163285461870099846471658294534E-35L, /* bf8d63f36bab7b24d936c9380e3d3fa6 */
- -6.10351562499999293780097329596079841E-04L, /* bff43fffffffffff97c7c433e35ed000 */
- -1.16941808547394177991845382085515086E-34L, /* bf8e36e27886f10b234a7dd8fc588bf0 */
- -5.79833984375000068291972326409994795E-04L, /* bff43000000000000a13ff6dcf2bf000 */
- 1.17885044988246219185041488459766001E-34L, /* 3f8e3964677e001a00412aab52790842 */
- -5.49316406249990904622170867910987793E-04L, /* bff41ffffffffffac1c25739c716b000 */
- -3.31875702128137033065075734368960972E-35L, /* bf8c60e928d8982c3c99aef4f885a121 */
- -5.18798828125011293653756992177727236E-04L, /* bff410000000000682a62cff36775000 */
- -5.69971237642088463334239430962628187E-35L, /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
- -4.88281249999990512232251384917893121E-04L, /* bff3fffffffffff50fb48992320df000 */
- 1.02144616714408655325510171265051108E-35L, /* 3f8ab279a3626612710b9b3ac71734ac */
- -4.57763671874997554564967307956493434E-04L, /* bff3dffffffffffd2e3c272e3cca9000 */
- -8.25484058867957231164162481843653503E-35L, /* bf8db6e71158e7bf93e2e683f07aa841 */
- -4.27246093749991203999790346349633286E-04L, /* bff3bffffffffff5dbe103cba0eb2000 */
- -3.51191203319375193921924105905691755E-35L, /* bf8c757356d0f3dd7fbefc0dd419ab50 */
- -3.96728515624986649402960638705483281E-04L, /* bff39ffffffffff09b996882706ec000 */
- -5.51925962073095883016589497244931171E-36L, /* bf89d586d49f22289cfc860bebb99056 */
- -3.66210937499999945095511981300980754E-04L, /* bff37fffffffffffefcb88bfc7df6000 */
- -2.11696465278144529364423332249588595E-35L, /* bf8bc23a84d28e5496c874ef9833be25 */
- -3.35693359374992480958458008559640163E-04L, /* bff35ffffffffff754c548a8798f2000 */
- -8.58941791799705081104736787493668352E-35L, /* bf8dc8b1192fb7c3662826d43acb7c68 */
- -3.05175781250009811036303273640122156E-04L, /* bff340000000000b4fb4f1aad1c76000 */
- -8.61173897858769926480551302277426632E-35L, /* bf8dc9e0eabb1c0b33051011b64769fa */
- -2.74658203124987298321920308390303850E-04L, /* bff31ffffffffff15b2056ac252fd000 */
- 3.35152809454778381053519808988046631E-37L, /* 3f85c82fb59ff8d7c80d44e635420ab1 */
- -2.44140624999999992770514819575735516E-04L, /* bff2fffffffffffffbbb82d6a7636000 */
- 3.54445837111124472730013879165516908E-35L, /* 3f8c78e955b01378be647b1c92aa9a77 */
- -2.13623046875012756463165168672749438E-04L, /* bff2c0000000001d6a1635fea6bbf000 */
- 1.50050816288650121729916777279129473E-35L, /* 3f8b3f1f6f616a61129a58e131cbd31d */
- -1.83105468749991323078784464300306893E-04L, /* bff27fffffffffebfe0cbd0c82399000 */
- -9.14919506501448661140572099029756008E-37L, /* bf873754bacaa9d9513b6127e791eb47 */
- -1.52587890625013337032336300236461546E-04L, /* bff240000000001ec0cb57f2cc995000 */
- 2.84906084373176180870418394956384516E-35L, /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
- -1.22070312499990746786116828458007518E-04L, /* bff1ffffffffffd553bbb49f35a34000 */
- 6.71618008964968339584520728412444537E-36L, /* 3f8a1dacb99c60071fc9cd2349495bf0 */
- -9.15527343750029275602791047595142231E-05L, /* bff180000000000d8040cd6ecde28000 */
- -1.95753652091078750312541716951402172E-35L, /* bf8ba0526cfb24d8d59122f1c7a09a14 */
- -6.10351562499913258461494008080572701E-05L, /* bff0ffffffffffaffebbb92d7f6a9000 */
- 5.69868489273961111703398456218119973E-36L, /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
- -3.05175781250092882818419203884960853E-05L, /* bff0000000000055ab55de88fac1d000 */
- 9.03341100018476837609128961872915953E-36L, /* 3f8a803d229fa3a0e834a63abb06662b */
+ L(-1.98364257812501251077851763965418372E-03), /* bff6040000000001cd90f658cf0b1000 */
+ L(-3.71984513103117734260309047540278737E-34), /* bf8fee73c54483194782aac4a6154d11 */
+ L(-1.95312500000000378520649630233891879E-03), /* bff60000000000008ba643bb5e2e8000 */
+ L(-1.12194202736719050440745599339855038E-34), /* bf8e2a436aeff7bc529873354f47a3f5 */
+ L(-1.92260742187499397430259771221991482E-03), /* bff5f7fffffffffe4361cb51170da000 */
+ L(-2.30068299876822157331268484824540848E-34), /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ L(-1.89208984375001137424603270262074989E-03), /* bff5f0000000000347456ed490c23000 */
+ L(-1.15012507244426243338260435466985403E-34), /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ L(-1.86157226562500172319250342061336738E-03), /* bff5e800000000007f262fa3617b4000 */
+ L(-3.12438344643346437509767736937785561E-34), /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ L(-1.83105468749999505256246872355430379E-03), /* bff5dffffffffffe92f18c1c2b6fa000 */
+ L(-5.91130415288336591179087455220308942E-35), /* bf8d3a4c80b42dc036bae446c9807f78 */
+ L(-1.80053710937499445182387245573120522E-03), /* bff5d7fffffffffe669dea82b4a4c000 */
+ L(-1.92396289352411531324908916321392100E-34), /* bf8eff7a2123fb573ba9778550d669bd */
+ L(-1.77001953125000387737631542516323906E-03), /* bff5d000000000011e19915c3ddb7000 */
+ L(7.91101758977203355387806553469731354E-36), /* 3f8a507f5a70faaccf469e3461873dea */
+ L(-1.73950195312500034854670281415554486E-03), /* bff5c8000000000019b7dc6ef97bd000 */
+ L(1.55906551582436824067407021178835755E-34), /* 3f8e9e7880333e34955aebcde3cfb053 */
+ L(-1.70898437499998955782591472611429852E-03), /* bff5bffffffffffcfd80e88aa6b96000 */
+ L(8.22951661962611381718215899498500357E-35), /* 3f8db58e6031a779b59f6ece191de7cc */
+ L(-1.67846679687500586652037711131708544E-03), /* bff5b80000000001b0df6fd21c133000 */
+ L(-8.96642618848426299713145894522897419E-35), /* bf8ddcbcab46d531801bfae4121f2f8a */
+ L(-1.64794921875000109499161354039904782E-03), /* bff5b0000000000050cbce8915575000 */
+ L(-2.88077905394253859590587789680486639E-34), /* bf8f7eebd4dd860ef73b674d5e707959 */
+ L(-1.61743164062501133830507079150388351E-03), /* bff5a80000000003449e8700c3e82000 */
+ L(-3.68271725851639066312899986829350273E-34), /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ L(-1.58691406249999015546015764131101956E-03), /* bff59ffffffffffd2999e668cdd28000 */
+ L(8.48197657099957029953716507898788812E-35), /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ L(-1.55639648437500317366570219290722587E-03), /* bff5980000000000ea2cd9a40d256000 */
+ L(-3.45156704719737676412949957712570373E-36), /* bf8925a079505516c8e317ac1ff53255 */
+ L(-1.52587890625000568759013197767046039E-03), /* bff5900000000001a3ab8a3f6b698000 */
+ L(-1.01902948542497496574967177677556729E-34), /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ L(-1.49536132812500945889014955936485340E-03), /* bff5880000000002b9f1621b57743000 */
+ L(-3.32264697086631598830366079048117140E-34), /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ L(-1.46484374999999931883259902869504725E-03), /* bff57fffffffffffcdbd1c90e1b4a000 */
+ L(-1.76487524793892929381101031660811433E-34), /* bf8ed52f2f724bc1ae870b18356337b4 */
+ L(-1.43432617187498876325946983333888768E-03), /* bff577fffffffffcc2dff8faa5570000 */
+ L(-3.54550084538495708816233114576143814E-34), /* bf8fd74724576915868c1e8ce9f430f1 */
+ L(-1.40380859374999215367421282192718062E-03), /* bff56ffffffffffdbd0b18aac65ed000 */
+ L(-1.90585907028351204486765167064669639E-34), /* bf8efaaa0c0e23e50c11b2120348054f */
+ L(-1.37329101562499692341771212945644892E-03), /* bff567ffffffffff1cfd00f1b0577000 */
+ L(-3.59631150411372589637918252836880320E-34), /* bf8fde08239ac74942a46298ea4fb715 */
+ L(-1.34277343749999137467356674296739172E-03), /* bff55ffffffffffd839030b05d53d000 */
+ L(-1.49571076125940368185068762485268117E-35), /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ L(-1.31225585937499247038404301859788734E-03), /* bff557fffffffffdd469936e691e3000 */
+ L(3.10375845385355395586146533282311300E-34), /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ L(-1.28173828124999024755581675764821898E-03), /* bff54ffffffffffd306589b0ab21d000 */
+ L(-1.98541096105909793397376077900810019E-34), /* bf8f07e808bbb1e35106c294ffbb9687 */
+ L(-1.25122070312500340204619591143332523E-03), /* bff5480000000000fb06d5f16ad2c000 */
+ L(3.62884195935761446237911443317457521E-34), /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ L(-1.22070312499999591578388993012071279E-03), /* bff53ffffffffffed2a356c440074000 */
+ L(-2.96756662615653130862526710937493307E-35), /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ L(-1.19018554687498821966212632349422735E-03), /* bff537fffffffffc9ac3b585dda89000 */
+ L(1.44659971891167323357060028901142644E-34), /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ L(-1.15966796875000160938908064907298384E-03), /* bff530000000000076c0800db9639000 */
+ L(2.50088010538742402346270685365928513E-34), /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ L(-1.12915039062500267151512523291939657E-03), /* bff5280000000000c51f7e7315137000 */
+ L(7.56402096465615210500092443924888831E-35), /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ L(-1.09863281249998665006360103291051571E-03), /* bff51ffffffffffc26f2d4c9ce2ba000 */
+ L(1.43982174467233642713619821353592061E-34), /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ L(-1.06811523437500522742248711752028025E-03), /* bff518000000000181b7380f10446000 */
+ L(5.41265133745862349181293024531133174E-35), /* 3f8d1fc9313d018b30e790e06b6be723 */
+ L(-1.03759765624999980942114138999770552E-03), /* bff50ffffffffffff1f01130490e1000 */
+ L(1.21525139612685854366189534669623436E-34), /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ L(-1.00708007812499602697537601515759439E-03), /* bff507fffffffffedad7afcce7051000 */
+ L(1.00020246351201558505328236381833392E-34), /* 3f8e09e640992512b1300744a7e984ed */
+ L(-9.76562499999992592487302113340463694E-04), /* bff4fffffffffffbbad8151f8adf6000 */
+ L(-1.64984406575162932060422892046851002E-34), /* bf8eb69a919986e8054b86fc34300f24 */
+ L(-9.46044921874989085824996924138179594E-04), /* bff4effffffffff9b55a204fd9792000 */
+ L(-9.29539174108308550334255350011347171E-35), /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ L(-9.15527343750013735214860599791540029E-04), /* bff4e00000000007eaf5bf103f82d000 */
+ L(3.07557018309280519949818825519490586E-35), /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ L(-8.85009765625012292294986105781516428E-04), /* bff4d000000000071605c65403b97000 */
+ L(4.77499983783821950338363358545463558E-35), /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ L(-8.54492187499986941239470706817188192E-04), /* bff4bffffffffff878ddf9cab264a000 */
+ L(-1.60128240346239526958630011447901568E-34), /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ L(-8.23974609374996290174598690241743810E-04), /* bff4affffffffffddc86c249ebe06000 */
+ L(1.61677540391961912631535763471935882E-34), /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ L(-7.93457031249988696952538334288757473E-04), /* bff49ffffffffff97bf6f0aa85a5f000 */
+ L(1.22318577008381887076634753347515709E-34), /* 3f8e452db5b5d250878f71040da06d14 */
+ L(-7.62939453124996723316499040007097041E-04), /* bff48ffffffffffe1c7265b431108000 */
+ L(-1.03845161748762410745671891558398468E-34), /* bf8e14115ad884c96d1a820c73647220 */
+ L(-7.32421874999998242520117923997325794E-04), /* bff47ffffffffffefca4498b7aa8a000 */
+ L(5.64005211953031009549514026639438083E-35), /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ L(-7.01904296874999772890934814265622012E-04), /* bff46fffffffffffde7c0fe5d8041000 */
+ L(5.90245467325173644235991233229525762E-35), /* 3f8d39d40cc49002189243c194b1db0e */
+ L(-6.71386718750008699269643939210658742E-04), /* bff460000000000503c91d798b60c000 */
+ L(-5.20515801723324452151498579012322191E-35), /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ L(-6.40869140625005499535275057463709988E-04), /* bff45000000000032b969184e9751000 */
+ L(-6.69469163285461870099846471658294534E-35), /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ L(-6.10351562499999293780097329596079841E-04), /* bff43fffffffffff97c7c433e35ed000 */
+ L(-1.16941808547394177991845382085515086E-34), /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ L(-5.79833984375000068291972326409994795E-04), /* bff43000000000000a13ff6dcf2bf000 */
+ L(1.17885044988246219185041488459766001E-34), /* 3f8e3964677e001a00412aab52790842 */
+ L(-5.49316406249990904622170867910987793E-04), /* bff41ffffffffffac1c25739c716b000 */
+ L(-3.31875702128137033065075734368960972E-35), /* bf8c60e928d8982c3c99aef4f885a121 */
+ L(-5.18798828125011293653756992177727236E-04), /* bff410000000000682a62cff36775000 */
+ L(-5.69971237642088463334239430962628187E-35), /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ L(-4.88281249999990512232251384917893121E-04), /* bff3fffffffffff50fb48992320df000 */
+ L(1.02144616714408655325510171265051108E-35), /* 3f8ab279a3626612710b9b3ac71734ac */
+ L(-4.57763671874997554564967307956493434E-04), /* bff3dffffffffffd2e3c272e3cca9000 */
+ L(-8.25484058867957231164162481843653503E-35), /* bf8db6e71158e7bf93e2e683f07aa841 */
+ L(-4.27246093749991203999790346349633286E-04), /* bff3bffffffffff5dbe103cba0eb2000 */
+ L(-3.51191203319375193921924105905691755E-35), /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ L(-3.96728515624986649402960638705483281E-04), /* bff39ffffffffff09b996882706ec000 */
+ L(-5.51925962073095883016589497244931171E-36), /* bf89d586d49f22289cfc860bebb99056 */
+ L(-3.66210937499999945095511981300980754E-04), /* bff37fffffffffffefcb88bfc7df6000 */
+ L(-2.11696465278144529364423332249588595E-35), /* bf8bc23a84d28e5496c874ef9833be25 */
+ L(-3.35693359374992480958458008559640163E-04), /* bff35ffffffffff754c548a8798f2000 */
+ L(-8.58941791799705081104736787493668352E-35), /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ L(-3.05175781250009811036303273640122156E-04), /* bff340000000000b4fb4f1aad1c76000 */
+ L(-8.61173897858769926480551302277426632E-35), /* bf8dc9e0eabb1c0b33051011b64769fa */
+ L(-2.74658203124987298321920308390303850E-04), /* bff31ffffffffff15b2056ac252fd000 */
+ L(3.35152809454778381053519808988046631E-37), /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ L(-2.44140624999999992770514819575735516E-04), /* bff2fffffffffffffbbb82d6a7636000 */
+ L(3.54445837111124472730013879165516908E-35), /* 3f8c78e955b01378be647b1c92aa9a77 */
+ L(-2.13623046875012756463165168672749438E-04), /* bff2c0000000001d6a1635fea6bbf000 */
+ L(1.50050816288650121729916777279129473E-35), /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ L(-1.83105468749991323078784464300306893E-04), /* bff27fffffffffebfe0cbd0c82399000 */
+ L(-9.14919506501448661140572099029756008E-37), /* bf873754bacaa9d9513b6127e791eb47 */
+ L(-1.52587890625013337032336300236461546E-04), /* bff240000000001ec0cb57f2cc995000 */
+ L(2.84906084373176180870418394956384516E-35), /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ L(-1.22070312499990746786116828458007518E-04), /* bff1ffffffffffd553bbb49f35a34000 */
+ L(6.71618008964968339584520728412444537E-36), /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ L(-9.15527343750029275602791047595142231E-05), /* bff180000000000d8040cd6ecde28000 */
+ L(-1.95753652091078750312541716951402172E-35), /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ L(-6.10351562499913258461494008080572701E-05), /* bff0ffffffffffaffebbb92d7f6a9000 */
+ L(5.69868489273961111703398456218119973E-36), /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ L(-3.05175781250092882818419203884960853E-05), /* bff0000000000055ab55de88fac1d000 */
+ L(9.03341100018476837609128961872915953E-36), /* 3f8a803d229fa3a0e834a63abb06662b */
#define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
- 3.05175781249814607084128277672749162E-05L, /* 3feffffffffffeaa02abb9102f499000 */
- 1.00271855391179733380665816525889949E-36L, /* 3f8755351afa042ac3f58114824d4c10 */
- 6.10351562500179243748093427073421439E-05L, /* 3ff1000000000052a95de07a4c26d000 */
- 1.67231624299180373502350811501181670E-36L, /* 3f881c87a53691cae9d77f4e40d66616 */
- 9.15527343749970728685313252158399200E-05L, /* 3ff17ffffffffff28040cc2acde28000 */
- 2.43665747834893104318707597514407880E-36L, /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
- 1.22070312500027751961838150070880064E-04L, /* 3ff200000000003ffddde6c153b53000 */
- -1.73322146370624186623546452226755405E-35L, /* bf8b709d8d658ed5dbbe943de56ee84e */
- 1.52587890624995916105682628143179430E-04L, /* 3ff23ffffffffff6954b56e285d23000 */
- 1.23580432650945898349135528000443828E-35L, /* 3f8b06d396601dde16de7d7bc27346e6 */
- 1.83105468750008670314358488289621794E-04L, /* 3ff2800000000013fe0cdc8c823b7000 */
- 4.30446229148833293310207915930740796E-35L, /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
- 2.13623046875005741337455947623248132E-04L, /* 3ff2c0000000000d3d1662de21a3f000 */
- -3.96110759869520786681660669615255057E-35L, /* bf8ca5379b04ff4a31aab0ceacc917e6 */
- 2.44140624999981493573336463433440506E-04L, /* 3ff2ffffffffffd553bbdf48e0534000 */
- -1.39617373942387888957350179316792928E-35L, /* bf8b28eeedc286015802b63f96b8c5cd */
- 2.74658203124984920706309918754626834E-04L, /* 3ff31fffffffffee9d60c8439ec1d000 */
- -3.16168080483901830349738314447356223E-36L, /* bf890cf74f81c77a611abc1243812444 */
- 3.05175781250008648918265055410966055E-04L, /* 3ff3400000000009f8b5c9a346636000 */
- 8.54421306185008998867856704677221443E-35L, /* 3f8dc649cd40922fc08adc6b6b20ead0 */
- 3.35693359374988945462612499316774515E-04L, /* 3ff35ffffffffff34146c540f15b2000 */
- 7.96443137431639500475160850431097078E-35L, /* 3f8da77638ed3148fc4d99d1c9e13446 */
- 3.66210937500027690542093987739604535E-04L, /* 3ff380000000001fecce34bea89c4000 */
- 2.14507323877752361258862577769090367E-35L, /* 3f8bc834e554d38894cf91957b0253d3 */
- 3.96728515625003928083564943615052121E-04L, /* 3ff3a00000000004875d9a4acf6ab000 */
- 4.88358523466632050664019922448605508E-35L, /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
- 4.27246093750017799227172345607351585E-04L, /* 3ff3c00000000014856794c3ee850000 */
- 6.66520494592631402182216588784828935E-35L, /* 3f8d6262118fcdb59b8f16108f5f1a6c */
- 4.57763671875002108342364320152138181E-04L, /* 3ff3e000000000026e45d855410b9000 */
- 7.21799615960261390920033272189522298E-35L, /* 3f8d7fc645cff8879462296af975c9fd */
- 4.88281249999999768797631616370963356E-04L, /* 3ff3ffffffffffffbbc2d7cc004df000 */
- -5.30564629906905979452258114088325361E-35L, /* bf8d1a18b71929a30d67a217a27ae851 */
- 5.18798828124997339054881383202487041E-04L, /* 3ff40ffffffffffe775055eea5851000 */
- -4.03682911253647925867848180522846377E-35L, /* bf8cad44f0f3e5199d8a589d9332acad */
- 5.49316406249980511907933706754958501E-04L, /* 3ff41ffffffffff4c410b29bb62fb000 */
- -2.08166843948323917121806956728438051E-35L, /* bf8bbab8cf691403249fe5b699e25143 */
- 5.79833984374989593561576568548497165E-04L, /* 3ff42ffffffffffa0047df328d817000 */
- -1.72745033420153042445343706432627539E-34L, /* bf8ecb3c2d7d3a9e6e960576be901fdf */
- 6.10351562500008540711511259540838154E-04L, /* 3ff4400000000004ec62f54f8c271000 */
- 7.41889382604319545724663095428976499E-35L, /* 3f8d8a74c002c81a47c93b8e05d15f8e */
- 6.40869140625020444702875407535884986E-04L, /* 3ff450000000000bc91b09718515d000 */
- -4.47321009727305792048065440180490107E-35L, /* bf8cdbac5c8fe70822081d8993eb5cb6 */
- 6.71386718750007531635964622352684074E-04L, /* 3ff460000000000457792973db05c000 */
- 5.13698959677949336513874456684462092E-35L, /* 3f8d112114436949c5ef38d8049004ab */
- 7.01904296875006634673332887754430334E-04L, /* 3ff4700000000003d31adf2cb8b1d000 */
- -8.25665755717729437292989870760751482E-35L, /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
- 7.32421874999998244664170215504673504E-04L, /* 3ff47ffffffffffefcf5498bd5c8a000 */
- -5.64005234937832153139057628112753364E-35L, /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
- 7.62939453125017456345986752604096408E-04L, /* 3ff490000000000a101a1b093d4a8000 */
- -1.11084094120417622468550608896588329E-34L, /* bf8e274feabd2d94f6694507a46accb1 */
- 7.93457031249987558617598988993908016E-04L, /* 3ff49ffffffffff8d3f9dcab74bbf000 */
- -1.22966480225449015129079129940978828E-34L, /* bf8e46e6a65eef8fa9e42eddf3da305e */
- 8.23974609374997378723747633335135819E-04L, /* 3ff4affffffffffe7d2afbaa55b26000 */
- -1.62270010016794279091906973366704963E-34L, /* bf8eaf633f057ebdb664a34566401c4e */
- 8.54492187500023938282350821569920958E-04L, /* 3ff4c0000000000dccaabce399e59000 */
- -1.39076361712838158775374263169606160E-34L, /* bf8e71ba779364b3bbdba7841f2c4ca1 */
- 8.85009765624987932362186815286691297E-04L, /* 3ff4cffffffffff90b218886edc2a000 */
- 4.07328275060905585228261577392403980E-35L, /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
- 9.15527343749975579461305518559161974E-04L, /* 3ff4dffffffffff1ec2a21f25df33000 */
- 1.16855112459192484947855553716334015E-35L, /* 3f8af10bf319e9f5270cf249eeffbe5c */
- 9.46044921875016761584725882821122521E-04L, /* 3ff4f00000000009a992c46c16d71000 */
- 9.51660680007524262741115611071680436E-35L, /* 3f8df9fd56e81f8edf133843910ee831 */
- 9.76562499999974118878133088548272636E-04L, /* 3ff4fffffffffff1149edc46a6df6000 */
- -5.65271128977550656964071208289181661E-36L, /* bf89e0e12689dd721aa2314c81eb6429 */
- 1.00708007812498671732140389760347830E-03L, /* 3ff507fffffffffc2be94b90ed091000 */
- -1.43355074891483635310132767255371379E-34L, /* bf8e7d1a688c247b16022daab1316d55 */
- 1.03759765625002637786192745235343007E-03L, /* 3ff51000000000079a57b966bc158000 */
- 2.95905815240957629366749917020106928E-34L, /* 3f8f895387fc73bb38f8a1b254c01a60 */
- 1.06811523437500860568717813047520763E-03L, /* 3ff51800000000027afcd5b35f5e6000 */
- -5.98328495358586628195372356742878314E-35L, /* bf8d3e204130013bf6328f1b70ff8c76 */
- 1.09863281250001439958487251556220070E-03L, /* 3ff5200000000004268077c6c66bd000 */
- 2.41371837889426603334113000868144760E-34L, /* 3f8f40d6948edf864054ccf151f9815e */
- 1.12915039062501298413451613770002366E-03L, /* 3ff5280000000003be0f5dd8fe81b000 */
- -1.28815268997394164973472617519705703E-34L, /* bf8e567321172ea089dce4bc8354ecb7 */
- 1.15966796874997272036339054191407232E-03L, /* 3ff52ffffffffff8231e3bcfff1e8000 */
- 1.02996064554316248496839462594377804E-34L, /* 3f8e11cf7d402789244f68e2d4f985b1 */
- 1.19018554687502744121802585360546796E-03L, /* 3ff5380000000007e8cdf3f8f6c20000 */
- -1.43453217726255628994625761307322163E-34L, /* bf8e7d5d3370d85a374f5f4802fc517a */
- 1.22070312499997743541996266398850614E-03L, /* 3ff53ffffffffff97f0722561f454000 */
- -1.41086259180534339713692694428211646E-34L, /* bf8e77125519ff76244dfec5fbd58402 */
- 1.25122070312501024092560690174507039E-03L, /* 3ff5480000000002f3a59d8820691000 */
- 3.84102646020099293168698506729765213E-34L, /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
- 1.28173828124997986521442660131425390E-03L, /* 3ff54ffffffffffa3250a764439d9000 */
- 1.44644589735033114377952806106652650E-34L, /* 3f8e808801b80dcf38323cdbfdca2549 */
- 1.31225585937501665804856968749058137E-03L, /* 3ff5580000000004cd25a414c6d62000 */
- 1.67474574742200577294563576414361377E-34L, /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
- 1.34277343749997290265837386401818888E-03L, /* 3ff55ffffffffff83091b042cfd59000 */
- -1.55650565030381326742591837551559103E-34L, /* bf8e9dca490d7fecfadba9625ffb91c5 */
- 1.37329101562497720784949380297774268E-03L, /* 3ff567fffffffff96e3c7312f5ccf000 */
- 1.65279335325630026116581677369221748E-34L, /* 3f8eb763496f5bd7404f2298b402074f */
- 1.40380859374999099958354100336136647E-03L, /* 3ff56ffffffffffd67e2f09f2a381000 */
- 1.89919944388961890195706641264717076E-34L, /* 3f8ef8e4d0ffdfeba982aa8829501389 */
- 1.43432617187497484122173130998160625E-03L, /* 3ff577fffffffff8bf9c1d71af8a8000 */
- 2.57638517142061429772064578590009568E-34L, /* 3f8f5675d82c1cc4ada70fd3a957b89a */
- 1.46484374999999929342158925502052945E-03L, /* 3ff57fffffffffffcbdd1c7671b46000 */
- 1.76487201934184070490166772482073801E-34L, /* 3f8ed52ef732458f6e4c5c07504f33cc */
- 1.49536132812502318451070466256902933E-03L, /* 3ff5880000000006aeb7066c8ad43000 */
- 2.38068367275295804321313550609246656E-34L, /* 3f8f3c7277ae6fc390ace5e06c0b025b */
- 1.52587890625000448053340248672949543E-03L, /* 3ff59000000000014a9ae2104b3bc000 */
- 1.01174455568392813258454590274740959E-34L, /* 3f8e0cf7c434762991bb38e12acee215 */
- 1.55639648437501113499837053523090913E-03L, /* 3ff5980000000003359e2c204355e000 */
- -2.82398418808099749023517211651363693E-35L, /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
- 1.58691406249999937955142588308171026E-03L, /* 3ff59fffffffffffd2380ecbc87c2000 */
- -1.27361695572422741562701199136538047E-34L, /* bf8e5295e0e206dfb0f0266c07225448 */
- 1.61743164062498000531048954475329309E-03L, /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
- -1.22606548862580061633942923016222044E-34L, /* bf8e45f1b17bb61039d21a351bb207b8 */
- 1.64794921875001835451453858682255576E-03L, /* 3ff5b000000000054a52fa20f6565000 */
- 1.39132339594152335892305491425264583E-34L, /* 3f8e71e0904c5449b414ee49b191cef2 */
- 1.67846679687501263995029340691547953E-03L, /* 3ff5b80000000003a4a9e912c910b000 */
- 6.67245854693585315412242764786197029E-35L, /* 3f8d62c4ccac1e7511a617d469468ccd */
- 1.70898437500002646861403514115369655E-03L, /* 3ff5c00000000007a109fbaa7e015000 */
- 6.87367172354719289559624829652240928E-36L, /* 3f8a245fa835eceb42bae8128d9336db */
- 1.73950195312501174308226096992992128E-03L, /* 3ff5c80000000003627c8d637a005000 */
- -2.20824271875474985927385878948759352E-34L, /* bf8f25869b1cbefb25e735992f232f57 */
- 1.77001953124997491747605207736194513E-03L, /* 3ff5cffffffffff8c53c84b6883b8000 */
- 3.43123048533596296514343180408963705E-34L, /* 3f8fc816b91d173ddadbbf09b1287906 */
- 1.80053710937497698911127570705069398E-03L, /* 3ff5d7fffffffff95e1899f4a8430000 */
- 3.99231237340890073475077494556136100E-35L, /* 3f8ca889148f62fa854da5674df41279 */
- 1.83105468750002267094899598630423914E-03L, /* 3ff5e0000000000688d21e62ba674000 */
- -3.22274595655810623999007524769365273E-34L, /* bf8fac605cb9ae01eb719675ced25560 */
- 1.86157226562500499224728040579690330E-03L, /* 3ff5e80000000001705ce28a6d89e000 */
- 3.07094985075881613489605622068441083E-34L, /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
- 1.89208984374998234666824993196980949E-03L, /* 3ff5effffffffffae969fdc7cd8cf000 */
- -3.06287628722973914692165056776495733E-34L, /* bf8f9720477d9cfa10e464df7f91020c */
- 1.92260742187501225343755557292811682E-03L, /* 3ff5f800000000038824e428ed49a000 */
- 6.30049124729794620592961282769623368E-35L, /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
- 1.95312499999998514894032051116231258E-03L, /* 3ff5fffffffffffbb82f6a04f1ae0000 */
- -6.14610057507500948543216998736262902E-35L, /* bf8d46c862d39255370e7974d48daa7e */
- 1.98364257812501222021119324146882732E-03L, /* 3ff6040000000001c2d8a1aa5188d000 */
- 3.71942298418113774118754986159801984E-34L, /* 3f8fee6567d9940495519ffe62cbc9a4 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+ L(3.05175781249814607084128277672749162E-05), /* 3feffffffffffeaa02abb9102f499000 */
+ L(1.00271855391179733380665816525889949E-36), /* 3f8755351afa042ac3f58114824d4c10 */
+ L(6.10351562500179243748093427073421439E-05), /* 3ff1000000000052a95de07a4c26d000 */
+ L(1.67231624299180373502350811501181670E-36), /* 3f881c87a53691cae9d77f4e40d66616 */
+ L(9.15527343749970728685313252158399200E-05), /* 3ff17ffffffffff28040cc2acde28000 */
+ L(2.43665747834893104318707597514407880E-36), /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+ L(1.22070312500027751961838150070880064E-04), /* 3ff200000000003ffddde6c153b53000 */
+ L(-1.73322146370624186623546452226755405E-35), /* bf8b709d8d658ed5dbbe943de56ee84e */
+ L(1.52587890624995916105682628143179430E-04), /* 3ff23ffffffffff6954b56e285d23000 */
+ L(1.23580432650945898349135528000443828E-35), /* 3f8b06d396601dde16de7d7bc27346e6 */
+ L(1.83105468750008670314358488289621794E-04), /* 3ff2800000000013fe0cdc8c823b7000 */
+ L(4.30446229148833293310207915930740796E-35), /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+ L(2.13623046875005741337455947623248132E-04), /* 3ff2c0000000000d3d1662de21a3f000 */
+ L(-3.96110759869520786681660669615255057E-35), /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+ L(2.44140624999981493573336463433440506E-04), /* 3ff2ffffffffffd553bbdf48e0534000 */
+ L(-1.39617373942387888957350179316792928E-35), /* bf8b28eeedc286015802b63f96b8c5cd */
+ L(2.74658203124984920706309918754626834E-04), /* 3ff31fffffffffee9d60c8439ec1d000 */
+ L(-3.16168080483901830349738314447356223E-36), /* bf890cf74f81c77a611abc1243812444 */
+ L(3.05175781250008648918265055410966055E-04), /* 3ff3400000000009f8b5c9a346636000 */
+ L(8.54421306185008998867856704677221443E-35), /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+ L(3.35693359374988945462612499316774515E-04), /* 3ff35ffffffffff34146c540f15b2000 */
+ L(7.96443137431639500475160850431097078E-35), /* 3f8da77638ed3148fc4d99d1c9e13446 */
+ L(3.66210937500027690542093987739604535E-04), /* 3ff380000000001fecce34bea89c4000 */
+ L(2.14507323877752361258862577769090367E-35), /* 3f8bc834e554d38894cf91957b0253d3 */
+ L(3.96728515625003928083564943615052121E-04), /* 3ff3a00000000004875d9a4acf6ab000 */
+ L(4.88358523466632050664019922448605508E-35), /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+ L(4.27246093750017799227172345607351585E-04), /* 3ff3c00000000014856794c3ee850000 */
+ L(6.66520494592631402182216588784828935E-35), /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+ L(4.57763671875002108342364320152138181E-04), /* 3ff3e000000000026e45d855410b9000 */
+ L(7.21799615960261390920033272189522298E-35), /* 3f8d7fc645cff8879462296af975c9fd */
+ L(4.88281249999999768797631616370963356E-04), /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ L(-5.30564629906905979452258114088325361E-35), /* bf8d1a18b71929a30d67a217a27ae851 */
+ L(5.18798828124997339054881383202487041E-04), /* 3ff40ffffffffffe775055eea5851000 */
+ L(-4.03682911253647925867848180522846377E-35), /* bf8cad44f0f3e5199d8a589d9332acad */
+ L(5.49316406249980511907933706754958501E-04), /* 3ff41ffffffffff4c410b29bb62fb000 */
+ L(-2.08166843948323917121806956728438051E-35), /* bf8bbab8cf691403249fe5b699e25143 */
+ L(5.79833984374989593561576568548497165E-04), /* 3ff42ffffffffffa0047df328d817000 */
+ L(-1.72745033420153042445343706432627539E-34), /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+ L(6.10351562500008540711511259540838154E-04), /* 3ff4400000000004ec62f54f8c271000 */
+ L(7.41889382604319545724663095428976499E-35), /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+ L(6.40869140625020444702875407535884986E-04), /* 3ff450000000000bc91b09718515d000 */
+ L(-4.47321009727305792048065440180490107E-35), /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+ L(6.71386718750007531635964622352684074E-04), /* 3ff460000000000457792973db05c000 */
+ L(5.13698959677949336513874456684462092E-35), /* 3f8d112114436949c5ef38d8049004ab */
+ L(7.01904296875006634673332887754430334E-04), /* 3ff4700000000003d31adf2cb8b1d000 */
+ L(-8.25665755717729437292989870760751482E-35), /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+ L(7.32421874999998244664170215504673504E-04), /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ L(-5.64005234937832153139057628112753364E-35), /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+ L(7.62939453125017456345986752604096408E-04), /* 3ff490000000000a101a1b093d4a8000 */
+ L(-1.11084094120417622468550608896588329E-34), /* bf8e274feabd2d94f6694507a46accb1 */
+ L(7.93457031249987558617598988993908016E-04), /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ L(-1.22966480225449015129079129940978828E-34), /* bf8e46e6a65eef8fa9e42eddf3da305e */
+ L(8.23974609374997378723747633335135819E-04), /* 3ff4affffffffffe7d2afbaa55b26000 */
+ L(-1.62270010016794279091906973366704963E-34), /* bf8eaf633f057ebdb664a34566401c4e */
+ L(8.54492187500023938282350821569920958E-04), /* 3ff4c0000000000dccaabce399e59000 */
+ L(-1.39076361712838158775374263169606160E-34), /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+ L(8.85009765624987932362186815286691297E-04), /* 3ff4cffffffffff90b218886edc2a000 */
+ L(4.07328275060905585228261577392403980E-35), /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+ L(9.15527343749975579461305518559161974E-04), /* 3ff4dffffffffff1ec2a21f25df33000 */
+ L(1.16855112459192484947855553716334015E-35), /* 3f8af10bf319e9f5270cf249eeffbe5c */
+ L(9.46044921875016761584725882821122521E-04), /* 3ff4f00000000009a992c46c16d71000 */
+ L(9.51660680007524262741115611071680436E-35), /* 3f8df9fd56e81f8edf133843910ee831 */
+ L(9.76562499999974118878133088548272636E-04), /* 3ff4fffffffffff1149edc46a6df6000 */
+ L(-5.65271128977550656964071208289181661E-36), /* bf89e0e12689dd721aa2314c81eb6429 */
+ L(1.00708007812498671732140389760347830E-03), /* 3ff507fffffffffc2be94b90ed091000 */
+ L(-1.43355074891483635310132767255371379E-34), /* bf8e7d1a688c247b16022daab1316d55 */
+ L(1.03759765625002637786192745235343007E-03), /* 3ff51000000000079a57b966bc158000 */
+ L(2.95905815240957629366749917020106928E-34), /* 3f8f895387fc73bb38f8a1b254c01a60 */
+ L(1.06811523437500860568717813047520763E-03), /* 3ff51800000000027afcd5b35f5e6000 */
+ L(-5.98328495358586628195372356742878314E-35), /* bf8d3e204130013bf6328f1b70ff8c76 */
+ L(1.09863281250001439958487251556220070E-03), /* 3ff5200000000004268077c6c66bd000 */
+ L(2.41371837889426603334113000868144760E-34), /* 3f8f40d6948edf864054ccf151f9815e */
+ L(1.12915039062501298413451613770002366E-03), /* 3ff5280000000003be0f5dd8fe81b000 */
+ L(-1.28815268997394164973472617519705703E-34), /* bf8e567321172ea089dce4bc8354ecb7 */
+ L(1.15966796874997272036339054191407232E-03), /* 3ff52ffffffffff8231e3bcfff1e8000 */
+ L(1.02996064554316248496839462594377804E-34), /* 3f8e11cf7d402789244f68e2d4f985b1 */
+ L(1.19018554687502744121802585360546796E-03), /* 3ff5380000000007e8cdf3f8f6c20000 */
+ L(-1.43453217726255628994625761307322163E-34), /* bf8e7d5d3370d85a374f5f4802fc517a */
+ L(1.22070312499997743541996266398850614E-03), /* 3ff53ffffffffff97f0722561f454000 */
+ L(-1.41086259180534339713692694428211646E-34), /* bf8e77125519ff76244dfec5fbd58402 */
+ L(1.25122070312501024092560690174507039E-03), /* 3ff5480000000002f3a59d8820691000 */
+ L(3.84102646020099293168698506729765213E-34), /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+ L(1.28173828124997986521442660131425390E-03), /* 3ff54ffffffffffa3250a764439d9000 */
+ L(1.44644589735033114377952806106652650E-34), /* 3f8e808801b80dcf38323cdbfdca2549 */
+ L(1.31225585937501665804856968749058137E-03), /* 3ff5580000000004cd25a414c6d62000 */
+ L(1.67474574742200577294563576414361377E-34), /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+ L(1.34277343749997290265837386401818888E-03), /* 3ff55ffffffffff83091b042cfd59000 */
+ L(-1.55650565030381326742591837551559103E-34), /* bf8e9dca490d7fecfadba9625ffb91c5 */
+ L(1.37329101562497720784949380297774268E-03), /* 3ff567fffffffff96e3c7312f5ccf000 */
+ L(1.65279335325630026116581677369221748E-34), /* 3f8eb763496f5bd7404f2298b402074f */
+ L(1.40380859374999099958354100336136647E-03), /* 3ff56ffffffffffd67e2f09f2a381000 */
+ L(1.89919944388961890195706641264717076E-34), /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+ L(1.43432617187497484122173130998160625E-03), /* 3ff577fffffffff8bf9c1d71af8a8000 */
+ L(2.57638517142061429772064578590009568E-34), /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+ L(1.46484374999999929342158925502052945E-03), /* 3ff57fffffffffffcbdd1c7671b46000 */
+ L(1.76487201934184070490166772482073801E-34), /* 3f8ed52ef732458f6e4c5c07504f33cc */
+ L(1.49536132812502318451070466256902933E-03), /* 3ff5880000000006aeb7066c8ad43000 */
+ L(2.38068367275295804321313550609246656E-34), /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+ L(1.52587890625000448053340248672949543E-03), /* 3ff59000000000014a9ae2104b3bc000 */
+ L(1.01174455568392813258454590274740959E-34), /* 3f8e0cf7c434762991bb38e12acee215 */
+ L(1.55639648437501113499837053523090913E-03), /* 3ff5980000000003359e2c204355e000 */
+ L(-2.82398418808099749023517211651363693E-35), /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+ L(1.58691406249999937955142588308171026E-03), /* 3ff59fffffffffffd2380ecbc87c2000 */
+ L(-1.27361695572422741562701199136538047E-34), /* bf8e5295e0e206dfb0f0266c07225448 */
+ L(1.61743164062498000531048954475329309E-03), /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ L(-1.22606548862580061633942923016222044E-34), /* bf8e45f1b17bb61039d21a351bb207b8 */
+ L(1.64794921875001835451453858682255576E-03), /* 3ff5b000000000054a52fa20f6565000 */
+ L(1.39132339594152335892305491425264583E-34), /* 3f8e71e0904c5449b414ee49b191cef2 */
+ L(1.67846679687501263995029340691547953E-03), /* 3ff5b80000000003a4a9e912c910b000 */
+ L(6.67245854693585315412242764786197029E-35), /* 3f8d62c4ccac1e7511a617d469468ccd */
+ L(1.70898437500002646861403514115369655E-03), /* 3ff5c00000000007a109fbaa7e015000 */
+ L(6.87367172354719289559624829652240928E-36), /* 3f8a245fa835eceb42bae8128d9336db */
+ L(1.73950195312501174308226096992992128E-03), /* 3ff5c80000000003627c8d637a005000 */
+ L(-2.20824271875474985927385878948759352E-34), /* bf8f25869b1cbefb25e735992f232f57 */
+ L(1.77001953124997491747605207736194513E-03), /* 3ff5cffffffffff8c53c84b6883b8000 */
+ L(3.43123048533596296514343180408963705E-34), /* 3f8fc816b91d173ddadbbf09b1287906 */
+ L(1.80053710937497698911127570705069398E-03), /* 3ff5d7fffffffff95e1899f4a8430000 */
+ L(3.99231237340890073475077494556136100E-35), /* 3f8ca889148f62fa854da5674df41279 */
+ L(1.83105468750002267094899598630423914E-03), /* 3ff5e0000000000688d21e62ba674000 */
+ L(-3.22274595655810623999007524769365273E-34), /* bf8fac605cb9ae01eb719675ced25560 */
+ L(1.86157226562500499224728040579690330E-03), /* 3ff5e80000000001705ce28a6d89e000 */
+ L(3.07094985075881613489605622068441083E-34), /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+ L(1.89208984374998234666824993196980949E-03), /* 3ff5effffffffffae969fdc7cd8cf000 */
+ L(-3.06287628722973914692165056776495733E-34), /* bf8f9720477d9cfa10e464df7f91020c */
+ L(1.92260742187501225343755557292811682E-03), /* 3ff5f800000000038824e428ed49a000 */
+ L(6.30049124729794620592961282769623368E-35), /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+ L(1.95312499999998514894032051116231258E-03), /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ L(-6.14610057507500948543216998736262902E-35), /* bf8d46c862d39255370e7974d48daa7e */
+ L(1.98364257812501222021119324146882732E-03), /* 3ff6040000000001c2d8a1aa5188d000 */
+ L(3.71942298418113774118754986159801984E-34), /* 3f8fee6567d9940495519ffe62cbc9a4 */
- 7.06341639425619532977052017486130353E-01L, /* 3ffe69a59c8245a9ac00000000000000 */
- 7.09106182437398424589503065362805501E-01L, /* 3ffe6b0ff72deb89d000000000000000 */
- 7.11881545564596485142772053222870454E-01L, /* 3ffe6c7bbce9a6d93000000000000000 */
- 7.14667771155948150507697391731198877E-01L, /* 3ffe6de8ef213d71e000000000000000 */
- 7.17464901725936049503573599395167548E-01L, /* 3ffe6f578f41e1a9e400000000000000 */
- 7.20272979955439790478166628417966422E-01L, /* 3ffe70c79eba33c06c00000000000000 */
- 7.23092048692387218133958981525211129E-01L, /* 3ffe72391efa434c7400000000000000 */
- 7.25922150952408251622927082280511968E-01L, /* 3ffe73ac117390acd800000000000000 */
- 7.28763329919491220643124052003258839E-01L, /* 3ffe752077990e79d000000000000000 */
- 7.31615628946641782803794740175362676E-01L, /* 3ffe769652df22f7e000000000000000 */
- 7.34479091556544505525749855223693885E-01L, /* 3ffe780da4bba98c4800000000000000 */
- 7.37353761442226890432394270646909717E-01L, /* 3ffe79866ea5f432d400000000000000 */
- 7.40239682467726090031590047146892175E-01L, /* 3ffe7b00b216ccf53000000000000000 */
- 7.43136898668758316688354170764796436E-01L, /* 3ffe7c7c70887763c000000000000000 */
- 7.46045454253390638577059235103661194E-01L, /* 3ffe7df9ab76b20fd000000000000000 */
- 7.48965393602715662213498148958024103E-01L, /* 3ffe7f78645eb8076400000000000000 */
- 7.51896761271528629722027403659012634E-01L, /* 3ffe80f89cbf42526400000000000000 */
- 7.54839601989007347171423134568613023E-01L, /* 3ffe827a561889716000000000000000 */
- 7.57793960659394638668118204805068672E-01L, /* 3ffe83fd91ec46ddc000000000000000 */
- 7.60759882362683631518152083117456641E-01L, /* 3ffe858251bdb68b8c00000000000000 */
- 7.63737412355305483879774897104653064E-01L, /* 3ffe87089711986c9400000000000000 */
- 7.66726596070820082262642358728044201E-01L, /* 3ffe8890636e31f54400000000000000 */
- 7.69727479120609181517664865168626420E-01L, /* 3ffe8a19b85b4fa2d800000000000000 */
- 7.72740107294572486917871856348938309E-01L, /* 3ffe8ba4976246833800000000000000 */
- 7.75764526561826289752232810315035749E-01L, /* 3ffe8d31020df5be4400000000000000 */
- 7.78800783071404878477039801509818062E-01L, /* 3ffe8ebef9eac820b000000000000000 */
- 7.81848923152964780936002853195532225E-01L, /* 3ffe904e8086b5a87800000000000000 */
- 7.84908993317491698871180005880887620E-01L, /* 3ffe91df97714512d800000000000000 */
- 7.87981040258010162480317717381694820E-01L, /* 3ffe9372403b8d6bcc00000000000000 */
- 7.91065110850296016042904057030682452E-01L, /* 3ffe95067c78379f2800000000000000 */
- 7.94161252153591734614934694036492147E-01L, /* 3ffe969c4dbb800b4800000000000000 */
- 7.97269511411324433014513601847284008E-01L, /* 3ffe9833b59b38154400000000000000 */
- 8.00389936051826789142893403550260700E-01L, /* 3ffe99ccb5aec7bec800000000000000 */
- 8.03522573689060742863077280162542593E-01L, /* 3ffe9b674f8f2f3d7c00000000000000 */
- 8.06667472123343942680406826184480451E-01L, /* 3ffe9d0384d70893f800000000000000 */
- 8.09824679342079301047618855591281317E-01L, /* 3ffe9ea15722892c7800000000000000 */
- 8.12994243520486992160556383169023320E-01L, /* 3ffea040c80f8374f000000000000000 */
- 8.16176213022339780422953481320291758E-01L, /* 3ffea1e1d93d687d0000000000000000 */
- 8.19370636400700819157449927843117621E-01L, /* 3ffea3848c4d49954c00000000000000 */
- 8.22577562398664585696650419777142815E-01L, /* 3ffea528e2e1d9f09800000000000000 */
- 8.25797039950100647542896581398963463E-01L, /* 3ffea6cede9f70467c00000000000000 */
- 8.29029118180400342863478613253391813E-01L, /* 3ffea876812c0877bc00000000000000 */
- 8.32273846407226292054559735333896242E-01L, /* 3ffeaa1fcc2f45343800000000000000 */
- 8.35531274141265073440720811959181447E-01L, /* 3ffeabcac15271a2a400000000000000 */
- 8.38801451086982535754188461396552157E-01L, /* 3ffead7762408309bc00000000000000 */
- 8.42084427143382358016410194068157580E-01L, /* 3ffeaf25b0a61a7b4c00000000000000 */
- 8.45380252404767357221615498019673396E-01L, /* 3ffeb0d5ae318680c400000000000000 */
- 8.48688977161503960155997106085123960E-01L, /* 3ffeb2875c92c4c99400000000000000 */
- 8.52010651900789478530029441571969073E-01L, /* 3ffeb43abd7b83db1c00000000000000 */
- 8.55345327307422548246407245642330963E-01L, /* 3ffeb5efd29f24c26400000000000000 */
- 8.58693054264576483003423845730139874E-01L, /* 3ffeb7a69db2bcc77800000000000000 */
- 8.62053883854575708767242758767679334E-01L, /* 3ffeb95f206d17228000000000000000 */
- 8.65427867359675251357487013592617586E-01L, /* 3ffebb195c86b6b29000000000000000 */
- 8.68815056262843166123843730019871145E-01L, /* 3ffebcd553b9d7b62000000000000000 */
- 8.72215502248546159513864495238522068E-01L, /* 3ffebe9307c271855000000000000000 */
- 8.75629257203538208242932228131394368E-01L, /* 3ffec0527a5e384ddc00000000000000 */
- 8.79056373217652342599848225290770642E-01L, /* 3ffec213ad4c9ed0d800000000000000 */
- 8.82496902584595399599010079327854328E-01L, /* 3ffec3d6a24ed8221800000000000000 */
- 8.85950897802745995779361010136199184E-01L, /* 3ffec59b5b27d9696800000000000000 */
- 8.89418411575955636383383762222365476E-01L, /* 3ffec761d99c5ba58800000000000000 */
- 8.92899496814352794382685374330321793E-01L, /* 3ffec92a1f72dd70d400000000000000 */
- 8.96394206635150403439382671422208659E-01L, /* 3ffecaf42e73a4c7d800000000000000 */
- 8.99902594363456265202927397695020773E-01L, /* 3ffeccc00868c0d18800000000000000 */
- 9.03424713533086704009278378180169966E-01L, /* 3ffece8daf1e0ba94c00000000000000 */
- 9.06960617887383580004723171441582963E-01L, /* 3ffed05d24612c2af000000000000000 */
- 9.10510361380034133338412516422977205E-01L, /* 3ffed22e6a0197c02c00000000000000 */
- 9.14073998175894436579724811053893063E-01L, /* 3ffed40181d094303400000000000000 */
- 9.17651582651815816982221463149471674E-01L, /* 3ffed5d66da13970f400000000000000 */
- 9.21243169397474526149949269893113524E-01L, /* 3ffed7ad2f48737a2000000000000000 */
- 9.24848813216204823639543519675498828E-01L, /* 3ffed985c89d041a3000000000000000 */
- 9.28468569125835141431224428743007593E-01L, /* 3ffedb603b7784cd1800000000000000 */
- 9.32102492359527579068867453315760940E-01L, /* 3ffedd3c89b26894e000000000000000 */
- 9.35750638366620729469147477175283711E-01L, /* 3ffedf1ab529fdd41c00000000000000 */
- 9.39413062813475779888605643463961314E-01L, /* 3ffee0fabfbc702a3c00000000000000 */
- 9.43089821584325888048638830696290825E-01L, /* 3ffee2dcab49ca51b400000000000000 */
- 9.46780970782128888929563004239753354E-01L, /* 3ffee4c079b3f8000400000000000000 */
- 9.50486566729423443256052905780961737E-01L, /* 3ffee6a62cdec7c7b000000000000000 */
- 9.54206665969188322362626308859034907E-01L, /* 3ffee88dc6afecfbfc00000000000000 */
- 9.57941325265705301283958306157728657E-01L, /* 3ffeea77490f0196b000000000000000 */
- 9.61690601605425299247542625380447134E-01L, /* 3ffeec62b5e5881fb000000000000000 */
- 9.65454552197837823079851204965962097E-01L, /* 3ffeee500f1eed967000000000000000 */
- 9.69233234476344074348475032820715569E-01L, /* 3ffef03f56a88b5d7800000000000000 */
- 9.73026706099133165128733935489435680E-01L, /* 3ffef2308e71a927a800000000000000 */
- 9.76835024950062025261843245971249416E-01L, /* 3ffef423b86b7ee79000000000000000 */
- 9.80658249139538557015427500118676107E-01L, /* 3ffef618d68936c09c00000000000000 */
- 9.84496437005408397968864164795377292E-01L, /* 3ffef80feabfeefa4800000000000000 */
- 9.88349647113845042323276857132441364E-01L, /* 3ffefa08f706bbf53800000000000000 */
- 9.92217938260243514925207364285597578E-01L, /* 3ffefc03fd56aa225000000000000000 */
- 9.96101369470117486981664001177705359E-01L, /* 3ffefe00ffaabffbbc00000000000000 */
+ L(7.06341639425619532977052017486130353E-01), /* 3ffe69a59c8245a9ac00000000000000 */
+ L(7.09106182437398424589503065362805501E-01), /* 3ffe6b0ff72deb89d000000000000000 */
+ L(7.11881545564596485142772053222870454E-01), /* 3ffe6c7bbce9a6d93000000000000000 */
+ L(7.14667771155948150507697391731198877E-01), /* 3ffe6de8ef213d71e000000000000000 */
+ L(7.17464901725936049503573599395167548E-01), /* 3ffe6f578f41e1a9e400000000000000 */
+ L(7.20272979955439790478166628417966422E-01), /* 3ffe70c79eba33c06c00000000000000 */
+ L(7.23092048692387218133958981525211129E-01), /* 3ffe72391efa434c7400000000000000 */
+ L(7.25922150952408251622927082280511968E-01), /* 3ffe73ac117390acd800000000000000 */
+ L(7.28763329919491220643124052003258839E-01), /* 3ffe752077990e79d000000000000000 */
+ L(7.31615628946641782803794740175362676E-01), /* 3ffe769652df22f7e000000000000000 */
+ L(7.34479091556544505525749855223693885E-01), /* 3ffe780da4bba98c4800000000000000 */
+ L(7.37353761442226890432394270646909717E-01), /* 3ffe79866ea5f432d400000000000000 */
+ L(7.40239682467726090031590047146892175E-01), /* 3ffe7b00b216ccf53000000000000000 */
+ L(7.43136898668758316688354170764796436E-01), /* 3ffe7c7c70887763c000000000000000 */
+ L(7.46045454253390638577059235103661194E-01), /* 3ffe7df9ab76b20fd000000000000000 */
+ L(7.48965393602715662213498148958024103E-01), /* 3ffe7f78645eb8076400000000000000 */
+ L(7.51896761271528629722027403659012634E-01), /* 3ffe80f89cbf42526400000000000000 */
+ L(7.54839601989007347171423134568613023E-01), /* 3ffe827a561889716000000000000000 */
+ L(7.57793960659394638668118204805068672E-01), /* 3ffe83fd91ec46ddc000000000000000 */
+ L(7.60759882362683631518152083117456641E-01), /* 3ffe858251bdb68b8c00000000000000 */
+ L(7.63737412355305483879774897104653064E-01), /* 3ffe87089711986c9400000000000000 */
+ L(7.66726596070820082262642358728044201E-01), /* 3ffe8890636e31f54400000000000000 */
+ L(7.69727479120609181517664865168626420E-01), /* 3ffe8a19b85b4fa2d800000000000000 */
+ L(7.72740107294572486917871856348938309E-01), /* 3ffe8ba4976246833800000000000000 */
+ L(7.75764526561826289752232810315035749E-01), /* 3ffe8d31020df5be4400000000000000 */
+ L(7.78800783071404878477039801509818062E-01), /* 3ffe8ebef9eac820b000000000000000 */
+ L(7.81848923152964780936002853195532225E-01), /* 3ffe904e8086b5a87800000000000000 */
+ L(7.84908993317491698871180005880887620E-01), /* 3ffe91df97714512d800000000000000 */
+ L(7.87981040258010162480317717381694820E-01), /* 3ffe9372403b8d6bcc00000000000000 */
+ L(7.91065110850296016042904057030682452E-01), /* 3ffe95067c78379f2800000000000000 */
+ L(7.94161252153591734614934694036492147E-01), /* 3ffe969c4dbb800b4800000000000000 */
+ L(7.97269511411324433014513601847284008E-01), /* 3ffe9833b59b38154400000000000000 */
+ L(8.00389936051826789142893403550260700E-01), /* 3ffe99ccb5aec7bec800000000000000 */
+ L(8.03522573689060742863077280162542593E-01), /* 3ffe9b674f8f2f3d7c00000000000000 */
+ L(8.06667472123343942680406826184480451E-01), /* 3ffe9d0384d70893f800000000000000 */
+ L(8.09824679342079301047618855591281317E-01), /* 3ffe9ea15722892c7800000000000000 */
+ L(8.12994243520486992160556383169023320E-01), /* 3ffea040c80f8374f000000000000000 */
+ L(8.16176213022339780422953481320291758E-01), /* 3ffea1e1d93d687d0000000000000000 */
+ L(8.19370636400700819157449927843117621E-01), /* 3ffea3848c4d49954c00000000000000 */
+ L(8.22577562398664585696650419777142815E-01), /* 3ffea528e2e1d9f09800000000000000 */
+ L(8.25797039950100647542896581398963463E-01), /* 3ffea6cede9f70467c00000000000000 */
+ L(8.29029118180400342863478613253391813E-01), /* 3ffea876812c0877bc00000000000000 */
+ L(8.32273846407226292054559735333896242E-01), /* 3ffeaa1fcc2f45343800000000000000 */
+ L(8.35531274141265073440720811959181447E-01), /* 3ffeabcac15271a2a400000000000000 */
+ L(8.38801451086982535754188461396552157E-01), /* 3ffead7762408309bc00000000000000 */
+ L(8.42084427143382358016410194068157580E-01), /* 3ffeaf25b0a61a7b4c00000000000000 */
+ L(8.45380252404767357221615498019673396E-01), /* 3ffeb0d5ae318680c400000000000000 */
+ L(8.48688977161503960155997106085123960E-01), /* 3ffeb2875c92c4c99400000000000000 */
+ L(8.52010651900789478530029441571969073E-01), /* 3ffeb43abd7b83db1c00000000000000 */
+ L(8.55345327307422548246407245642330963E-01), /* 3ffeb5efd29f24c26400000000000000 */
+ L(8.58693054264576483003423845730139874E-01), /* 3ffeb7a69db2bcc77800000000000000 */
+ L(8.62053883854575708767242758767679334E-01), /* 3ffeb95f206d17228000000000000000 */
+ L(8.65427867359675251357487013592617586E-01), /* 3ffebb195c86b6b29000000000000000 */
+ L(8.68815056262843166123843730019871145E-01), /* 3ffebcd553b9d7b62000000000000000 */
+ L(8.72215502248546159513864495238522068E-01), /* 3ffebe9307c271855000000000000000 */
+ L(8.75629257203538208242932228131394368E-01), /* 3ffec0527a5e384ddc00000000000000 */
+ L(8.79056373217652342599848225290770642E-01), /* 3ffec213ad4c9ed0d800000000000000 */
+ L(8.82496902584595399599010079327854328E-01), /* 3ffec3d6a24ed8221800000000000000 */
+ L(8.85950897802745995779361010136199184E-01), /* 3ffec59b5b27d9696800000000000000 */
+ L(8.89418411575955636383383762222365476E-01), /* 3ffec761d99c5ba58800000000000000 */
+ L(8.92899496814352794382685374330321793E-01), /* 3ffec92a1f72dd70d400000000000000 */
+ L(8.96394206635150403439382671422208659E-01), /* 3ffecaf42e73a4c7d800000000000000 */
+ L(8.99902594363456265202927397695020773E-01), /* 3ffeccc00868c0d18800000000000000 */
+ L(9.03424713533086704009278378180169966E-01), /* 3ffece8daf1e0ba94c00000000000000 */
+ L(9.06960617887383580004723171441582963E-01), /* 3ffed05d24612c2af000000000000000 */
+ L(9.10510361380034133338412516422977205E-01), /* 3ffed22e6a0197c02c00000000000000 */
+ L(9.14073998175894436579724811053893063E-01), /* 3ffed40181d094303400000000000000 */
+ L(9.17651582651815816982221463149471674E-01), /* 3ffed5d66da13970f400000000000000 */
+ L(9.21243169397474526149949269893113524E-01), /* 3ffed7ad2f48737a2000000000000000 */
+ L(9.24848813216204823639543519675498828E-01), /* 3ffed985c89d041a3000000000000000 */
+ L(9.28468569125835141431224428743007593E-01), /* 3ffedb603b7784cd1800000000000000 */
+ L(9.32102492359527579068867453315760940E-01), /* 3ffedd3c89b26894e000000000000000 */
+ L(9.35750638366620729469147477175283711E-01), /* 3ffedf1ab529fdd41c00000000000000 */
+ L(9.39413062813475779888605643463961314E-01), /* 3ffee0fabfbc702a3c00000000000000 */
+ L(9.43089821584325888048638830696290825E-01), /* 3ffee2dcab49ca51b400000000000000 */
+ L(9.46780970782128888929563004239753354E-01), /* 3ffee4c079b3f8000400000000000000 */
+ L(9.50486566729423443256052905780961737E-01), /* 3ffee6a62cdec7c7b000000000000000 */
+ L(9.54206665969188322362626308859034907E-01), /* 3ffee88dc6afecfbfc00000000000000 */
+ L(9.57941325265705301283958306157728657E-01), /* 3ffeea77490f0196b000000000000000 */
+ L(9.61690601605425299247542625380447134E-01), /* 3ffeec62b5e5881fb000000000000000 */
+ L(9.65454552197837823079851204965962097E-01), /* 3ffeee500f1eed967000000000000000 */
+ L(9.69233234476344074348475032820715569E-01), /* 3ffef03f56a88b5d7800000000000000 */
+ L(9.73026706099133165128733935489435680E-01), /* 3ffef2308e71a927a800000000000000 */
+ L(9.76835024950062025261843245971249416E-01), /* 3ffef423b86b7ee79000000000000000 */
+ L(9.80658249139538557015427500118676107E-01), /* 3ffef618d68936c09c00000000000000 */
+ L(9.84496437005408397968864164795377292E-01), /* 3ffef80feabfeefa4800000000000000 */
+ L(9.88349647113845042323276857132441364E-01), /* 3ffefa08f706bbf53800000000000000 */
+ L(9.92217938260243514925207364285597578E-01), /* 3ffefc03fd56aa225000000000000000 */
+ L(9.96101369470117486981664001177705359E-01), /* 3ffefe00ffaabffbbc00000000000000 */
#define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
- 1.00391388933834757590801700644078664E+00L, /* 3fff0100802ab5577800000000000000 */
- 1.00784309720644799091004983893071767E+00L, /* 3fff0202015600445c00000000000000 */
- 1.01178768355933151879000320150225889E+00L, /* 3fff0304848362076c00000000000000 */
- 1.01574770858668572692806719715008512E+00L, /* 3fff04080ab55de39000000000000000 */
- 1.01972323271377413034244341361045372E+00L, /* 3fff050c94ef7a206c00000000000000 */
- 1.02371431660235789884438872832106426E+00L, /* 3fff06122436410dd000000000000000 */
- 1.02772102115162167201845022646011785E+00L, /* 3fff0718b98f42085000000000000000 */
- 1.03174340749910264936062276319717057E+00L, /* 3fff08205601127ec800000000000000 */
- 1.03578153702162378824169763902318664E+00L, /* 3fff0928fa934ef90800000000000000 */
- 1.03983547133622999947277776300325058E+00L, /* 3fff0a32a84e9c1f5800000000000000 */
- 1.04390527230112850620713516036630608E+00L, /* 3fff0b3d603ca7c32800000000000000 */
- 1.04799100201663270004459604933799710E+00L, /* 3fff0c49236829e8bc00000000000000 */
- 1.05209272282610977189420964350574650E+00L, /* 3fff0d55f2dce5d1e800000000000000 */
- 1.05621049731693195106174698594259098E+00L, /* 3fff0e63cfa7ab09d000000000000000 */
- 1.06034438832143151909548350886325352E+00L, /* 3fff0f72bad65671b800000000000000 */
- 1.06449445891785943185681162503897212E+00L, /* 3fff1082b577d34ed800000000000000 */
- 1.06866077243134810492719566354935523E+00L, /* 3fff1193c09c1c595c00000000000000 */
- 1.07284339243487741866189821848820429E+00L, /* 3fff12a5dd543ccc4c00000000000000 */
- 1.07704238275024494209120007326419000E+00L, /* 3fff13b90cb25176a400000000000000 */
- 1.08125780744903959851299646288680378E+00L, /* 3fff14cd4fc989cd6400000000000000 */
- 1.08548973085361949442173568058933597E+00L, /* 3fff15e2a7ae28fecc00000000000000 */
- 1.08973821753809324563988525369495619E+00L, /* 3fff16f9157587069400000000000000 */
- 1.09400333232930546678574046381982043E+00L, /* 3fff18109a3611c35000000000000000 */
- 1.09828514030782586896606289883493446E+00L, /* 3fff192937074e0cd800000000000000 */
- 1.10258370680894224324930519287590869E+00L, /* 3fff1a42ed01d8cbc800000000000000 */
- 1.10689909742365749645287564817408565E+00L, /* 3fff1b5dbd3f68122400000000000000 */
- 1.11123137799969046168868658241990488E+00L, /* 3fff1c79a8dacc350c00000000000000 */
- 1.11558061464248076122274255794764031E+00L, /* 3fff1d96b0eff0e79400000000000000 */
- 1.11994687371619722204840741142106708E+00L, /* 3fff1eb4d69bde569c00000000000000 */
- 1.12433022184475073235176978414529003E+00L, /* 3fff1fd41afcba45e800000000000000 */
- 1.12873072591281087273529237791080959E+00L, /* 3fff20f47f31c92e4800000000000000 */
- 1.13314845306682632219974493636982515E+00L, /* 3fff2216045b6f5cd000000000000000 */
- 1.13758347071604959399593326452304609E+00L, /* 3fff2338ab9b32134800000000000000 */
- 1.14203584653356560174586320499656722E+00L, /* 3fff245c7613b8a9b000000000000000 */
- 1.14650564845732405583333957110880874E+00L, /* 3fff258164e8cdb0d800000000000000 */
- 1.15099294469117646722011727433709893E+00L, /* 3fff26a7793f60164400000000000000 */
- 1.15549780370591653744227755851170514E+00L, /* 3fff27ceb43d84490400000000000000 */
- 1.16002029424032515603215642840950750E+00L, /* 3fff28f7170a755fd800000000000000 */
- 1.16456048530221917269855680387991015E+00L, /* 3fff2a20a2ce96406400000000000000 */
- 1.16911844616950438835445424956560601E+00L, /* 3fff2b4b58b372c79400000000000000 */
- 1.17369424639123270948104504896036815E+00L, /* 3fff2c7739e3c0f32c00000000000000 */
- 1.17828795578866324378353169777255971E+00L, /* 3fff2da4478b620c7400000000000000 */
- 1.18289964445632783673900689791480545E+00L, /* 3fff2ed282d763d42400000000000000 */
- 1.18752938276310060494722620205720887E+00L, /* 3fff3001ecf601af7000000000000000 */
- 1.19217724135327157730657177125976887E+00L, /* 3fff31328716a5d63c00000000000000 */
- 1.19684329114762477708211463323095813E+00L, /* 3fff32645269ea829000000000000000 */
- 1.20152760334452030077656559114984702E+00L, /* 3fff339750219b212c00000000000000 */
- 1.20623024942098072687102217059873510E+00L, /* 3fff34cb8170b5835400000000000000 */
- 1.21095130113378179892436037334846333E+00L, /* 3fff3600e78b6b11d000000000000000 */
- 1.21569083052054743854242246925423387E+00L, /* 3fff373783a722012400000000000000 */
- 1.22044890990084875515009343871497549E+00L, /* 3fff386f56fa7686e800000000000000 */
- 1.22522561187730755216662714701669756E+00L, /* 3fff39a862bd3c106400000000000000 */
- 1.23002100933670455162882717559114099E+00L, /* 3fff3ae2a8287e7a8000000000000000 */
- 1.23483517545109100499445276000187732E+00L, /* 3fff3c1e2876834aa800000000000000 */
- 1.23966818367890557750499169742397498E+00L, /* 3fff3d5ae4e2cae92c00000000000000 */
- 1.24452010776609517384017067342938390E+00L, /* 3fff3e98deaa11dcbc00000000000000 */
- 1.24939102174724003813111039562500082E+00L, /* 3fff3fd8170a52071800000000000000 */
- 1.25428099994668373895478907797951251E+00L, /* 3fff41188f42c3e32000000000000000 */
- 1.25919011697966698459794088194030337E+00L, /* 3fff425a4893dfc3f800000000000000 */
- 1.26411844775346637881341393949696794E+00L, /* 3fff439d443f5f159000000000000000 */
- 1.26906606746853711786826579555054195E+00L, /* 3fff44e183883d9e4800000000000000 */
- 1.27403305161966090564007458851847332E+00L, /* 3fff462707b2bac20c00000000000000 */
- 1.27901947599709753244923149395617656E+00L, /* 3fff476dd2045ac67800000000000000 */
- 1.28402541668774150540599521264084615E+00L, /* 3fff48b5e3c3e8186800000000000000 */
- 1.28905095007628295311619126550795045E+00L, /* 3fff49ff3e397492bc00000000000000 */
- 1.29409615284637330434591717676084954E+00L, /* 3fff4b49e2ae5ac67400000000000000 */
- 1.29916110198179535206719492634874769E+00L, /* 3fff4c95d26d3f440800000000000000 */
- 1.30424587476763775839572190307080746E+00L, /* 3fff4de30ec211e60000000000000000 */
- 1.30935054879147461104338390214252286E+00L, /* 3fff4f3198fa0f1cf800000000000000 */
- 1.31447520194454914310711046709911898E+00L, /* 3fff50817263c13cd000000000000000 */
- 1.31961991242296217130558488861424848E+00L, /* 3fff51d29c4f01cb3000000000000000 */
- 1.32478475872886558573071624778094701E+00L, /* 3fff5325180cfacf7800000000000000 */
- 1.32996981967165983640200010995613411E+00L, /* 3fff5478e6f02823d000000000000000 */
- 1.33517517436919680440254865061433520E+00L, /* 3fff55ce0a4c58c7bc00000000000000 */
- 1.34040090224898678084031189428060316E+00L, /* 3fff57248376b033d800000000000000 */
- 1.34564708304941055283521222918352578E+00L, /* 3fff587c53c5a7af0400000000000000 */
- 1.35091379682093615244298234756570309E+00L, /* 3fff59d57c910fa4e000000000000000 */
- 1.35620112392734021300455538039386738E+00L, /* 3fff5b2fff3210fd9400000000000000 */
- 1.36150914504693443252136830778908916E+00L, /* 3fff5c8bdd032e770800000000000000 */
- 1.36683794117379636690046140756749082E+00L, /* 3fff5de9176045ff5400000000000000 */
- 1.37218759361900544124779344201670028E+00L, /* 3fff5f47afa69210a800000000000000 */
- 1.37755818401188367960941150158760138E+00L, /* 3fff60a7a734ab0e8800000000000000 */
- 1.38294979430124120867162673675920814E+00L, /* 3fff6208ff6a88a46000000000000000 */
- 1.38836250675662681297595213436579797E+00L, /* 3fff636bb9a983258400000000000000 */
- 1.39379640396958309755959248832368758E+00L, /* 3fff64cfd75454ee7c00000000000000 */
- 1.39925156885490681313299887733592186E+00L, /* 3fff663559cf1bc7c400000000000000 */
- 1.40472808465191417726103395580139477E+00L, /* 3fff679c427f5a49f400000000000000 */
- 1.41022603492571069194738697660795879E+00L, /* 3fff690492cbf9432c00000000000000 */
- 1.41574550356846662335641440222389065E+00L, /* 3fff6a6e4c1d491e1800000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+ L(1.00391388933834757590801700644078664E+00), /* 3fff0100802ab5577800000000000000 */
+ L(1.00784309720644799091004983893071767E+00), /* 3fff0202015600445c00000000000000 */
+ L(1.01178768355933151879000320150225889E+00), /* 3fff0304848362076c00000000000000 */
+ L(1.01574770858668572692806719715008512E+00), /* 3fff04080ab55de39000000000000000 */
+ L(1.01972323271377413034244341361045372E+00), /* 3fff050c94ef7a206c00000000000000 */
+ L(1.02371431660235789884438872832106426E+00), /* 3fff06122436410dd000000000000000 */
+ L(1.02772102115162167201845022646011785E+00), /* 3fff0718b98f42085000000000000000 */
+ L(1.03174340749910264936062276319717057E+00), /* 3fff08205601127ec800000000000000 */
+ L(1.03578153702162378824169763902318664E+00), /* 3fff0928fa934ef90800000000000000 */
+ L(1.03983547133622999947277776300325058E+00), /* 3fff0a32a84e9c1f5800000000000000 */
+ L(1.04390527230112850620713516036630608E+00), /* 3fff0b3d603ca7c32800000000000000 */
+ L(1.04799100201663270004459604933799710E+00), /* 3fff0c49236829e8bc00000000000000 */
+ L(1.05209272282610977189420964350574650E+00), /* 3fff0d55f2dce5d1e800000000000000 */
+ L(1.05621049731693195106174698594259098E+00), /* 3fff0e63cfa7ab09d000000000000000 */
+ L(1.06034438832143151909548350886325352E+00), /* 3fff0f72bad65671b800000000000000 */
+ L(1.06449445891785943185681162503897212E+00), /* 3fff1082b577d34ed800000000000000 */
+ L(1.06866077243134810492719566354935523E+00), /* 3fff1193c09c1c595c00000000000000 */
+ L(1.07284339243487741866189821848820429E+00), /* 3fff12a5dd543ccc4c00000000000000 */
+ L(1.07704238275024494209120007326419000E+00), /* 3fff13b90cb25176a400000000000000 */
+ L(1.08125780744903959851299646288680378E+00), /* 3fff14cd4fc989cd6400000000000000 */
+ L(1.08548973085361949442173568058933597E+00), /* 3fff15e2a7ae28fecc00000000000000 */
+ L(1.08973821753809324563988525369495619E+00), /* 3fff16f9157587069400000000000000 */
+ L(1.09400333232930546678574046381982043E+00), /* 3fff18109a3611c35000000000000000 */
+ L(1.09828514030782586896606289883493446E+00), /* 3fff192937074e0cd800000000000000 */
+ L(1.10258370680894224324930519287590869E+00), /* 3fff1a42ed01d8cbc800000000000000 */
+ L(1.10689909742365749645287564817408565E+00), /* 3fff1b5dbd3f68122400000000000000 */
+ L(1.11123137799969046168868658241990488E+00), /* 3fff1c79a8dacc350c00000000000000 */
+ L(1.11558061464248076122274255794764031E+00), /* 3fff1d96b0eff0e79400000000000000 */
+ L(1.11994687371619722204840741142106708E+00), /* 3fff1eb4d69bde569c00000000000000 */
+ L(1.12433022184475073235176978414529003E+00), /* 3fff1fd41afcba45e800000000000000 */
+ L(1.12873072591281087273529237791080959E+00), /* 3fff20f47f31c92e4800000000000000 */
+ L(1.13314845306682632219974493636982515E+00), /* 3fff2216045b6f5cd000000000000000 */
+ L(1.13758347071604959399593326452304609E+00), /* 3fff2338ab9b32134800000000000000 */
+ L(1.14203584653356560174586320499656722E+00), /* 3fff245c7613b8a9b000000000000000 */
+ L(1.14650564845732405583333957110880874E+00), /* 3fff258164e8cdb0d800000000000000 */
+ L(1.15099294469117646722011727433709893E+00), /* 3fff26a7793f60164400000000000000 */
+ L(1.15549780370591653744227755851170514E+00), /* 3fff27ceb43d84490400000000000000 */
+ L(1.16002029424032515603215642840950750E+00), /* 3fff28f7170a755fd800000000000000 */
+ L(1.16456048530221917269855680387991015E+00), /* 3fff2a20a2ce96406400000000000000 */
+ L(1.16911844616950438835445424956560601E+00), /* 3fff2b4b58b372c79400000000000000 */
+ L(1.17369424639123270948104504896036815E+00), /* 3fff2c7739e3c0f32c00000000000000 */
+ L(1.17828795578866324378353169777255971E+00), /* 3fff2da4478b620c7400000000000000 */
+ L(1.18289964445632783673900689791480545E+00), /* 3fff2ed282d763d42400000000000000 */
+ L(1.18752938276310060494722620205720887E+00), /* 3fff3001ecf601af7000000000000000 */
+ L(1.19217724135327157730657177125976887E+00), /* 3fff31328716a5d63c00000000000000 */
+ L(1.19684329114762477708211463323095813E+00), /* 3fff32645269ea829000000000000000 */
+ L(1.20152760334452030077656559114984702E+00), /* 3fff339750219b212c00000000000000 */
+ L(1.20623024942098072687102217059873510E+00), /* 3fff34cb8170b5835400000000000000 */
+ L(1.21095130113378179892436037334846333E+00), /* 3fff3600e78b6b11d000000000000000 */
+ L(1.21569083052054743854242246925423387E+00), /* 3fff373783a722012400000000000000 */
+ L(1.22044890990084875515009343871497549E+00), /* 3fff386f56fa7686e800000000000000 */
+ L(1.22522561187730755216662714701669756E+00), /* 3fff39a862bd3c106400000000000000 */
+ L(1.23002100933670455162882717559114099E+00), /* 3fff3ae2a8287e7a8000000000000000 */
+ L(1.23483517545109100499445276000187732E+00), /* 3fff3c1e2876834aa800000000000000 */
+ L(1.23966818367890557750499169742397498E+00), /* 3fff3d5ae4e2cae92c00000000000000 */
+ L(1.24452010776609517384017067342938390E+00), /* 3fff3e98deaa11dcbc00000000000000 */
+ L(1.24939102174724003813111039562500082E+00), /* 3fff3fd8170a52071800000000000000 */
+ L(1.25428099994668373895478907797951251E+00), /* 3fff41188f42c3e32000000000000000 */
+ L(1.25919011697966698459794088194030337E+00), /* 3fff425a4893dfc3f800000000000000 */
+ L(1.26411844775346637881341393949696794E+00), /* 3fff439d443f5f159000000000000000 */
+ L(1.26906606746853711786826579555054195E+00), /* 3fff44e183883d9e4800000000000000 */
+ L(1.27403305161966090564007458851847332E+00), /* 3fff462707b2bac20c00000000000000 */
+ L(1.27901947599709753244923149395617656E+00), /* 3fff476dd2045ac67800000000000000 */
+ L(1.28402541668774150540599521264084615E+00), /* 3fff48b5e3c3e8186800000000000000 */
+ L(1.28905095007628295311619126550795045E+00), /* 3fff49ff3e397492bc00000000000000 */
+ L(1.29409615284637330434591717676084954E+00), /* 3fff4b49e2ae5ac67400000000000000 */
+ L(1.29916110198179535206719492634874769E+00), /* 3fff4c95d26d3f440800000000000000 */
+ L(1.30424587476763775839572190307080746E+00), /* 3fff4de30ec211e60000000000000000 */
+ L(1.30935054879147461104338390214252286E+00), /* 3fff4f3198fa0f1cf800000000000000 */
+ L(1.31447520194454914310711046709911898E+00), /* 3fff50817263c13cd000000000000000 */
+ L(1.31961991242296217130558488861424848E+00), /* 3fff51d29c4f01cb3000000000000000 */
+ L(1.32478475872886558573071624778094701E+00), /* 3fff5325180cfacf7800000000000000 */
+ L(1.32996981967165983640200010995613411E+00), /* 3fff5478e6f02823d000000000000000 */
+ L(1.33517517436919680440254865061433520E+00), /* 3fff55ce0a4c58c7bc00000000000000 */
+ L(1.34040090224898678084031189428060316E+00), /* 3fff57248376b033d800000000000000 */
+ L(1.34564708304941055283521222918352578E+00), /* 3fff587c53c5a7af0400000000000000 */
+ L(1.35091379682093615244298234756570309E+00), /* 3fff59d57c910fa4e000000000000000 */
+ L(1.35620112392734021300455538039386738E+00), /* 3fff5b2fff3210fd9400000000000000 */
+ L(1.36150914504693443252136830778908916E+00), /* 3fff5c8bdd032e770800000000000000 */
+ L(1.36683794117379636690046140756749082E+00), /* 3fff5de9176045ff5400000000000000 */
+ L(1.37218759361900544124779344201670028E+00), /* 3fff5f47afa69210a800000000000000 */
+ L(1.37755818401188367960941150158760138E+00), /* 3fff60a7a734ab0e8800000000000000 */
+ L(1.38294979430124120867162673675920814E+00), /* 3fff6208ff6a88a46000000000000000 */
+ L(1.38836250675662681297595213436579797E+00), /* 3fff636bb9a983258400000000000000 */
+ L(1.39379640396958309755959248832368758E+00), /* 3fff64cfd75454ee7c00000000000000 */
+ L(1.39925156885490681313299887733592186E+00), /* 3fff663559cf1bc7c400000000000000 */
+ L(1.40472808465191417726103395580139477E+00), /* 3fff679c427f5a49f400000000000000 */
+ L(1.41022603492571069194738697660795879E+00), /* 3fff690492cbf9432c00000000000000 */
+ L(1.41574550356846662335641440222389065E+00), /* 3fff6a6e4c1d491e1800000000000000 */
- 9.98018323540573404351050612604012713E-01L, /* 3ffefefc41f8d4bdb000000000000000 */
- 9.98048781107475468932221929208026268E-01L, /* 3ffeff003ff556aa8800000000000000 */
- 9.98079239603882895082165305211674422E-01L, /* 3ffeff043df9d4986000000000000000 */
- 9.98109699029824021243584297735651489E-01L, /* 3ffeff083c064e972c00000000000000 */
- 9.98140159385327269125909310787392315E-01L, /* 3ffeff0c3a1ac4b6ec00000000000000 */
- 9.98170620670420977171843901487591211E-01L, /* 3ffeff10383737079400000000000000 */
- 9.98201082885133511579667242585856002E-01L, /* 3ffeff14365ba5991c00000000000000 */
- 9.98231546029493238547658506831794512E-01L, /* 3ffeff183488107b7c00000000000000 */
- 9.98262010103528552029672482603928074E-01L, /* 3ffeff1c32bc77beb000000000000000 */
- 9.98292475107267818223988342651864514E-01L, /* 3ffeff2030f8db72b000000000000000 */
- 9.98322941040739375573309644096298143E-01L, /* 3ffeff242f3d3ba77000000000000000 */
- 9.98353407903971645787066790944663808E-01L, /* 3ffeff282d89986cf000000000000000 */
- 9.98383875696992967307963340317655820E-01L, /* 3ffeff2c2bddf1d32400000000000000 */
- 9.98414344419831761845429696222709026E-01L, /* 3ffeff302a3a47ea0c00000000000000 */
- 9.98444814072516340086593800151604228E-01L, /* 3ffeff34289e9ac19800000000000000 */
- 9.98475284655075123740886056111776270E-01L, /* 3ffeff38270aea69c800000000000000 */
- 9.98505756167536479006585636852832977E-01L, /* 3ffeff3c257f36f29400000000000000 */
- 9.98536228609928799837547330753295682E-01L, /* 3ffeff4023fb806bf800000000000000 */
- 9.98566701982280452432050310562772211E-01L, /* 3ffeff44227fc6e5ec00000000000000 */
- 9.98597176284619802988373749030870385E-01L, /* 3ffeff48210c0a706800000000000000 */
- 9.98627651516975245460372434536111541E-01L, /* 3ffeff4c1fa04b1b6800000000000000 */
- 9.98658127679375173801901155457017012E-01L, /* 3ffeff501e3c88f6e800000000000000 */
- 9.98688604771847954211239084543194622E-01L, /* 3ffeff541ce0c412e000000000000000 */
- 9.98719082794421980642241010173165705E-01L, /* 3ffeff581b8cfc7f4c00000000000000 */
- 9.98749561747125619293186105096538085E-01L, /* 3ffeff5c1a41324c2400000000000000 */
- 9.98780041629987291873504773320746608E-01L, /* 3ffeff6018fd65896800000000000000 */
- 9.98810522443035364581476187595399097E-01L, /* 3ffeff6417c196471000000000000000 */
- 9.98841004186298203615379520670103375E-01L, /* 3ffeff68168dc4951400000000000000 */
- 9.98871486859804230684645176552294288E-01L, /* 3ffeff6c1561f0837400000000000000 */
- 9.98901970463581839743127943620493170E-01L, /* 3ffeff70143e1a222c00000000000000 */
- 9.98932454997659369233531378995394334E-01L, /* 3ffeff74132241813000000000000000 */
- 9.98962940462065268620861502313346136E-01L, /* 3ffeff78120e66b08400000000000000 */
- 9.98993426856827904103397486323956400E-01L, /* 3ffeff7c110289c02000000000000000 */
- 9.99023914181975669634994119405746460E-01L, /* 3ffeff800ffeaac00000000000000000 */
- 9.99054402437536959169506189937237650E-01L, /* 3ffeff840f02c9c02000000000000000 */
- 9.99084891623540138905212870668037795E-01L, /* 3ffeff880e0ee6d07800000000000000 */
- 9.99115381740013658307120181234495249E-01L, /* 3ffeff8c0d2302010c00000000000000 */
- 9.99145872786985911329082910015131347E-01L, /* 3ffeff900c3f1b61d800000000000000 */
- 9.99176364764485236413804614130640402E-01L, /* 3ffeff940b633302d000000000000000 */
- 9.99206857672540083026291313217370771E-01L, /* 3ffeff980a8f48f3f800000000000000 */
- 9.99237351511178817364822180024930276E-01L, /* 3ffeff9c09c35d454800000000000000 */
- 9.99267846280429861138827618560753763E-01L, /* 3ffeffa008ff7006c000000000000000 */
- 9.99298341980321608302162417203362565E-01L, /* 3ffeffa4084381485c00000000000000 */
- 9.99328838610882452808681364331278019E-01L, /* 3ffeffa8078f911a1800000000000000 */
- 9.99359336172140816367814863951934967E-01L, /* 3ffeffac06e39f8bf400000000000000 */
- 9.99389834664125092933417704443854745E-01L, /* 3ffeffb0063facadec00000000000000 */
- 9.99420334086863676459344674185558688E-01L, /* 3ffeffb405a3b88ffc00000000000000 */
- 9.99450834440384988655026177184481639E-01L, /* 3ffeffb8050fc3422400000000000000 */
- 9.99481335724717395718741386190231424E-01L, /* 3ffeffbc0483ccd45c00000000000000 */
- 9.99511837939889374871071936468069907E-01L, /* 3ffeffc003ffd556ac00000000000000 */
- 9.99542341085929264554721385138691403E-01L, /* 3ffeffc40383dcd90800000000000000 */
- 9.99572845162865514234695751838444266E-01L, /* 3ffeffc8030fe36b7400000000000000 */
- 9.99603350170726517864849824945849832E-01L, /* 3ffeffcc02a3e91dec00000000000000 */
- 9.99633856109540669399038392839429434E-01L, /* 3ffeffd0023fee006c00000000000000 */
- 9.99664362979336418302267475155531429E-01L, /* 3ffeffd401e3f222f800000000000000 */
- 9.99694870780142130772816244643763639E-01L, /* 3ffeffd8018ff5958800000000000000 */
- 9.99725379511986284031266336569387931E-01L, /* 3ffeffdc0143f8682400000000000000 */
- 9.99755889174897216520321308053098619E-01L, /* 3ffeffe000fffaaac000000000000000 */
- 9.99786399768903377704987178731244057E-01L, /* 3ffeffe400c3fc6d6000000000000000 */
- 9.99816911294033217050269968240172602E-01L, /* 3ffeffe8008ffdc00800000000000000 */
- 9.99847423750315072998873233700578567E-01L, /* 3ffeffec0063feb2ac00000000000000 */
- 9.99877937137777450526954226006637327E-01L, /* 3ffefff0003fff555800000000000000 */
- 9.99908451456448688077216502279043198E-01L, /* 3ffefff40023ffb80000000000000000 */
- 9.99938966706357262870241697783058044E-01L, /* 3ffefff8000fffeaac00000000000000 */
- 9.99969482887531541104308985268289689E-01L, /* 3ffefffc0003fffd5400000000000000 */
+ L(9.98018323540573404351050612604012713E-01), /* 3ffefefc41f8d4bdb000000000000000 */
+ L(9.98048781107475468932221929208026268E-01), /* 3ffeff003ff556aa8800000000000000 */
+ L(9.98079239603882895082165305211674422E-01), /* 3ffeff043df9d4986000000000000000 */
+ L(9.98109699029824021243584297735651489E-01), /* 3ffeff083c064e972c00000000000000 */
+ L(9.98140159385327269125909310787392315E-01), /* 3ffeff0c3a1ac4b6ec00000000000000 */
+ L(9.98170620670420977171843901487591211E-01), /* 3ffeff10383737079400000000000000 */
+ L(9.98201082885133511579667242585856002E-01), /* 3ffeff14365ba5991c00000000000000 */
+ L(9.98231546029493238547658506831794512E-01), /* 3ffeff183488107b7c00000000000000 */
+ L(9.98262010103528552029672482603928074E-01), /* 3ffeff1c32bc77beb000000000000000 */
+ L(9.98292475107267818223988342651864514E-01), /* 3ffeff2030f8db72b000000000000000 */
+ L(9.98322941040739375573309644096298143E-01), /* 3ffeff242f3d3ba77000000000000000 */
+ L(9.98353407903971645787066790944663808E-01), /* 3ffeff282d89986cf000000000000000 */
+ L(9.98383875696992967307963340317655820E-01), /* 3ffeff2c2bddf1d32400000000000000 */
+ L(9.98414344419831761845429696222709026E-01), /* 3ffeff302a3a47ea0c00000000000000 */
+ L(9.98444814072516340086593800151604228E-01), /* 3ffeff34289e9ac19800000000000000 */
+ L(9.98475284655075123740886056111776270E-01), /* 3ffeff38270aea69c800000000000000 */
+ L(9.98505756167536479006585636852832977E-01), /* 3ffeff3c257f36f29400000000000000 */
+ L(9.98536228609928799837547330753295682E-01), /* 3ffeff4023fb806bf800000000000000 */
+ L(9.98566701982280452432050310562772211E-01), /* 3ffeff44227fc6e5ec00000000000000 */
+ L(9.98597176284619802988373749030870385E-01), /* 3ffeff48210c0a706800000000000000 */
+ L(9.98627651516975245460372434536111541E-01), /* 3ffeff4c1fa04b1b6800000000000000 */
+ L(9.98658127679375173801901155457017012E-01), /* 3ffeff501e3c88f6e800000000000000 */
+ L(9.98688604771847954211239084543194622E-01), /* 3ffeff541ce0c412e000000000000000 */
+ L(9.98719082794421980642241010173165705E-01), /* 3ffeff581b8cfc7f4c00000000000000 */
+ L(9.98749561747125619293186105096538085E-01), /* 3ffeff5c1a41324c2400000000000000 */
+ L(9.98780041629987291873504773320746608E-01), /* 3ffeff6018fd65896800000000000000 */
+ L(9.98810522443035364581476187595399097E-01), /* 3ffeff6417c196471000000000000000 */
+ L(9.98841004186298203615379520670103375E-01), /* 3ffeff68168dc4951400000000000000 */
+ L(9.98871486859804230684645176552294288E-01), /* 3ffeff6c1561f0837400000000000000 */
+ L(9.98901970463581839743127943620493170E-01), /* 3ffeff70143e1a222c00000000000000 */
+ L(9.98932454997659369233531378995394334E-01), /* 3ffeff74132241813000000000000000 */
+ L(9.98962940462065268620861502313346136E-01), /* 3ffeff78120e66b08400000000000000 */
+ L(9.98993426856827904103397486323956400E-01), /* 3ffeff7c110289c02000000000000000 */
+ L(9.99023914181975669634994119405746460E-01), /* 3ffeff800ffeaac00000000000000000 */
+ L(9.99054402437536959169506189937237650E-01), /* 3ffeff840f02c9c02000000000000000 */
+ L(9.99084891623540138905212870668037795E-01), /* 3ffeff880e0ee6d07800000000000000 */
+ L(9.99115381740013658307120181234495249E-01), /* 3ffeff8c0d2302010c00000000000000 */
+ L(9.99145872786985911329082910015131347E-01), /* 3ffeff900c3f1b61d800000000000000 */
+ L(9.99176364764485236413804614130640402E-01), /* 3ffeff940b633302d000000000000000 */
+ L(9.99206857672540083026291313217370771E-01), /* 3ffeff980a8f48f3f800000000000000 */
+ L(9.99237351511178817364822180024930276E-01), /* 3ffeff9c09c35d454800000000000000 */
+ L(9.99267846280429861138827618560753763E-01), /* 3ffeffa008ff7006c000000000000000 */
+ L(9.99298341980321608302162417203362565E-01), /* 3ffeffa4084381485c00000000000000 */
+ L(9.99328838610882452808681364331278019E-01), /* 3ffeffa8078f911a1800000000000000 */
+ L(9.99359336172140816367814863951934967E-01), /* 3ffeffac06e39f8bf400000000000000 */
+ L(9.99389834664125092933417704443854745E-01), /* 3ffeffb0063facadec00000000000000 */
+ L(9.99420334086863676459344674185558688E-01), /* 3ffeffb405a3b88ffc00000000000000 */
+ L(9.99450834440384988655026177184481639E-01), /* 3ffeffb8050fc3422400000000000000 */
+ L(9.99481335724717395718741386190231424E-01), /* 3ffeffbc0483ccd45c00000000000000 */
+ L(9.99511837939889374871071936468069907E-01), /* 3ffeffc003ffd556ac00000000000000 */
+ L(9.99542341085929264554721385138691403E-01), /* 3ffeffc40383dcd90800000000000000 */
+ L(9.99572845162865514234695751838444266E-01), /* 3ffeffc8030fe36b7400000000000000 */
+ L(9.99603350170726517864849824945849832E-01), /* 3ffeffcc02a3e91dec00000000000000 */
+ L(9.99633856109540669399038392839429434E-01), /* 3ffeffd0023fee006c00000000000000 */
+ L(9.99664362979336418302267475155531429E-01), /* 3ffeffd401e3f222f800000000000000 */
+ L(9.99694870780142130772816244643763639E-01), /* 3ffeffd8018ff5958800000000000000 */
+ L(9.99725379511986284031266336569387931E-01), /* 3ffeffdc0143f8682400000000000000 */
+ L(9.99755889174897216520321308053098619E-01), /* 3ffeffe000fffaaac000000000000000 */
+ L(9.99786399768903377704987178731244057E-01), /* 3ffeffe400c3fc6d6000000000000000 */
+ L(9.99816911294033217050269968240172602E-01), /* 3ffeffe8008ffdc00800000000000000 */
+ L(9.99847423750315072998873233700578567E-01), /* 3ffeffec0063feb2ac00000000000000 */
+ L(9.99877937137777450526954226006637327E-01), /* 3ffefff0003fff555800000000000000 */
+ L(9.99908451456448688077216502279043198E-01), /* 3ffefff40023ffb80000000000000000 */
+ L(9.99938966706357262870241697783058044E-01), /* 3ffefff8000fffeaac00000000000000 */
+ L(9.99969482887531541104308985268289689E-01), /* 3ffefffc0003fffd5400000000000000 */
#define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
- 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
- 1.00003051804379100575559391472779680E+00L, /* 3fff0002000200015400000000000000 */
- 1.00006103701893306334724798034585547E+00L, /* 3fff00040008000aac00000000000000 */
- 1.00009155692545448346209013834595680E+00L, /* 3fff0006001200240000000000000000 */
- 1.00012207776338379883185325525118969E+00L, /* 3fff0008002000555800000000000000 */
- 1.00015259953274932014366527255333494E+00L, /* 3fff000a003200a6ac00000000000000 */
- 1.00018312223357958012925905677548144E+00L, /* 3fff000c004801200400000000000000 */
- 1.00021364586590294498691378066723701E+00L, /* 3fff000e006201c95c00000000000000 */
- 1.00024417042974783642605984823603649E+00L, /* 3fff0010008002aab400000000000000 */
- 1.00027469592514273166727889474714175E+00L, /* 3fff001200a203cc1000000000000000 */
- 1.00030522235211605242000132420798764E+00L, /* 3fff001400c805357000000000000000 */
- 1.00033574971069616488250630936818197E+00L, /* 3fff001600f206eed000000000000000 */
- 1.00036627800091160178652671675081365E+00L, /* 3fff0018012009003800000000000000 */
- 1.00039680722279067381919048784766346E+00L, /* 3fff001a01520b71a000000000000000 */
- 1.00042733737636191371223048918182030E+00L, /* 3fff001c01880e4b1000000000000000 */
- 1.00045786846165368766392589350289200E+00L, /* 3fff001e01c211948400000000000000 */
- 1.00048840047869447289485833607614040E+00L, /* 3fff0020020015560000000000000000 */
- 1.00051893342751269111445822090900037E+00L, /* 3fff0022024219978400000000000000 */
- 1.00054946730813676403215595200890675E+00L, /* 3fff002402881e611000000000000000 */
- 1.00058000212059516886853316464112140E+00L, /* 3fff002602d223baa800000000000000 */
- 1.00061053786491632733302026281307917E+00L, /* 3fff0028032029ac4c00000000000000 */
- 1.00064107454112866113504765053221490E+00L, /* 3fff002a0372303dfc00000000000000 */
- 1.00067161214926059198404573180596344E+00L, /* 3fff002c03c83777b800000000000000 */
- 1.00070215068934059710059614189958666E+00L, /* 3fff002e04223f618400000000000000 */
- 1.00073269016139709819412928482051939E+00L, /* 3fff0030048048036000000000000000 */
- 1.00076323056545857248522679583402351E+00L, /* 3fff003204e251655000000000000000 */
- 1.00079377190155338617216784768970683E+00L, /* 3fff003405485b8f5000000000000000 */
- 1.00082431416971007198668530691065826E+00L, /* 3fff003605b266896800000000000000 */
- 1.00085485736995705163820957750431262E+00L, /* 3fff00380620725b9800000000000000 */
- 1.00088540150232269132501983222027775E+00L, /* 3fff003a06927f0ddc00000000000000 */
- 1.00091594656683552377884893758164253E+00L, /* 3fff003c07088ca83c00000000000000 */
- 1.00094649256352402622027852885366883E+00L, /* 3fff003e07829b32bc00000000000000 */
- 1.00097703949241650933643654752813745E+00L, /* 3fff00400800aab55400000000000000 */
- 1.00100758735354156137020709138596430E+00L, /* 3fff00420882bb381000000000000000 */
- 1.00103813614692760403102056443458423E+00L, /* 3fff00440908ccc2f000000000000000 */
- 1.00106868587260300351715613942360505E+00L, /* 3fff00460992df5df000000000000000 */
- 1.00109923653059629256034668287611566E+00L, /* 3fff00480a20f3111800000000000000 */
- 1.00112978812093589287002259879955091E+00L, /* 3fff004a0ab307e46800000000000000 */
- 1.00116034064365022615561429120134562E+00L, /* 3fff004c0b491ddfe000000000000000 */
- 1.00119089409876788066000585786241572E+00L, /* 3fff004e0be3350b8c00000000000000 */
- 1.00122144848631711155917400901671499E+00L, /* 3fff00500c814d6f6000000000000000 */
- 1.00125200380632656260715407370298635E+00L, /* 3fff00520d2367136c00000000000000 */
- 1.00128256005882454449107399341301061E+00L, /* 3fff00540dc981ffa800000000000000 */
- 1.00131311724383964545381786592770368E+00L, /* 3fff00560e739e3c2000000000000000 */
- 1.00134367536140017618251363273884635E+00L, /* 3fff00580f21bbd0cc00000000000000 */
- 1.00137423441153472492004539162735455E+00L, /* 3fff005a0fd3dac5b800000000000000 */
- 1.00140479439427171337584354660066310E+00L, /* 3fff005c1089fb22e400000000000000 */
- 1.00143535530963956325933850166620687E+00L, /* 3fff005e11441cf05000000000000000 */
- 1.00146591715766680730226312334707472E+00L, /* 3fff0060120240360400000000000000 */
- 1.00149647993838186721404781565070152E+00L, /* 3fff006212c464fc0000000000000000 */
- 1.00152704365181316470412298258452211E+00L, /* 3fff0064138a8b4a4400000000000000 */
- 1.00155760829798923250422149067162536E+00L, /* 3fff00661454b328d800000000000000 */
- 1.00158817387693849232377374391944613E+00L, /* 3fff00681522dc9fbc00000000000000 */
- 1.00161874038868942138336137759324629E+00L, /* 3fff006a15f507b6f400000000000000 */
- 1.00164930783327055241471725821611471E+00L, /* 3fff006c16cb34768800000000000000 */
- 1.00167987621071025161612055853765924E+00L, /* 3fff006e17a562e67400000000000000 */
- 1.00171044552103705171930414508096874E+00L, /* 3fff00701883930ec000000000000000 */
- 1.00174101576427937443369842185347807E+00L, /* 3fff00721965c4f76c00000000000000 */
- 1.00177158694046569697988502412044909E+00L, /* 3fff00741a4bf8a87c00000000000000 */
- 1.00180215904962455208959681840497069E+00L, /* 3fff00761b362e29f800000000000000 */
- 1.00183273209178441698341543997230474E+00L, /* 3fff00781c246583e400000000000000 */
- 1.00186330606697365785962006157205906E+00L, /* 3fff007a1d169ebe3c00000000000000 */
- 1.00189388097522080744994354972732253E+00L, /* 3fff007c1e0cd9e10800000000000000 */
- 1.00192445681655439848611877096118405E+00L, /* 3fff007e1f0716f45000000000000000 */
- 1.00195503359100279716642489802325144E+00L, /* 3fff0080200556001000000000000000 */
- 1.00198561129859459173374602869444061E+00L, /* 3fff00822107970c5400000000000000 */
+ L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+ L(1.00003051804379100575559391472779680E+00), /* 3fff0002000200015400000000000000 */
+ L(1.00006103701893306334724798034585547E+00), /* 3fff00040008000aac00000000000000 */
+ L(1.00009155692545448346209013834595680E+00), /* 3fff0006001200240000000000000000 */
+ L(1.00012207776338379883185325525118969E+00), /* 3fff0008002000555800000000000000 */
+ L(1.00015259953274932014366527255333494E+00), /* 3fff000a003200a6ac00000000000000 */
+ L(1.00018312223357958012925905677548144E+00), /* 3fff000c004801200400000000000000 */
+ L(1.00021364586590294498691378066723701E+00), /* 3fff000e006201c95c00000000000000 */
+ L(1.00024417042974783642605984823603649E+00), /* 3fff0010008002aab400000000000000 */
+ L(1.00027469592514273166727889474714175E+00), /* 3fff001200a203cc1000000000000000 */
+ L(1.00030522235211605242000132420798764E+00), /* 3fff001400c805357000000000000000 */
+ L(1.00033574971069616488250630936818197E+00), /* 3fff001600f206eed000000000000000 */
+ L(1.00036627800091160178652671675081365E+00), /* 3fff0018012009003800000000000000 */
+ L(1.00039680722279067381919048784766346E+00), /* 3fff001a01520b71a000000000000000 */
+ L(1.00042733737636191371223048918182030E+00), /* 3fff001c01880e4b1000000000000000 */
+ L(1.00045786846165368766392589350289200E+00), /* 3fff001e01c211948400000000000000 */
+ L(1.00048840047869447289485833607614040E+00), /* 3fff0020020015560000000000000000 */
+ L(1.00051893342751269111445822090900037E+00), /* 3fff0022024219978400000000000000 */
+ L(1.00054946730813676403215595200890675E+00), /* 3fff002402881e611000000000000000 */
+ L(1.00058000212059516886853316464112140E+00), /* 3fff002602d223baa800000000000000 */
+ L(1.00061053786491632733302026281307917E+00), /* 3fff0028032029ac4c00000000000000 */
+ L(1.00064107454112866113504765053221490E+00), /* 3fff002a0372303dfc00000000000000 */
+ L(1.00067161214926059198404573180596344E+00), /* 3fff002c03c83777b800000000000000 */
+ L(1.00070215068934059710059614189958666E+00), /* 3fff002e04223f618400000000000000 */
+ L(1.00073269016139709819412928482051939E+00), /* 3fff0030048048036000000000000000 */
+ L(1.00076323056545857248522679583402351E+00), /* 3fff003204e251655000000000000000 */
+ L(1.00079377190155338617216784768970683E+00), /* 3fff003405485b8f5000000000000000 */
+ L(1.00082431416971007198668530691065826E+00), /* 3fff003605b266896800000000000000 */
+ L(1.00085485736995705163820957750431262E+00), /* 3fff00380620725b9800000000000000 */
+ L(1.00088540150232269132501983222027775E+00), /* 3fff003a06927f0ddc00000000000000 */
+ L(1.00091594656683552377884893758164253E+00), /* 3fff003c07088ca83c00000000000000 */
+ L(1.00094649256352402622027852885366883E+00), /* 3fff003e07829b32bc00000000000000 */
+ L(1.00097703949241650933643654752813745E+00), /* 3fff00400800aab55400000000000000 */
+ L(1.00100758735354156137020709138596430E+00), /* 3fff00420882bb381000000000000000 */
+ L(1.00103813614692760403102056443458423E+00), /* 3fff00440908ccc2f000000000000000 */
+ L(1.00106868587260300351715613942360505E+00), /* 3fff00460992df5df000000000000000 */
+ L(1.00109923653059629256034668287611566E+00), /* 3fff00480a20f3111800000000000000 */
+ L(1.00112978812093589287002259879955091E+00), /* 3fff004a0ab307e46800000000000000 */
+ L(1.00116034064365022615561429120134562E+00), /* 3fff004c0b491ddfe000000000000000 */
+ L(1.00119089409876788066000585786241572E+00), /* 3fff004e0be3350b8c00000000000000 */
+ L(1.00122144848631711155917400901671499E+00), /* 3fff00500c814d6f6000000000000000 */
+ L(1.00125200380632656260715407370298635E+00), /* 3fff00520d2367136c00000000000000 */
+ L(1.00128256005882454449107399341301061E+00), /* 3fff00540dc981ffa800000000000000 */
+ L(1.00131311724383964545381786592770368E+00), /* 3fff00560e739e3c2000000000000000 */
+ L(1.00134367536140017618251363273884635E+00), /* 3fff00580f21bbd0cc00000000000000 */
+ L(1.00137423441153472492004539162735455E+00), /* 3fff005a0fd3dac5b800000000000000 */
+ L(1.00140479439427171337584354660066310E+00), /* 3fff005c1089fb22e400000000000000 */
+ L(1.00143535530963956325933850166620687E+00), /* 3fff005e11441cf05000000000000000 */
+ L(1.00146591715766680730226312334707472E+00), /* 3fff0060120240360400000000000000 */
+ L(1.00149647993838186721404781565070152E+00), /* 3fff006212c464fc0000000000000000 */
+ L(1.00152704365181316470412298258452211E+00), /* 3fff0064138a8b4a4400000000000000 */
+ L(1.00155760829798923250422149067162536E+00), /* 3fff00661454b328d800000000000000 */
+ L(1.00158817387693849232377374391944613E+00), /* 3fff00681522dc9fbc00000000000000 */
+ L(1.00161874038868942138336137759324629E+00), /* 3fff006a15f507b6f400000000000000 */
+ L(1.00164930783327055241471725821611471E+00), /* 3fff006c16cb34768800000000000000 */
+ L(1.00167987621071025161612055853765924E+00), /* 3fff006e17a562e67400000000000000 */
+ L(1.00171044552103705171930414508096874E+00), /* 3fff00701883930ec000000000000000 */
+ L(1.00174101576427937443369842185347807E+00), /* 3fff00721965c4f76c00000000000000 */
+ L(1.00177158694046569697988502412044909E+00), /* 3fff00741a4bf8a87c00000000000000 */
+ L(1.00180215904962455208959681840497069E+00), /* 3fff00761b362e29f800000000000000 */
+ L(1.00183273209178441698341543997230474E+00), /* 3fff00781c246583e400000000000000 */
+ L(1.00186330606697365785962006157205906E+00), /* 3fff007a1d169ebe3c00000000000000 */
+ L(1.00189388097522080744994354972732253E+00), /* 3fff007c1e0cd9e10800000000000000 */
+ L(1.00192445681655439848611877096118405E+00), /* 3fff007e1f0716f45000000000000000 */
+ L(1.00195503359100279716642489802325144E+00), /* 3fff0080200556001000000000000000 */
+ L(1.00198561129859459173374602869444061E+00), /* 3fff00822107970c5400000000000000 */
};
diff --git a/sysdeps/ieee754/ldbl-128/t_sincosl.c b/sysdeps/ieee754/ldbl-128/t_sincosl.c
index de5fe0d9e9..7d65c5fcb0 100644
--- a/sysdeps/ieee754/ldbl-128/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/t_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -25,669 +25,672 @@
Computed using gmp.
*/
-const long double __sincosl_table[] = {
+/* Include to grab typedefs and wrappers for _Float128 and such. */
+#include <math_private.h>
+
+const _Float128 __sincosl_table[] = {
/* x = 1.48437500000000000000000000000000000e-01L 3ffc3000000000000000000000000000 */
/* cos(x) = 0.fd2f5320e1b790209b4dda2f98f79caaa7b873aff1014b0fbc5243766d03cb006bc837c4358 */
- 9.89003367927322909016887196069562069e-01L, /* 3ffefa5ea641c36f2041369bb45f31ef */
- 2.15663692029265697782289400027743703e-35L, /* 3f8bcaaa7b873aff1014b0fbc5243767 */
+ L(9.89003367927322909016887196069562069e-01), /* 3ffefa5ea641c36f2041369bb45f31ef */
+ L(2.15663692029265697782289400027743703e-35), /* 3f8bcaaa7b873aff1014b0fbc5243767 */
/* sin(x) = 0.25dc50bc95711d0d9787d108fd438cf5959ee0bfb7a1e36e8b1a112968f356657420e9cc9ea */
- 1.47892995873409608580026675734609314e-01L, /* 3ffc2ee285e4ab88e86cbc3e8847ea1c */
- 9.74950446464233268291647449768590886e-36L, /* 3f8a9eb2b3dc17f6f43c6dd16342252d */
+ L(1.47892995873409608580026675734609314e-01), /* 3ffc2ee285e4ab88e86cbc3e8847ea1c */
+ L(9.74950446464233268291647449768590886e-36), /* 3f8a9eb2b3dc17f6f43c6dd16342252d */
/* x = 1.56250000000000000000000000000000000e-01 3ffc4000000000000000000000000000 */
/* cos(x) = 0.fce1a053e621438b6d60c76e8c45bf0a9dc71aa16f922acc10e95144ec796a249813c9cb649 */
- 9.87817783816471944100503034363211317e-01L, /* 3ffef9c340a7cc428716dac18edd188b */
- 4.74271307836705897892468107620526395e-35L, /* 3f8cf854ee38d50b7c915660874a8a27 */
+ L(9.87817783816471944100503034363211317e-01), /* 3ffef9c340a7cc428716dac18edd188b */
+ L(4.74271307836705897892468107620526395e-35), /* 3f8cf854ee38d50b7c915660874a8a27 */
/* sin(x) = 0.27d66258bacd96a3eb335b365c87d59438c5142bb56a489e9b8db9d36234ffdebb6bdc22d8e */
- 1.55614992773556041209920643203516258e-01L, /* 3ffc3eb312c5d66cb51f599ad9b2e43f */
--7.83989563419287980121718050629497270e-36L, /* bf8a4d78e75d7a8952b6ec2c8e48c594 */
+ L(1.55614992773556041209920643203516258e-01), /* 3ffc3eb312c5d66cb51f599ad9b2e43f */
+L(-7.83989563419287980121718050629497270e-36), /* bf8a4d78e75d7a8952b6ec2c8e48c594 */
/* x = 1.64062500000000000000000000000000000e-01 3ffc5000000000000000000000000000 */
/* cos(x) = 0.fc8ffa01ba6807417e05962b0d9fdf1fddb0cc4c07d22e19e08019bffa50a6c7acdb40307a3 */
- 9.86571908399497588757337407495308409e-01L, /* 3ffef91ff40374d00e82fc0b2c561b40 */
--2.47327949936985362476252401212720725e-35L, /* bf8c070112799d9fc16e8f30fbff3200 */
+ L(9.86571908399497588757337407495308409e-01), /* 3ffef91ff40374d00e82fc0b2c561b40 */
+L(-2.47327949936985362476252401212720725e-35), /* bf8c070112799d9fc16e8f30fbff3200 */
/* sin(x) = 0.29cfd49b8be4f665276cab01cbf0426934906c3dd105473b226e410b1450f62e53ff7c6cce1 */
- 1.63327491736612850846866172454354370e-01L, /* 3ffc4e7ea4dc5f27b3293b65580e5f82 */
- 1.81380344301155485770367902300754350e-36L, /* 3f88349a48361ee882a39d913720858a */
+ L(1.63327491736612850846866172454354370e-01), /* 3ffc4e7ea4dc5f27b3293b65580e5f82 */
+ L(1.81380344301155485770367902300754350e-36), /* 3f88349a48361ee882a39d913720858a */
/* x = 1.71875000000000000000000000000000000e-01 3ffc6000000000000000000000000000 */
/* cos(x) = 0.fc3a6170f767ac735d63d99a9d439e1db5e59d3ef153a4265d5855850ed82b536bf361b80e3 */
- 9.85265817718213816204294709759578994e-01L, /* 3ffef874c2e1eecf58e6bac7b3353a87 */
- 2.26568029505818066141517497778527952e-35L, /* 3f8be1db5e59d3ef153a4265d5855851 */
+ L(9.85265817718213816204294709759578994e-01), /* 3ffef874c2e1eecf58e6bac7b3353a87 */
+ L(2.26568029505818066141517497778527952e-35), /* 3f8be1db5e59d3ef153a4265d5855851 */
/* sin(x) = 0.2bc89f9f424de5485de7ce03b2514952b9faf5648c3244d4736feb95dbb9da49f3b58a9253b */
- 1.71030022031395019281347969239834331e-01L, /* 3ffc5e44fcfa126f2a42ef3e701d928a */
- 7.01395875187487608875416030203241317e-36L, /* 3f8a2a573f5eac9186489a8e6dfd72bb */
+ L(1.71030022031395019281347969239834331e-01), /* 3ffc5e44fcfa126f2a42ef3e701d928a */
+ L(7.01395875187487608875416030203241317e-36), /* 3f8a2a573f5eac9186489a8e6dfd72bb */
/* x = 1.79687500000000000000000000000000000e-01 3ffc7000000000000000000000000000 */
/* cos(x) = 0.fbe0d7f7fef11e70aa43b8abf4f6a457cea20c8f3f676b47781f9821bbe9ce04b3c7b981c0b */
- 9.83899591489663972178309351416487245e-01L, /* 3ffef7c1afeffde23ce154877157e9ed */
- 2.73414318948066207810486330723761265e-35L, /* 3f8c22be75106479fb3b5a3bc0fcc10e */
+ L(9.83899591489663972178309351416487245e-01), /* 3ffef7c1afeffde23ce154877157e9ed */
+ L(2.73414318948066207810486330723761265e-35), /* 3f8c22be75106479fb3b5a3bc0fcc10e */
/* sin(x) = 0.2dc0bb80b49a97ffb34e8dd1f8db9df7af47ed2dcf58b12c8e7827e048cae929da02c04ecac */
- 1.78722113535153659375356241864180724e-01L, /* 3ffc6e05dc05a4d4bffd9a746e8fc6dd */
--1.52906926517265103202547561260594148e-36L, /* bf8804285c09691853a769b8c3ec0fdc */
+ L(1.78722113535153659375356241864180724e-01), /* 3ffc6e05dc05a4d4bffd9a746e8fc6dd */
+L(-1.52906926517265103202547561260594148e-36), /* bf8804285c09691853a769b8c3ec0fdc */
/* x = 1.87500000000000000000000000000000000e-01 3ffc8000000000000000000000000000 */
/* cos(x) = 0.fb835efcf670dd2ce6fe7924697eea13ea358867e9cdb3899b783f4f9f43aa5626e8b67b3bc */
- 9.82473313101255257487327683243622495e-01L, /* 3ffef706bdf9ece1ba59cdfcf248d2fe */
--1.64924358891557584625463868014230342e-35L, /* bf8b5ec15ca779816324c766487c0b06 */
+ L(9.82473313101255257487327683243622495e-01), /* 3ffef706bdf9ece1ba59cdfcf248d2fe */
+L(-1.64924358891557584625463868014230342e-35), /* bf8b5ec15ca779816324c766487c0b06 */
/* sin(x) = 0.2fb8205f75e56a2b56a1c4792f856258769af396e0189ef72c05e4df59a6b00e4b44a6ea515 */
- 1.86403296762269884552379983103205261e-01L, /* 3ffc7dc102fbaf2b515ab50e23c97c2b */
- 1.76460304806826780010586715975331753e-36L, /* 3f882c3b4d79cb700c4f7b9602f26fad */
+ L(1.86403296762269884552379983103205261e-01), /* 3ffc7dc102fbaf2b515ab50e23c97c2b */
+ L(1.76460304806826780010586715975331753e-36), /* 3f882c3b4d79cb700c4f7b9602f26fad */
/* x = 1.95312500000000000000000000000000000e-01 3ffc9000000000000000000000000000 */
/* cos(x) = 0.fb21f7f5c156696b00ac1fe28ac5fd76674a92b4df80d9c8a46c684399005deccc41386257c */
- 9.80987069605669190469329896435309665e-01L, /* 3ffef643efeb82acd2d601583fc5158c */
--1.90899259410096419886996331536278461e-36L, /* bf8844cc5ab6a5903f931badc9cbde34 */
+ L(9.80987069605669190469329896435309665e-01), /* 3ffef643efeb82acd2d601583fc5158c */
+L(-1.90899259410096419886996331536278461e-36), /* bf8844cc5ab6a5903f931badc9cbde34 */
/* sin(x) = 0.31aec65df552876f82ece9a2356713246eba6799983d7011b0b3698d6e1da919c15d57c30c1 */
- 1.94073102892909791156055200214145404e-01L, /* 3ffc8d7632efaa943b7c17674d11ab39 */
--9.67304741051998267208945242944928999e-36L, /* bf8a9b7228b30cccf851fdc9e992ce52 */
+ L(1.94073102892909791156055200214145404e-01), /* 3ffc8d7632efaa943b7c17674d11ab39 */
+L(-9.67304741051998267208945242944928999e-36), /* bf8a9b7228b30cccf851fdc9e992ce52 */
/* x = 2.03125000000000000000000000000000000e-01 3ffca000000000000000000000000000 */
/* cos(x) = 0.fabca467fb3cb8f1d069f01d8ea33ade5bfd68296ecd1cc9f7b7609bbcf3676e726c3301334 */
- 9.79440951715548359998530954502987493e-01L, /* 3ffef57948cff67971e3a0d3e03b1d46 */
- 4.42878056591560757066844797290067990e-35L, /* 3f8cd6f2dfeb414b7668e64fbdbb04de */
+ L(9.79440951715548359998530954502987493e-01), /* 3ffef57948cff67971e3a0d3e03b1d46 */
+ L(4.42878056591560757066844797290067990e-35), /* 3f8cd6f2dfeb414b7668e64fbdbb04de */
/* sin(x) = 0.33a4a5a19d86246710f602c44df4fa513f4639ce938477aeeabb82e8e0a7ed583a188879fd4 */
- 2.01731063801638804725038151164000971e-01L, /* 3ffc9d252d0cec31233887b016226fa8 */
--4.27513434754966978435151290617384120e-36L, /* bf896bb02e718c5b1ee21445511f45c8 */
+ L(2.01731063801638804725038151164000971e-01), /* 3ffc9d252d0cec31233887b016226fa8 */
+L(-4.27513434754966978435151290617384120e-36), /* bf896bb02e718c5b1ee21445511f45c8 */
/* x = 2.10937500000000000000000000000000000e-01 3ffcb000000000000000000000000000 */
/* cos(x) = 0.fa5365e8f1d3ca27be1db5d76ae64d983d7470a4ab0f4ccf65a2b8c67a380df949953a09bc1 */
- 9.77835053797959793331971572944454549e-01L, /* 3ffef4a6cbd1e3a7944f7c3b6baed5cd */
--3.79207422905180416937210853779192702e-35L, /* bf8c933e145c7adaa7859984d2ea39cc */
+ L(9.77835053797959793331971572944454549e-01), /* 3ffef4a6cbd1e3a7944f7c3b6baed5cd */
+L(-3.79207422905180416937210853779192702e-35), /* bf8c933e145c7adaa7859984d2ea39cc */
/* sin(x) = 0.3599b652f40ec999df12a0a4c8561de159c98d4e54555de518b97f48886f715d8df5f4f093e */
- 2.09376712085993643711890752724881652e-01L, /* 3ffcaccdb297a0764ccef895052642b1 */
--1.59470287344329449965314638482515925e-36L, /* bf880f531b3958d5d5510d73a3405bbc */
+ L(2.09376712085993643711890752724881652e-01), /* 3ffcaccdb297a0764ccef895052642b1 */
+L(-1.59470287344329449965314638482515925e-36), /* bf880f531b3958d5d5510d73a3405bbc */
/* x = 2.18750000000000000000000000000000000e-01 3ffcc000000000000000000000000000 */
/* cos(x) = 0.f9e63e1d9e8b6f6f2e296bae5b5ed9c11fd7fa2fe11e09fc7bde901abed24b6365e72f7db4e */
- 9.76169473868635276723989035435135534e-01L, /* 3ffef3cc7c3b3d16dede5c52d75cb6be */
--2.87727974249481583047944860626985460e-35L, /* bf8c31f701402e80f70fb01c210b7f2a */
+ L(9.76169473868635276723989035435135534e-01), /* 3ffef3cc7c3b3d16dede5c52d75cb6be */
+L(-2.87727974249481583047944860626985460e-35), /* bf8c31f701402e80f70fb01c210b7f2a */
/* sin(x) = 0.378df09db8c332ce0d2b53d865582e4526ea336c768f68c32b496c6d11c1cd241bb9f1da523 */
- 2.17009581095010156760578095826055396e-01L, /* 3ffcbc6f84edc6199670695a9ec32ac1 */
- 1.07356488794216831812829549198201194e-35L, /* 3f8ac8a4dd466d8ed1ed1865692d8da2 */
+ L(2.17009581095010156760578095826055396e-01), /* 3ffcbc6f84edc6199670695a9ec32ac1 */
+ L(1.07356488794216831812829549198201194e-35), /* 3f8ac8a4dd466d8ed1ed1865692d8da2 */
/* x = 2.26562500000000000000000000000000000e-01 3ffcd000000000000000000000000000 */
/* cos(x) = 0.f9752eba9fff6b98842beadab054a932fb0f8d5b875ae63d6b2288d09b148921aeb6e52f61b */
- 9.74444313585988980349711056045434344e-01L, /* 3ffef2ea5d753ffed7310857d5b560a9 */
- 3.09947905955053419304514538592548333e-35L, /* 3f8c4997d87c6adc3ad731eb59144685 */
+ L(9.74444313585988980349711056045434344e-01), /* 3ffef2ea5d753ffed7310857d5b560a9 */
+ L(3.09947905955053419304514538592548333e-35), /* 3f8c4997d87c6adc3ad731eb59144685 */
/* sin(x) = 0.39814cb10513453cb97b21bc1ca6a337b150c21a675ab85503bc09a436a10ab1473934e20c8 */
- 2.24629204957705292350428549796424820e-01L, /* 3ffccc0a6588289a29e5cbd90de0e535 */
- 2.42061510849297469844695751870058679e-36L, /* 3f889bd8a8610d33ad5c2a81de04d21b */
+ L(2.24629204957705292350428549796424820e-01), /* 3ffccc0a6588289a29e5cbd90de0e535 */
+ L(2.42061510849297469844695751870058679e-36), /* 3f889bd8a8610d33ad5c2a81de04d21b */
/* x = 2.34375000000000000000000000000000000e-01 3ffce000000000000000000000000000 */
/* cos(x) = 0.f90039843324f9b940416c1984b6cbed1fc733d97354d4265788a86150493ce657cae032674 */
- 9.72659678244912752670913058267565260e-01L, /* 3ffef20073086649f3728082d833096e */
--3.91759231819314904966076958560252735e-35L, /* bf8ca09701c6613465595ecd43babcf5 */
+ L(9.72659678244912752670913058267565260e-01), /* 3ffef20073086649f3728082d833096e */
+L(-3.91759231819314904966076958560252735e-35), /* bf8ca09701c6613465595ecd43babcf5 */
/* sin(x) = 0.3b73c2bf6b4b9f668ef9499c81f0d965087f1753fa64b086e58cb8470515c18c1412f8c2e02 */
- 2.32235118611511462413930877746235872e-01L, /* 3ffcdb9e15fb5a5cfb3477ca4ce40f87 */
--4.96930483364191020075024624332928910e-36L, /* bf89a6bde03a2b0166d3de469cd1ee3f */
+ L(2.32235118611511462413930877746235872e-01), /* 3ffcdb9e15fb5a5cfb3477ca4ce40f87 */
+L(-4.96930483364191020075024624332928910e-36), /* bf89a6bde03a2b0166d3de469cd1ee3f */
/* x = 2.42187500000000000000000000000000000e-01 3ffcf000000000000000000000000000 */
/* cos(x) = 0.f887604e2c39dbb20e4ec5825059a789ffc95b275ad9954078ba8a28d3fcfe9cc2c1d49697b */
- 9.70815676770349462947490545785046027e-01L, /* 3ffef10ec09c5873b7641c9d8b04a0b3 */
- 2.97458820972393859125277682021202860e-35L, /* 3f8c3c4ffe4ad93ad6ccaa03c5d45147 */
+ L(9.70815676770349462947490545785046027e-01), /* 3ffef10ec09c5873b7641c9d8b04a0b3 */
+ L(2.97458820972393859125277682021202860e-35), /* 3f8c3c4ffe4ad93ad6ccaa03c5d45147 */
/* sin(x) = 0.3d654aff15cb457a0fca854698aba33039a8a40626609204472d9d40309b626eccc6dff0ffa */
- 2.39826857830661564441369251810886574e-01L, /* 3ffceb2a57f8ae5a2bd07e542a34c55d */
- 2.39867036569896287240938444445071448e-36L, /* 3f88981cd45203133049022396cea018 */
+ L(2.39826857830661564441369251810886574e-01), /* 3ffceb2a57f8ae5a2bd07e542a34c55d */
+ L(2.39867036569896287240938444445071448e-36), /* 3f88981cd45203133049022396cea018 */
/* x = 2.50000000000000000000000000000000000e-01 3ffd0000000000000000000000000000 */
/* cos(x) = 0.f80aa4fbef750ba783d33cb95f94f8a41426dbe79edc4a023ef9ec13c944551c0795b84fee1 */
- 9.68912421710644784144595449494189205e-01L, /* 3ffef01549f7deea174f07a67972bf2a */
--5.53634706113461989398873287749326500e-36L, /* bf89d6faf649061848ed7f704184fb0e */
+ L(9.68912421710644784144595449494189205e-01), /* 3ffef01549f7deea174f07a67972bf2a */
+L(-5.53634706113461989398873287749326500e-36), /* bf89d6faf649061848ed7f704184fb0e */
/* sin(x) = 0.3f55dda9e62aed7513bd7b8e6a3d1635dd5676648d7db525898d7086af9330f03c7f285442a */
- 2.47403959254522929596848704849389203e-01L, /* 3ffcfaaeed4f31576ba89debdc7351e9 */
--7.36487001108599532943597115275811618e-36L, /* bf8a39445531336e50495b4ece51ef2a */
+ L(2.47403959254522929596848704849389203e-01), /* 3ffcfaaeed4f31576ba89debdc7351e9 */
+L(-7.36487001108599532943597115275811618e-36), /* bf8a39445531336e50495b4ece51ef2a */
/* x = 2.57812500000000000000000000000000000e-01 3ffd0800000000000000000000000000 */
/* cos(x) = 0.f78a098069792daabc9ee42591b7c5a68cb1ab822aeb446b3311b4ba5371b8970e2c1547ad7 */
- 9.66950029230677822008341623610531503e-01L, /* 3ffeef141300d2f25b55793dc84b2370 */
--4.38972214432792412062088059990480514e-35L, /* bf8cd2cb9a72a3eea8a5dca667725a2d */
+ L(9.66950029230677822008341623610531503e-01), /* 3ffeef141300d2f25b55793dc84b2370 */
+L(-4.38972214432792412062088059990480514e-35), /* bf8cd2cb9a72a3eea8a5dca667725a2d */
/* sin(x) = 0.414572fd94556e6473d620271388dd47c0ba050cdb5270112e3e370e8c4705ae006426fb5d5 */
- 2.54965960415878467487556574864872628e-01L, /* 3ffd0515cbf65155b991cf58809c4e23 */
- 2.20280377918534721005071688328074154e-35L, /* 3f8bd47c0ba050cdb5270112e3e370e9 */
+ L(2.54965960415878467487556574864872628e-01), /* 3ffd0515cbf65155b991cf58809c4e23 */
+ L(2.20280377918534721005071688328074154e-35), /* 3f8bd47c0ba050cdb5270112e3e370e9 */
/* x = 2.65625000000000000000000000000000000e-01 3ffd1000000000000000000000000000 */
/* cos(x) = 0.f7058fde0788dfc805b8fe88789e4f4253e3c50afe8b22f41159620ab5940ff7df9557c0d1f */
- 9.64928619104771009581074665315748371e-01L, /* 3ffeee0b1fbc0f11bf900b71fd10f13d */
--3.66685832670820775002475545602761113e-35L, /* bf8c85ed60e1d7a80ba6e85f7534efaa */
+ L(9.64928619104771009581074665315748371e-01), /* 3ffeee0b1fbc0f11bf900b71fd10f13d */
+L(-3.66685832670820775002475545602761113e-35), /* bf8c85ed60e1d7a80ba6e85f7534efaa */
/* sin(x) = 0.4334033bcd90d6604f5f36c1d4b84451a87150438275b77470b50e5b968fa7962b5ffb379b7 */
- 2.62512399769153281450949626395692931e-01L, /* 3ffd0cd00cef364359813d7cdb0752e1 */
- 3.24923677072031064673177178571821843e-36L, /* 3f89146a1c5410e09d6ddd1c2d4396e6 */
+ L(2.62512399769153281450949626395692931e-01), /* 3ffd0cd00cef364359813d7cdb0752e1 */
+ L(3.24923677072031064673177178571821843e-36), /* 3f89146a1c5410e09d6ddd1c2d4396e6 */
/* x = 2.73437500000000000000000000000000000e-01 3ffd1800000000000000000000000000 */
/* cos(x) = 0.f67d3a26af7d07aa4bd6d42af8c0067fefb96d5b46c031eff53627f215ea3242edc3f2e13eb */
- 9.62848314709379699899701093480214365e-01L, /* 3ffeecfa744d5efa0f5497ada855f180 */
- 4.88986966383343450799422013051821394e-36L, /* 3f899ffbee5b56d1b00c7bfd4d89fc85 */
+ L(9.62848314709379699899701093480214365e-01), /* 3ffeecfa744d5efa0f5497ada855f180 */
+ L(4.88986966383343450799422013051821394e-36), /* 3f899ffbee5b56d1b00c7bfd4d89fc85 */
/* sin(x) = 0.452186aa5377ab20bbf2524f52e3a06a969f47166ab88cf88c111ad12c55941021ef3317a1a */
- 2.70042816718585031552755063618827102e-01L, /* 3ffd14861aa94ddeac82efc9493d4b8f */
--2.37608892440611310321138680065803162e-35L, /* bf8bf956960b8e99547730773eee52ed */
+ L(2.70042816718585031552755063618827102e-01), /* 3ffd14861aa94ddeac82efc9493d4b8f */
+L(-2.37608892440611310321138680065803162e-35), /* bf8bf956960b8e99547730773eee52ed */
/* x = 2.81250000000000000000000000000000000e-01 3ffd2000000000000000000000000000 */
/* cos(x) = 0.f5f10a7bb77d3dfa0c1da8b57842783280d01ce3c0f82bae3b9d623c168d2e7c29977994451 */
- 9.60709243015561903066659350581313472e-01L, /* 3ffeebe214f76efa7bf4183b516af085 */
--5.87011558231583960712013351601221840e-36L, /* bf89f35fcbf8c70fc1f5147118a770fa */
+ L(9.60709243015561903066659350581313472e-01), /* 3ffeebe214f76efa7bf4183b516af085 */
+L(-5.87011558231583960712013351601221840e-36), /* bf89f35fcbf8c70fc1f5147118a770fa */
/* sin(x) = 0.470df5931ae1d946076fe0dcff47fe31bb2ede618ebc607821f8462b639e1f4298b5ae87fd3 */
- 2.77556751646336325922023446828128568e-01L, /* 3ffd1c37d64c6b8765181dbf8373fd20 */
--1.35848595468998128214344668770082997e-36L, /* bf87ce44d1219e71439f87de07b9d49c */
+ L(2.77556751646336325922023446828128568e-01), /* 3ffd1c37d64c6b8765181dbf8373fd20 */
+L(-1.35848595468998128214344668770082997e-36), /* bf87ce44d1219e71439f87de07b9d49c */
/* x = 2.89062500000000000000000000000000000e-01 3ffd2800000000000000000000000000 */
/* cos(x) = 0.f561030ddd7a78960ea9f4a32c6521554995667f5547bafee9ec48b3155cdb0f7fd00509713 */
- 9.58511534581228627301969408154919822e-01L, /* 3ffeeac2061bbaf4f12c1d53e94658ca */
- 2.50770779371636481145735089393154404e-35L, /* 3f8c0aaa4cab33faaa3dd7f74f624599 */
+ L(9.58511534581228627301969408154919822e-01), /* 3ffeeac2061bbaf4f12c1d53e94658ca */
+ L(2.50770779371636481145735089393154404e-35), /* 3f8c0aaa4cab33faaa3dd7f74f624599 */
/* sin(x) = 0.48f948446abcd6b0f7fccb100e7a1b26eccad880b0d24b59948c7cdd49514d44b933e6985c2 */
- 2.85053745940547424587763033323252561e-01L, /* 3ffd23e52111aaf35ac3dff32c4039e8 */
- 2.04269325885902918802700123680403749e-35L, /* 3f8bb26eccad880b0d24b59948c7cdd5 */
+ L(2.85053745940547424587763033323252561e-01), /* 3ffd23e52111aaf35ac3dff32c4039e8 */
+ L(2.04269325885902918802700123680403749e-35), /* 3f8bb26eccad880b0d24b59948c7cdd5 */
/* x = 2.96875000000000000000000000000000000e-01 3ffd3000000000000000000000000000 */
/* cos(x) = 0.f4cd261d3e6c15bb369c8758630d2ac00b7ace2a51c0631bfeb39ed158ba924cc91e259c195 */
- 9.56255323543175296975599942263028361e-01L, /* 3ffee99a4c3a7cd82b766d390eb0c61a */
- 3.21616572190865997051103645135837207e-35L, /* 3f8c56005bd671528e0318dff59cf68b */
+ L(9.56255323543175296975599942263028361e-01), /* 3ffee99a4c3a7cd82b766d390eb0c61a */
+ L(3.21616572190865997051103645135837207e-35), /* 3f8c56005bd671528e0318dff59cf68b */
/* sin(x) = 0.4ae37710fad27c8aa9c4cf96c03519b9ce07dc08a1471775499f05c29f86190aaebaeb9716e */
- 2.92533342023327543624702326493913423e-01L, /* 3ffd2b8ddc43eb49f22aa7133e5b00d4 */
- 1.93539408668704450308003687950685128e-35L, /* 3f8b9b9ce07dc08a1471775499f05c2a */
+ L(2.92533342023327543624702326493913423e-01), /* 3ffd2b8ddc43eb49f22aa7133e5b00d4 */
+ L(1.93539408668704450308003687950685128e-35), /* 3f8b9b9ce07dc08a1471775499f05c2a */
/* x = 3.04687500000000000000000000000000000e-01 3ffd3800000000000000000000000000 */
/* cos(x) = 0.f43575f94d4f6b272f5fb76b14d2a64ab52df1ee8ddf7c651034e5b2889305a9ea9015d758a */
- 9.53940747608894733981324795987611623e-01L, /* 3ffee86aebf29a9ed64e5ebf6ed629a5 */
- 2.88075689052478602008395972924657164e-35L, /* 3f8c3255a96f8f746efbe32881a72d94 */
+ L(9.53940747608894733981324795987611623e-01), /* 3ffee86aebf29a9ed64e5ebf6ed629a5 */
+ L(2.88075689052478602008395972924657164e-35), /* 3f8c3255a96f8f746efbe32881a72d94 */
/* sin(x) = 0.4ccc7a50127e1de0cb6b40c302c651f7bded4f9e7702b0471ae0288d091a37391950907202f */
- 2.99995083378683051163248282011699944e-01L, /* 3ffd3331e94049f877832dad030c0b19 */
- 1.35174265535697850139283361475571050e-35L, /* 3f8b1f7bded4f9e7702b0471ae0288d1 */
+ L(2.99995083378683051163248282011699944e-01), /* 3ffd3331e94049f877832dad030c0b19 */
+ L(1.35174265535697850139283361475571050e-35), /* 3f8b1f7bded4f9e7702b0471ae0288d1 */
/* x = 3.12500000000000000000000000000000000e-01 3ffd4000000000000000000000000000 */
/* cos(x) = 0.f399f500c9e9fd37ae9957263dab8877102beb569f101ee4495350868e5847d181d50d3cca2 */
- 9.51567948048172202145488217364270962e-01L, /* 3ffee733ea0193d3fa6f5d32ae4c7b57 */
- 6.36842628598115658308749288799884606e-36L, /* 3f8a0ee2057d6ad3e203dc892a6a10d2 */
+ L(9.51567948048172202145488217364270962e-01), /* 3ffee733ea0193d3fa6f5d32ae4c7b57 */
+ L(6.36842628598115658308749288799884606e-36), /* 3f8a0ee2057d6ad3e203dc892a6a10d2 */
/* sin(x) = 0.4eb44a5da74f600207aaa090f0734e288603ffadb3eb2542a46977b105f8547128036dcf7f0 */
- 3.07438514580380850670502958201982091e-01L, /* 3ffd3ad129769d3d80081eaa8243c1cd */
- 1.06515172423204645839241099453417152e-35L, /* 3f8ac510c07ff5b67d64a8548d2ef621 */
+ L(3.07438514580380850670502958201982091e-01), /* 3ffd3ad129769d3d80081eaa8243c1cd */
+ L(1.06515172423204645839241099453417152e-35), /* 3f8ac510c07ff5b67d64a8548d2ef621 */
/* x = 3.20312500000000000000000000000000000e-01 3ffd4800000000000000000000000000 */
/* cos(x) = 0.f2faa5a1b74e82fd61fa05f9177380e8e69b7b15a945e8e5ae1124bf3d12b0617e03af4fab5 */
- 9.49137069684463027665847421762105623e-01L, /* 3ffee5f54b436e9d05fac3f40bf22ee7 */
- 6.84433965991637152250309190468859701e-37L, /* 3f86d1cd36f62b528bd1cb5c22497e7a */
+ L(9.49137069684463027665847421762105623e-01), /* 3ffee5f54b436e9d05fac3f40bf22ee7 */
+ L(6.84433965991637152250309190468859701e-37), /* 3f86d1cd36f62b528bd1cb5c22497e7a */
/* sin(x) = 0.509adf9a7b9a5a0f638a8fa3a60a199418859f18b37169a644fdb986c21ecb00133853bc35b */
- 3.14863181319745250865036315126939016e-01L, /* 3ffd426b7e69ee69683d8e2a3e8e9828 */
- 1.92431240212432926993057705062834160e-35L, /* 3f8b99418859f18b37169a644fdb986c */
+ L(3.14863181319745250865036315126939016e-01), /* 3ffd426b7e69ee69683d8e2a3e8e9828 */
+ L(1.92431240212432926993057705062834160e-35), /* 3f8b99418859f18b37169a644fdb986c */
/* x = 3.28125000000000000000000000000000000e-01 3ffd5000000000000000000000000000 */
/* cos(x) = 0.f2578a595224dd2e6bfa2eb2f99cc674f5ea6f479eae2eb580186897ae3f893df1113ca06b8 */
- 9.46648260886053321846099507295532976e-01L, /* 3ffee4af14b2a449ba5cd7f45d65f33a */
--4.32906339663000890941529420498824645e-35L, /* bf8ccc5850ac85c30a8e8a53ff3cbb43 */
+ L(9.46648260886053321846099507295532976e-01), /* 3ffee4af14b2a449ba5cd7f45d65f33a */
+L(-4.32906339663000890941529420498824645e-35), /* bf8ccc5850ac85c30a8e8a53ff3cbb43 */
/* sin(x) = 0.5280326c3cf481823ba6bb08eac82c2093f2bce3c4eb4ee3dec7df41c92c8a4226098616075 */
- 3.22268630433386625687745919893188031e-01L, /* 3ffd4a00c9b0f3d20608ee9aec23ab21 */
--1.49505897804759263483853908335500228e-35L, /* bf8b3df6c0d431c3b14b11c213820be3 */
+ L(3.22268630433386625687745919893188031e-01), /* 3ffd4a00c9b0f3d20608ee9aec23ab21 */
+L(-1.49505897804759263483853908335500228e-35), /* bf8b3df6c0d431c3b14b11c213820be3 */
/* x = 3.35937500000000000000000000000000000e-01 3ffd5800000000000000000000000000 */
/* cos(x) = 0.f1b0a5b406b526d886c55feadc8d0dcc8eb9ae2ac707051771b48e05b25b000009660bdb3e3 */
- 9.44101673557004345630017691253124860e-01L, /* 3ffee3614b680d6a4db10d8abfd5b91a */
- 1.03812535240120229609822461172145584e-35L, /* 3f8ab991d735c558e0e0a2ee3691c0b6 */
+ L(9.44101673557004345630017691253124860e-01), /* 3ffee3614b680d6a4db10d8abfd5b91a */
+ L(1.03812535240120229609822461172145584e-35), /* 3f8ab991d735c558e0e0a2ee3691c0b6 */
/* sin(x) = 0.54643b3da29de9b357155eef0f332fb3e66c83bf4dddd9491c5eb8e103ccd92d6175220ed51 */
- 3.29654409930860171914317725126463176e-01L, /* 3ffd5190ecf68a77a6cd5c557bbc3ccd */
--1.22606996784743214973082192294232854e-35L, /* bf8b04c19937c40b22226b6e3a1471f0 */
+ L(3.29654409930860171914317725126463176e-01), /* 3ffd5190ecf68a77a6cd5c557bbc3ccd */
+L(-1.22606996784743214973082192294232854e-35), /* bf8b04c19937c40b22226b6e3a1471f0 */
/* x = 3.43750000000000000000000000000000000e-01 3ffd6000000000000000000000000000 */
/* cos(x) = 0.f105fa4d66b607a67d44e042725204435142ac8ad54dfb0907a4f6b56b06d98ee60f19e557a */
- 9.41497463127881068644511236053670815e-01L, /* 3ffee20bf49acd6c0f4cfa89c084e4a4 */
- 3.20709366603165602071590241054884900e-36L, /* 3f8910d450ab22b5537ec241e93dad5b */
+ L(9.41497463127881068644511236053670815e-01), /* 3ffee20bf49acd6c0f4cfa89c084e4a4 */
+ L(3.20709366603165602071590241054884900e-36), /* 3f8910d450ab22b5537ec241e93dad5b */
/* sin(x) = 0.5646f27e8bd65cbe3a5d61ff06572290ee826d9674a00246b05ae26753cdfc90d9ce81a7d02 */
- 3.37020069022253076261281754173810024e-01L, /* 3ffd591bc9fa2f5972f8e97587fc195d */
--2.21435756148839473677777545049890664e-35L, /* bf8bd6f117d92698b5ffdb94fa51d98b */
+ L(3.37020069022253076261281754173810024e-01), /* 3ffd591bc9fa2f5972f8e97587fc195d */
+L(-2.21435756148839473677777545049890664e-35), /* bf8bd6f117d92698b5ffdb94fa51d98b */
/* x = 3.51562500000000000000000000000000000e-01 3ffd6800000000000000000000000000 */
/* cos(x) = 0.f0578ad01ede707fa39c09dc6b984afef74f3dc8d0efb0f4c5a6b13771145b3e0446fe33887 */
- 9.38835788546265488632578305984712554e-01L, /* 3ffee0af15a03dbce0ff473813b8d731 */
--3.98758068773974031348585072752245458e-35L, /* bf8ca808458611b978827859d2ca7644 */
+ L(9.38835788546265488632578305984712554e-01), /* 3ffee0af15a03dbce0ff473813b8d731 */
+L(-3.98758068773974031348585072752245458e-35), /* bf8ca808458611b978827859d2ca7644 */
/* sin(x) = 0.582850a41e1dd46c7f602ea244cdbbbfcdfa8f3189be794dda427ce090b5f85164f1f80ac13 */
- 3.44365158145698408207172046472223747e-01L, /* 3ffd60a14290787751b1fd80ba891337 */
--3.19791885005480924937758467594051927e-36L, /* bf89100c815c339d9061ac896f60c7dc */
+ L(3.44365158145698408207172046472223747e-01), /* 3ffd60a14290787751b1fd80ba891337 */
+L(-3.19791885005480924937758467594051927e-36), /* bf89100c815c339d9061ac896f60c7dc */
/* x = 3.59375000000000000000000000000000000e-01 3ffd7000000000000000000000000000 */
/* cos(x) = 0.efa559f5ec3aec3a4eb03319278a2d41fcf9189462261125fe6147b078f1daa0b06750a1654 */
- 9.36116812267055290294237411019508588e-01L, /* 3ffedf4ab3ebd875d8749d6066324f14 */
- 3.40481591236710658435409862439032162e-35L, /* 3f8c6a0fe7c8c4a31130892ff30a3d84 */
+ L(9.36116812267055290294237411019508588e-01), /* 3ffedf4ab3ebd875d8749d6066324f14 */
+ L(3.40481591236710658435409862439032162e-35), /* 3f8c6a0fe7c8c4a31130892ff30a3d84 */
/* sin(x) = 0.5a084e28e35fda2776dfdbbb5531d74ced2b5d17c0b1afc4647529d50c295e36d8ceec126c1 */
- 3.51689228994814059222584896955547016e-01L, /* 3ffd682138a38d7f689ddb7f6eed54c7 */
- 1.75293433418270210567525412802083294e-35L, /* 3f8b74ced2b5d17c0b1afc4647529d51 */
+ L(3.51689228994814059222584896955547016e-01), /* 3ffd682138a38d7f689ddb7f6eed54c7 */
+ L(1.75293433418270210567525412802083294e-35), /* 3f8b74ced2b5d17c0b1afc4647529d51 */
/* x = 3.67187500000000000000000000000000000e-01 3ffd7800000000000000000000000000 */
/* cos(x) = 0.eeef6a879146af0bf9b95ea2ea0ac0d3e2e4d7e15d93f48cbd41bf8e4fded40bef69e19eafa */
- 9.33340700242548435655299229469995527e-01L, /* 3ffeddded50f228d5e17f372bd45d416 */
--4.75255707251679831124800898831382223e-35L, /* bf8cf960e8d940f513605b9a15f2038e */
+ L(9.33340700242548435655299229469995527e-01), /* 3ffeddded50f228d5e17f372bd45d416 */
+L(-4.75255707251679831124800898831382223e-35), /* bf8cf960e8d940f513605b9a15f2038e */
/* sin(x) = 0.5be6e38ce8095542bc14ee9da0d36483e6734bcab2e07624188af5653f114eeb46738fa899d */
- 3.58991834546065053677710299152868941e-01L, /* 3ffd6f9b8e33a025550af053ba76834e */
--2.06772389262723368139416970257112089e-35L, /* bf8bb7c198cb4354d1f89dbe7750a9ac */
+ L(3.58991834546065053677710299152868941e-01), /* 3ffd6f9b8e33a025550af053ba76834e */
+L(-2.06772389262723368139416970257112089e-35), /* bf8bb7c198cb4354d1f89dbe7750a9ac */
/* x = 3.75000000000000000000000000000000000e-01 3ffd8000000000000000000000000000 */
/* cos(x) = 0.ee35bf5ccac89052cd91ddb734d3a47e262e3b609db604e217053803be0091e76daf28a89b7 */
- 9.30507621912314291149476792229555481e-01L, /* 3ffedc6b7eb9959120a59b23bb6e69a7 */
- 2.74541088551732982573335285685416092e-35L, /* 3f8c23f13171db04edb02710b829c01e */
+ L(9.30507621912314291149476792229555481e-01), /* 3ffedc6b7eb9959120a59b23bb6e69a7 */
+ L(2.74541088551732982573335285685416092e-35), /* 3f8c23f13171db04edb02710b829c01e */
/* sin(x) = 0.5dc40955d9084f48a94675a2498de5d851320ff5528a6afb3f2e24de240fce6cbed1ba0ccd6 */
- 3.66272529086047561372909351716264177e-01L, /* 3ffd7710255764213d22a519d6892638 */
--1.96768433534936592675897818253108989e-35L, /* bf8ba27aecdf00aad759504c0d1db21e */
+ L(3.66272529086047561372909351716264177e-01), /* 3ffd7710255764213d22a519d6892638 */
+L(-1.96768433534936592675897818253108989e-35), /* bf8ba27aecdf00aad759504c0d1db21e */
/* x = 3.82812500000000000000000000000000000e-01 3ffd8800000000000000000000000000 */
/* cos(x) = 0.ed785b5c44741b4493c56bcb9d338a151c6f6b85d8f8aca658b28572c162b199680eb9304da */
- 9.27617750192851909628030798799961350e-01L, /* 3ffedaf0b6b888e83689278ad7973a67 */
- 7.58520371916345756281201167126854712e-36L, /* 3f8a42a38ded70bb1f1594cb1650ae58 */
+ L(9.27617750192851909628030798799961350e-01), /* 3ffedaf0b6b888e83689278ad7973a67 */
+ L(7.58520371916345756281201167126854712e-36), /* 3f8a42a38ded70bb1f1594cb1650ae58 */
/* sin(x) = 0.5f9fb80f21b53649c432540a50e22c53057ff42ae0fdf1307760dc0093f99c8efeb2fbd7073 */
- 3.73530868238692946416839752660848112e-01L, /* 3ffd7e7ee03c86d4d92710c950294389 */
--1.48023494778986556048879113411517128e-35L, /* bf8b3acfa800bd51f020ecf889f23ff7 */
+ L(3.73530868238692946416839752660848112e-01), /* 3ffd7e7ee03c86d4d92710c950294389 */
+L(-1.48023494778986556048879113411517128e-35), /* bf8b3acfa800bd51f020ecf889f23ff7 */
/* x = 3.90625000000000000000000000000000000e-01 3ffd9000000000000000000000000000 */
/* cos(x) = 0.ecb7417b8d4ee3fec37aba4073aa48f1f14666006fb431d9671303c8100d10190ec8179c41d */
- 9.24671261467036098502113014560138771e-01L, /* 3ffed96e82f71a9dc7fd86f57480e755 */
--4.14187124860031825108649347251175815e-35L, /* bf8cb87075cccffc825e7134c767e1bf */
+ L(9.24671261467036098502113014560138771e-01), /* 3ffed96e82f71a9dc7fd86f57480e755 */
+L(-4.14187124860031825108649347251175815e-35), /* bf8cb87075cccffc825e7134c767e1bf */
/* sin(x) = 0.6179e84a09a5258a40e9b5face03e525f8b5753cd0105d93fe6298010c3458e84d75fe420e9 */
- 3.80766408992390192057200703388896675e-01L, /* 3ffd85e7a1282694962903a6d7eb3810 */
--2.02009541175208636336924533372496107e-35L, /* bf8bada074a8ac32fefa26c019d67fef */
+ L(3.80766408992390192057200703388896675e-01), /* 3ffd85e7a1282694962903a6d7eb3810 */
+L(-2.02009541175208636336924533372496107e-35), /* bf8bada074a8ac32fefa26c019d67fef */
/* x = 3.98437500000000000000000000000000000e-01 3ffd9800000000000000000000000000 */
/* cos(x) = 0.ebf274bf0bda4f62447e56a093626798d3013b5942b1abfd155aacc9dc5c6d0806a20d6b9c1 */
- 9.21668335573351918175411368202712714e-01L, /* 3ffed7e4e97e17b49ec488fcad4126c5 */
--1.83587995433957622948710263541479322e-35L, /* bf8b8672cfec4a6bd4e5402eaa553362 */
+ L(9.21668335573351918175411368202712714e-01), /* 3ffed7e4e97e17b49ec488fcad4126c5 */
+L(-1.83587995433957622948710263541479322e-35), /* bf8b8672cfec4a6bd4e5402eaa553362 */
/* sin(x) = 0.6352929dd264bd44a02ea766325d8aa8bd9695fc8def3caefba5b94c9a3c873f7b2d3776ead */
- 3.87978709727025046051079690813741960e-01L, /* 3ffd8d4a4a774992f51280ba9d98c976 */
- 8.01904783870935075844443278617586301e-36L, /* 3f8a5517b2d2bf91bde795df74b72993 */
+ L(3.87978709727025046051079690813741960e-01), /* 3ffd8d4a4a774992f51280ba9d98c976 */
+ L(8.01904783870935075844443278617586301e-36), /* 3f8a5517b2d2bf91bde795df74b72993 */
/* x = 4.06250000000000000000000000000000000e-01 3ffda000000000000000000000000000 */
/* cos(x) = 0.eb29f839f201fd13b93796827916a78f15c85230a4e8ea4b21558265a14367e1abb4c30695a */
- 9.18609155794918267837824977718549863e-01L, /* 3ffed653f073e403fa27726f2d04f22d */
- 2.97608282778274433460057745798409849e-35L, /* 3f8c3c78ae429185274752590aac132d */
+ L(9.18609155794918267837824977718549863e-01), /* 3ffed653f073e403fa27726f2d04f22d */
+ L(2.97608282778274433460057745798409849e-35), /* 3f8c3c78ae429185274752590aac132d */
/* sin(x) = 0.6529afa7d51b129631ec197c0a840a11d7dc5368b0a47956feb285caa8371c4637ef17ef01b */
- 3.95167330240934236244832640419653657e-01L, /* 3ffd94a6be9f546c4a58c7b065f02a10 */
- 7.57560031388312550940040194042627704e-36L, /* 3f8a423afb8a6d16148f2adfd650b955 */
+ L(3.95167330240934236244832640419653657e-01), /* 3ffd94a6be9f546c4a58c7b065f02a10 */
+ L(7.57560031388312550940040194042627704e-36), /* 3f8a423afb8a6d16148f2adfd650b955 */
/* x = 4.14062500000000000000000000000000000e-01 3ffda800000000000000000000000000 */
/* cos(x) = 0.ea5dcf0e30cf03e6976ef0b1ec26515fba47383855c3b4055a99b5e86824b2cd1a691fdca7b */
- 9.15493908848301228563917732180221882e-01L, /* 3ffed4bb9e1c619e07cd2edde163d84d */
--3.50775517955306954815090901168305659e-35L, /* bf8c75022dc63e3d51e25fd52b3250bd */
+ L(9.15493908848301228563917732180221882e-01), /* 3ffed4bb9e1c619e07cd2edde163d84d */
+L(-3.50775517955306954815090901168305659e-35), /* bf8c75022dc63e3d51e25fd52b3250bd */
/* sin(x) = 0.66ff380ba0144109e39a320b0a3fa5fd65ea0585bcbf9b1a769a9b0334576c658139e1a1cbe */
- 4.02331831777773111217105598880982387e-01L, /* 3ffd9bfce02e805104278e68c82c28ff */
--1.95678722882848174723569916504871563e-35L, /* bf8ba029a15fa7a434064e5896564fcd */
+ L(4.02331831777773111217105598880982387e-01), /* 3ffd9bfce02e805104278e68c82c28ff */
+L(-1.95678722882848174723569916504871563e-35), /* bf8ba029a15fa7a434064e5896564fcd */
/* x = 4.21875000000000000000000000000000000e-01 3ffdb000000000000000000000000000 */
/* cos(x) = 0.e98dfc6c6be031e60dd3089cbdd18a75b1f6b2c1e97f79225202f03dbea45b07a5ec4efc062 */
- 9.12322784872117846492029542047341734e-01L, /* 3ffed31bf8d8d7c063cc1ba611397ba3 */
- 7.86903886556373674267948132178845568e-36L, /* 3f8a4eb63ed6583d2fef244a405e07b8 */
+ L(9.12322784872117846492029542047341734e-01), /* 3ffed31bf8d8d7c063cc1ba611397ba3 */
+ L(7.86903886556373674267948132178845568e-36), /* 3f8a4eb63ed6583d2fef244a405e07b8 */
/* sin(x) = 0.68d32473143327973bc712bcc4ccddc47630d755850c0655243b205934dc49ffed8eb76adcb */
- 4.09471777053295066122694027011452236e-01L, /* 3ffda34c91cc50cc9e5cef1c4af31333 */
- 2.23945241468457597921655785729821354e-35L, /* 3f8bdc47630d755850c0655243b20593 */
+ L(4.09471777053295066122694027011452236e-01), /* 3ffda34c91cc50cc9e5cef1c4af31333 */
+ L(2.23945241468457597921655785729821354e-35), /* 3f8bdc47630d755850c0655243b20593 */
/* x = 4.29687500000000000000000000000000000e-01 3ffdb800000000000000000000000000 */
/* cos(x) = 0.e8ba8393eca7821aa563d83491b6101189b3b101c3677f73d7bad7c10f9ee02b7ab4009739a */
- 9.09095977415431051650381735684476417e-01L, /* 3ffed1750727d94f04354ac7b069236c */
- 1.20886014028444155733776025085677953e-35L, /* 3f8b01189b3b101c3677f73d7bad7c11 */
+ L(9.09095977415431051650381735684476417e-01), /* 3ffed1750727d94f04354ac7b069236c */
+ L(1.20886014028444155733776025085677953e-35), /* 3f8b01189b3b101c3677f73d7bad7c11 */
/* sin(x) = 0.6aa56d8e8249db4eb60a761fe3f9e559be456b9e13349ca99b0bfb787f22b95db3b70179615 */
- 4.16586730282041119259112448831069657e-01L, /* 3ffdaa95b63a09276d3ad829d87f8fe8 */
--2.00488106831998813675438269796963612e-35L, /* bf8baa641ba9461eccb635664f404878 */
+ L(4.16586730282041119259112448831069657e-01), /* 3ffdaa95b63a09276d3ad829d87f8fe8 */
+L(-2.00488106831998813675438269796963612e-35), /* bf8baa641ba9461eccb635664f404878 */
/* x = 4.37500000000000000000000000000000000e-01 3ffdc000000000000000000000000000 */
/* cos(x) = 0.e7e367d2956cfb16b6aa11e5419cd0057f5c132a6455bf064297e6a76fe2b72bb630d6d50ff */
- 9.05813683425936420744516660652700258e-01L, /* 3ffecfc6cfa52ad9f62d6d5423ca833a */
--3.60950307605941169775676563004467163e-35L, /* bf8c7fd4051f66acdd5207cdeb40cac5 */
+ L(9.05813683425936420744516660652700258e-01), /* 3ffecfc6cfa52ad9f62d6d5423ca833a */
+L(-3.60950307605941169775676563004467163e-35), /* bf8c7fd4051f66acdd5207cdeb40cac5 */
/* sin(x) = 0.6c760c14c8585a51dbd34660ae6c52ac7036a0b40887a0b63724f8b4414348c3063a637f457 */
- 4.23676257203938010361683988031102480e-01L, /* 3ffdb1d83053216169476f4d1982b9b1 */
- 1.40484456388654470329473096579312595e-35L, /* 3f8b2ac7036a0b40887a0b63724f8b44 */
+ L(4.23676257203938010361683988031102480e-01), /* 3ffdb1d83053216169476f4d1982b9b1 */
+ L(1.40484456388654470329473096579312595e-35), /* 3f8b2ac7036a0b40887a0b63724f8b44 */
/* x = 4.45312500000000000000000000000000000e-01 3ffdc800000000000000000000000000 */
/* cos(x) = 0.e708ac84d4172a3e2737662213429e14021074d7e702e77d72a8f1101a7e70410df8273e9aa */
- 9.02476103237941504925183272675895999e-01L, /* 3ffece115909a82e547c4e6ecc442685 */
- 2.26282899501344419018306295680210602e-35L, /* 3f8be14021074d7e702e77d72a8f1102 */
+ L(9.02476103237941504925183272675895999e-01), /* 3ffece115909a82e547c4e6ecc442685 */
+ L(2.26282899501344419018306295680210602e-35), /* 3f8be14021074d7e702e77d72a8f1102 */
/* sin(x) = 0.6e44f8c36eb10a1c752d093c00f4d47ba446ac4c215d26b0316442f168459e677d06e7249e3 */
- 4.30739925110803197216321517850849190e-01L, /* 3ffdb913e30dbac42871d4b424f003d3 */
- 1.54096780001629398850891218396761548e-35L, /* 3f8b47ba446ac4c215d26b0316442f17 */
+ L(4.30739925110803197216321517850849190e-01), /* 3ffdb913e30dbac42871d4b424f003d3 */
+ L(1.54096780001629398850891218396761548e-35), /* 3f8b47ba446ac4c215d26b0316442f17 */
/* x = 4.53125000000000000000000000000000000e-01 3ffdd000000000000000000000000000 */
/* cos(x) = 0.e62a551594b970a770b15d41d4c0e483e47aca550111df6966f9e7ac3a94ae49e6a71eb031e */
- 8.99083440560138456216544929209379307e-01L, /* 3ffecc54aa2b2972e14ee162ba83a982 */
--2.06772615490904370666670275154751976e-35L, /* bf8bb7c1b8535aafeee209699061853c */
+ L(8.99083440560138456216544929209379307e-01), /* 3ffecc54aa2b2972e14ee162ba83a982 */
+L(-2.06772615490904370666670275154751976e-35), /* bf8bb7c1b8535aafeee209699061853c */
/* sin(x) = 0.70122c5ec5028c8cff33abf4fd340ccc382e038379b09cf04f9a52692b10b72586060cbb001 */
- 4.37777302872755132861618974702796680e-01L, /* 3ffdc048b17b140a3233fcceafd3f4d0 */
- 9.62794364503442612477117426033922467e-36L, /* 3f8a998705c0706f36139e09f34a4d25 */
+ L(4.37777302872755132861618974702796680e-01), /* 3ffdc048b17b140a3233fcceafd3f4d0 */
+ L(9.62794364503442612477117426033922467e-36), /* 3f8a998705c0706f36139e09f34a4d25 */
/* x = 4.60937500000000000000000000000000000e-01 3ffdd800000000000000000000000000 */
/* cos(x) = 0.e54864fe33e8575cabf5bd0e5cf1b1a8bc7c0d5f61702450fa6b6539735820dd2603ae355d5 */
- 8.95635902463170698900570000446256350e-01L, /* 3ffeca90c9fc67d0aeb957eb7a1cb9e3 */
- 3.73593741659866883088620495542311808e-35L, /* 3f8c8d45e3e06afb0b812287d35b29cc */
+ L(8.95635902463170698900570000446256350e-01), /* 3ffeca90c9fc67d0aeb957eb7a1cb9e3 */
+ L(3.73593741659866883088620495542311808e-35), /* 3f8c8d45e3e06afb0b812287d35b29cc */
/* sin(x) = 0.71dd9fb1ff4677853acb970a9f6729c6e3aac247b1c57cea66c77413f1f98e8b9e98e49d851 */
- 4.44787960964527211433056012529525211e-01L, /* 3ffdc7767ec7fd19de14eb2e5c2a7d9d */
--1.67187936511493678007508371613954899e-35L, /* bf8b6391c553db84e3a831599388bec1 */
+ L(4.44787960964527211433056012529525211e-01), /* 3ffdc7767ec7fd19de14eb2e5c2a7d9d */
+L(-1.67187936511493678007508371613954899e-35), /* bf8b6391c553db84e3a831599388bec1 */
/* x = 4.68750000000000000000000000000000000e-01 3ffde000000000000000000000000000 */
/* cos(x) = 0.e462dfc670d421ab3d1a15901228f146a0547011202bf5ab01f914431859aef577966bc4fa4 */
- 8.92133699366994404723900253723788575e-01L, /* 3ffec8c5bf8ce1a843567a342b202452 */
--1.10771937602567314732693079264692504e-35L, /* bf8ad72bf571fddbfa814a9fc0dd779d */
+ L(8.92133699366994404723900253723788575e-01), /* 3ffec8c5bf8ce1a843567a342b202452 */
+L(-1.10771937602567314732693079264692504e-35), /* bf8ad72bf571fddbfa814a9fc0dd779d */
/* sin(x) = 0.73a74b8f52947b681baf6928eb3fb021769bf4779bad0e3aa9b1cdb75ec60aad9fc63ff19d5 */
- 4.51771471491683776581688750134062870e-01L, /* 3ffdce9d2e3d4a51eda06ebda4a3acff */
--1.19387223016472295893794387275284505e-35L, /* bf8afbd12c81710c8a5e38aac9c64914 */
+ L(4.51771471491683776581688750134062870e-01), /* 3ffdce9d2e3d4a51eda06ebda4a3acff */
+L(-1.19387223016472295893794387275284505e-35), /* bf8afbd12c81710c8a5e38aac9c64914 */
/* x = 4.76562500000000000000000000000000000e-01 3ffde800000000000000000000000000 */
/* cos(x) = 0.e379c9045f29d517c4808aa497c2057b2b3d109e76c0dc302d4d0698b36e3f0bdbf33d8e952 */
- 8.88577045028035543317609023116020980e-01L, /* 3ffec6f39208be53aa2f890115492f84 */
- 4.12354278954664731443813655177022170e-36L, /* 3f895ecacf44279db0370c0b5341a62d */
+ L(8.88577045028035543317609023116020980e-01), /* 3ffec6f39208be53aa2f890115492f84 */
+ L(4.12354278954664731443813655177022170e-36), /* 3f895ecacf44279db0370c0b5341a62d */
/* sin(x) = 0.756f28d011d98528a44a75fc29c779bd734ecdfb582fdb74b68a4c4c4be54cfd0b2d3ad292f */
- 4.58727408216736592377295028972874773e-01L, /* 3ffdd5bca340476614a29129d7f0a71e */
--4.70946994194182908929251719575431779e-36L, /* bf8990a32c4c8129f40922d25d6ceced */
+ L(4.58727408216736592377295028972874773e-01), /* 3ffdd5bca340476614a29129d7f0a71e */
+L(-4.70946994194182908929251719575431779e-36), /* bf8990a32c4c8129f40922d25d6ceced */
/* x = 4.84375000000000000000000000000000000e-01 3ffdf000000000000000000000000000 */
/* cos(x) = 0.e28d245c58baef72225e232abc003c4366acd9eb4fc2808c2ab7fe7676cf512ac7f945ae5fb */
- 8.84966156526143291697296536966647926e-01L, /* 3ffec51a48b8b175dee444bc46557800 */
- 4.53370570288325630442037826313462165e-35L, /* 3f8ce21b3566cf5a7e14046155bff3b4 */
+ L(8.84966156526143291697296536966647926e-01), /* 3ffec51a48b8b175dee444bc46557800 */
+ L(4.53370570288325630442037826313462165e-35), /* 3f8ce21b3566cf5a7e14046155bff3b4 */
/* sin(x) = 0.77353054ca72690d4c6e171fd99e6b39fa8e1ede5f052fd2964534c75340970a3a9cd3c5c32 */
- 4.65655346585160182681199512507546779e-01L, /* 3ffddcd4c15329c9a43531b85c7f667a */
--1.56282598978971872478619772155305961e-35L, /* bf8b4c60571e121a0fad02d69bacb38b */
+ L(4.65655346585160182681199512507546779e-01), /* 3ffddcd4c15329c9a43531b85c7f667a */
+L(-1.56282598978971872478619772155305961e-35), /* bf8b4c60571e121a0fad02d69bacb38b */
/* x = 4.92187500000000000000000000000000000e-01 3ffdf800000000000000000000000000 */
/* cos(x) = 0.e19cf580eeec046aa1422fa74807ecefb2a1911c94e7b5f20a00f70022d940193691e5bd790 */
- 8.81301254251340599140161908298100173e-01L, /* 3ffec339eb01ddd808d542845f4e9010 */
--1.43419192312116687783945619009629445e-35L, /* bf8b3104d5e6ee36b184a0df5ff08ffe */
+ L(8.81301254251340599140161908298100173e-01), /* 3ffec339eb01ddd808d542845f4e9010 */
+L(-1.43419192312116687783945619009629445e-35), /* bf8b3104d5e6ee36b184a0df5ff08ffe */
/* sin(x) = 0.78f95b0560a9a3bd6df7bd981dc38c61224d08bc20631ea932e605e53b579e9e0767dfcbbcb */
- 4.72554863751304451146551317808516942e-01L, /* 3ffde3e56c1582a68ef5b7def660770e */
- 9.31324774957768018850224267625371204e-36L, /* 3f8a8c2449a117840c63d5265cc0bca7 */
+ L(4.72554863751304451146551317808516942e-01), /* 3ffde3e56c1582a68ef5b7def660770e */
+ L(9.31324774957768018850224267625371204e-36), /* 3f8a8c2449a117840c63d5265cc0bca7 */
/* x = 5.00000000000000000000000000000000000e-01 3ffe0000000000000000000000000000 */
/* cos(x) = 0.e0a94032dbea7cedbddd9da2fafad98556566b3a89f43eabd72350af3e8b19e801204d8fe2e */
- 8.77582561890372716116281582603829681e-01L, /* 3ffec1528065b7d4f9db7bbb3b45f5f6 */
--2.89484960181363924855192538540698851e-35L, /* bf8c33d54d4ca62bb05e0aa146e57a86 */
+ L(8.77582561890372716116281582603829681e-01), /* 3ffec1528065b7d4f9db7bbb3b45f5f6 */
+L(-2.89484960181363924855192538540698851e-35), /* bf8c33d54d4ca62bb05e0aa146e57a86 */
/* sin(x) = 0.7abba1d12c17bfa1d92f0d93f60ded9992f45b4fcaf13cd58b303693d2a0db47db35ae8a3a9 */
- 4.79425538604203000273287935215571402e-01L, /* 3ffdeaee8744b05efe8764bc364fd838 */
--1.38426977616718318950175848639381926e-35L, /* bf8b2666d0ba4b0350ec32a74cfc96c3 */
+ L(4.79425538604203000273287935215571402e-01), /* 3ffdeaee8744b05efe8764bc364fd838 */
+L(-1.38426977616718318950175848639381926e-35), /* bf8b2666d0ba4b0350ec32a74cfc96c3 */
/* x = 5.07812500000000000000000000000000000e-01 3ffe0400000000000000000000000000 */
/* cos(x) = 0.dfb20840f3a9b36f7ae2c515342890b5ec583b8366cc2b55029e95094d31112383f2553498b */
- 8.73810306413054508282556837071377159e-01L, /* 3ffebf641081e75366def5c58a2a6851 */
- 1.25716864497849302237218128599994785e-35L, /* 3f8b0b5ec583b8366cc2b55029e95095 */
+ L(8.73810306413054508282556837071377159e-01), /* 3ffebf641081e75366def5c58a2a6851 */
+ L(1.25716864497849302237218128599994785e-35), /* 3f8b0b5ec583b8366cc2b55029e95095 */
/* sin(x) = 0.7c7bfdaf13e5ed17212f8a7525bfb113aba6c0741b5362bb8d59282a850b63716bca0c910f0 */
- 4.86266951793275574311011306895834993e-01L, /* 3ffdf1eff6bc4f97b45c84be29d496ff */
--1.12269393250914752644352376448094271e-35L, /* bf8add8a8b27f17c9593a88e54dafaaf */
+ L(4.86266951793275574311011306895834993e-01), /* 3ffdf1eff6bc4f97b45c84be29d496ff */
+L(-1.12269393250914752644352376448094271e-35), /* bf8add8a8b27f17c9593a88e54dafaaf */
/* x = 5.15625000000000000000000000000000000e-01 3ffe0800000000000000000000000000 */
/* cos(x) = 0.deb7518814a7a931bbcc88c109cd41c50bf8bb48f20ae8c36628d1d3d57574f7dc58f27d91c */
- 8.69984718058417388828915599901466243e-01L, /* 3ffebd6ea310294f526377991182139b */
--4.68168638300575626782741319792183837e-35L, /* bf8cf1d7a03a25b86fa8b9e4ceb97161 */
+ L(8.69984718058417388828915599901466243e-01), /* 3ffebd6ea310294f526377991182139b */
+L(-4.68168638300575626782741319792183837e-35), /* bf8cf1d7a03a25b86fa8b9e4ceb97161 */
/* sin(x) = 0.7e3a679daaf25c676542bcb4028d0964172961c921823a4ef0c3a9070d886dbd073f6283699 */
- 4.93078685753923057265136552753487121e-01L, /* 3ffdf8e99e76abc9719d950af2d00a34 */
- 7.06498693112535056352301101088624950e-36L, /* 3f8a2c82e52c3924304749de187520e2 */
+ L(4.93078685753923057265136552753487121e-01), /* 3ffdf8e99e76abc9719d950af2d00a34 */
+ L(7.06498693112535056352301101088624950e-36), /* 3f8a2c82e52c3924304749de187520e2 */
/* x = 5.23437500000000000000000000000000000e-01 3ffe0c00000000000000000000000000 */
/* cos(x) = 0.ddb91ff318799172bd2452d0a3889f5169c64a0094bcf0b8aa7dcf0d7640a2eba68955a80be */
- 8.66106030320656714696616831654267220e-01L, /* 3ffebb723fe630f322e57a48a5a14711 */
- 2.35610597588322493119667003904687628e-35L, /* 3f8bf5169c64a0094bcf0b8aa7dcf0d7 */
+ L(8.66106030320656714696616831654267220e-01), /* 3ffebb723fe630f322e57a48a5a14711 */
+ L(2.35610597588322493119667003904687628e-35), /* 3f8bf5169c64a0094bcf0b8aa7dcf0d7 */
/* sin(x) = 0.7ff6d8a34bd5e8fa54c97482db5159df1f24e8038419c0b448b9eea8939b5d4dfcf40900257 */
- 4.99860324733013463819556536946425724e-01L, /* 3ffdffdb628d2f57a3e95325d20b6d45 */
- 1.94636052312235297538564591686645139e-35L, /* 3f8b9df1f24e8038419c0b448b9eea89 */
+ L(4.99860324733013463819556536946425724e-01), /* 3ffdffdb628d2f57a3e95325d20b6d45 */
+ L(1.94636052312235297538564591686645139e-35), /* 3f8b9df1f24e8038419c0b448b9eea89 */
/* x = 5.31250000000000000000000000000000000e-01 3ffe1000000000000000000000000000 */
/* cos(x) = 0.dcb7777ac420705168f31e3eb780ce9c939ecada62843b54522f5407eb7f21e556059fcd734 */
- 8.62174479934880504367162510253324274e-01L, /* 3ffeb96eeef58840e0a2d1e63c7d6f02 */
--3.71556818317533582234562471835771823e-35L, /* bf8c8b1b6309a92cebde255d6e855fc1 */
+ L(8.62174479934880504367162510253324274e-01), /* 3ffeb96eeef58840e0a2d1e63c7d6f02 */
+L(-3.71556818317533582234562471835771823e-35), /* bf8c8b1b6309a92cebde255d6e855fc1 */
/* sin(x) = 0.81b149ce34caa5a4e650f8d09fd4d6aa74206c32ca951a93074c83b2d294d25dbb0f7fdfad2 */
- 5.06611454814257367642296000893867192e-01L, /* 3ffe0362939c69954b49cca1f1a13faa */
--3.10963699824274155702706043065967062e-35L, /* bf8c4aac5efc9e69ab572b67c59be269 */
+ L(5.06611454814257367642296000893867192e-01), /* 3ffe0362939c69954b49cca1f1a13faa */
+L(-3.10963699824274155702706043065967062e-35), /* bf8c4aac5efc9e69ab572b67c59be269 */
/* x = 5.39062500000000000000000000000000000e-01 3ffe1400000000000000000000000000 */
/* cos(x) = 0.dbb25c25b8260c14f6e7bc98ec991b70c65335198b0ab628bad20cc7b229d4dd62183cfa055 */
- 8.58190306862660347046629564970494649e-01L, /* 3ffeb764b84b704c1829edcf7931d932 */
- 2.06439574601190798155563653000684861e-35L, /* 3f8bb70c65335198b0ab628bad20cc7b */
+ L(8.58190306862660347046629564970494649e-01), /* 3ffeb764b84b704c1829edcf7931d932 */
+ L(2.06439574601190798155563653000684861e-35), /* 3f8bb70c65335198b0ab628bad20cc7b */
/* sin(x) = 0.8369b434a372da7eb5c8a71fe36ce1e0b2b493f6f5cb2e38bcaec2a556b3678c401940d1c3c */
- 5.13331663943471218288801270215706878e-01L, /* 3ffe06d3686946e5b4fd6b914e3fc6da */
--2.26614796466671970772244932848067224e-35L, /* bf8be1f4d4b6c090a34d1c743513d5ab */
+ L(5.13331663943471218288801270215706878e-01), /* 3ffe06d3686946e5b4fd6b914e3fc6da */
+L(-2.26614796466671970772244932848067224e-35), /* bf8be1f4d4b6c090a34d1c743513d5ab */
/* x = 5.46875000000000000000000000000000000e-01 3ffe1800000000000000000000000000 */
/* cos(x) = 0.daa9d20860827063fde51c09e855e9932e1b17143e7244fd267a899d41ae1f3bc6a0ec42e27 */
- 8.54153754277385385143451785105103176e-01L, /* 3ffeb553a410c104e0c7fbca3813d0ac */
--1.68707534013095152873222061722573172e-35L, /* bf8b66cd1e4e8ebc18dbb02d9857662c */
+ L(8.54153754277385385143451785105103176e-01), /* 3ffeb553a410c104e0c7fbca3813d0ac */
+L(-1.68707534013095152873222061722573172e-35), /* bf8b66cd1e4e8ebc18dbb02d9857662c */
/* sin(x) = 0.852010f4f0800521378bd8dd614753d080c2e9e0775ffc609947b9132f5357404f464f06a58 */
- 5.20020541953727004760213699874674730e-01L, /* 3ffe0a4021e9e1000a426f17b1bac28f */
--3.32415021330884924833711842866896734e-35L, /* bf8c617bf9e8b0fc45001cfb35c23767 */
+ L(5.20020541953727004760213699874674730e-01), /* 3ffe0a4021e9e1000a426f17b1bac28f */
+L(-3.32415021330884924833711842866896734e-35), /* bf8c617bf9e8b0fc45001cfb35c23767 */
/* x = 5.54687500000000000000000000000000000e-01 3ffe1c00000000000000000000000000 */
/* cos(x) = 0.d99ddd44e44a43d4d4a3a3ed95204106fd54d78e8c7684545c0da0b7c2c72be7a89b7c182ad */
- 8.50065068549420263957072899177793617e-01L, /* 3ffeb33bba89c89487a9a94747db2a41 */
--4.73753917078785974356016104842568442e-35L, /* bf8cf7c81559438b9c4bdd5d1f92fa42 */
+ L(8.50065068549420263957072899177793617e-01), /* 3ffeb33bba89c89487a9a94747db2a41 */
+L(-4.73753917078785974356016104842568442e-35), /* bf8cf7c81559438b9c4bdd5d1f92fa42 */
/* sin(x) = 0.86d45935ab396cb4e421e822dee54f3562dfcefeaa782184c23401d231f5ad981a1cc195b18 */
- 5.26677680590386730710789410624833901e-01L, /* 3ffe0da8b26b5672d969c843d045bdcb */
--3.67066148195515214077582496518566735e-35L, /* bf8c8654e901880aac3ef3d9ee5ff16e */
+ L(5.26677680590386730710789410624833901e-01), /* 3ffe0da8b26b5672d969c843d045bdcb */
+L(-3.67066148195515214077582496518566735e-35), /* bf8c8654e901880aac3ef3d9ee5ff16e */
/* x = 5.62500000000000000000000000000000000e-01 3ffe2000000000000000000000000000 */
/* cos(x) = 0.d88e820b1526311dd561efbc0c1a9a5375eb26f65d246c5744b13ca26a7e0fd42556da843c8 */
- 8.45924499231067954459723078597493262e-01L, /* 3ffeb11d04162a4c623baac3df781835 */
- 1.98054947141989878179164342925274053e-35L, /* 3f8ba5375eb26f65d246c5744b13ca27 */
+ L(8.45924499231067954459723078597493262e-01), /* 3ffeb11d04162a4c623baac3df781835 */
+ L(1.98054947141989878179164342925274053e-35), /* 3f8ba5375eb26f65d246c5744b13ca27 */
/* sin(x) = 0.88868625b4e1dbb2313310133022527200c143a5cb16637cb7daf8ade82459ff2e98511f40f */
- 5.33302673536020173329131103308161529e-01L, /* 3ffe110d0c4b69c3b764626620266045 */
--3.42715291319551615996993795226755157e-35L, /* bf8c6c6ff9f5e2d1a74ce41a41283a91 */
+ L(5.33302673536020173329131103308161529e-01), /* 3ffe110d0c4b69c3b764626620266045 */
+L(-3.42715291319551615996993795226755157e-35), /* bf8c6c6ff9f5e2d1a74ce41a41283a91 */
/* x = 5.70312500000000000000000000000000000e-01 3ffe2400000000000000000000000000 */
/* cos(x) = 0.d77bc4985e93a607c9d868b906bbc6bbe3a04258814acb0358468b826fc91bd4d814827f65e */
- 8.41732299041338366963111794309701085e-01L, /* 3ffeaef78930bd274c0f93b0d1720d78 */
--4.30821936750410026005408345400225948e-35L, /* bf8cca20e2fded3bf5a9a7e53dcba3ed */
+ L(8.41732299041338366963111794309701085e-01), /* 3ffeaef78930bd274c0f93b0d1720d78 */
+L(-4.30821936750410026005408345400225948e-35), /* bf8cca20e2fded3bf5a9a7e53dcba3ed */
/* sin(x) = 0.8a3690fc5bfc11bf9535e2739a8512f448a41251514bbed7fc18d530f9b4650fcbb2861b0aa */
- 5.39895116435204405041660709903993340e-01L, /* 3ffe146d21f8b7f8237f2a6bc4e7350a */
- 1.42595803521626714477253741404712093e-35L, /* 3f8b2f448a41251514bbed7fc18d5310 */
+ L(5.39895116435204405041660709903993340e-01), /* 3ffe146d21f8b7f8237f2a6bc4e7350a */
+ L(1.42595803521626714477253741404712093e-35), /* 3f8b2f448a41251514bbed7fc18d5310 */
/* x = 5.78125000000000000000000000000000000e-01 3ffe2800000000000000000000000000 */
/* cos(x) = 0.d665a937b4ef2b1f6d51bad6d988a4419c1d7051faf31a9efa151d7631117efac03713f950a */
- 8.37488723850523685315353348917240617e-01L, /* 3ffeaccb526f69de563edaa375adb311 */
- 2.72761997872084533045777718677326179e-35L, /* 3f8c220ce0eb828fd798d4f7d0a8ebb2 */
+ L(8.37488723850523685315353348917240617e-01), /* 3ffeaccb526f69de563edaa375adb311 */
+ L(2.72761997872084533045777718677326179e-35), /* 3f8c220ce0eb828fd798d4f7d0a8ebb2 */
/* sin(x) = 0.8be472f9776d809af2b88171243d63d66dfceeeb739cc894e023fbc165a0e3f26ff729c5d57 */
- 5.46454606919203564403349553749411001e-01L, /* 3ffe17c8e5f2eedb0135e57102e2487b */
--2.11870230730160315420936523771864858e-35L, /* bf8bc29920311148c63376b1fdc043ea */
+ L(5.46454606919203564403349553749411001e-01), /* 3ffe17c8e5f2eedb0135e57102e2487b */
+L(-2.11870230730160315420936523771864858e-35), /* bf8bc29920311148c63376b1fdc043ea */
/* x = 5.85937500000000000000000000000000000e-01 3ffe2c00000000000000000000000000 */
/* cos(x) = 0.d54c3441844897fc8f853f0655f1ba695eba9fbfd7439dbb1171d862d9d9146ca5136f825ac */
- 8.33194032664581363070224042208032321e-01L, /* 3ffeaa98688308912ff91f0a7e0cabe3 */
- 4.39440050052045486567668031751259899e-35L, /* 3f8cd34af5d4fdfeba1cedd88b8ec317 */
+ L(8.33194032664581363070224042208032321e-01), /* 3ffeaa98688308912ff91f0a7e0cabe3 */
+ L(4.39440050052045486567668031751259899e-35), /* 3f8cd34af5d4fdfeba1cedd88b8ec317 */
/* sin(x) = 0.8d902565817ee7839bce3cd128060119492cd36d42d82ada30d7f8bde91324808377ddbf5d4 */
- 5.52980744630527369849695082681623667e-01L, /* 3ffe1b204acb02fdcf07379c79a2500c */
- 8.26624790417342895897164123189984127e-37L, /* 3f8719492cd36d42d82ada30d7f8bde9 */
+ L(5.52980744630527369849695082681623667e-01), /* 3ffe1b204acb02fdcf07379c79a2500c */
+ L(8.26624790417342895897164123189984127e-37), /* 3f8719492cd36d42d82ada30d7f8bde9 */
/* x = 5.93750000000000000000000000000000000e-01 3ffe3000000000000000000000000000 */
/* cos(x) = 0.d42f6a1b9f0168cdf031c2f63c8d9304d86f8d34cb1d5fccb68ca0f2241427fc18d1fd5bbdf */
- 8.28848487609325734810171790119116638e-01L, /* 3ffea85ed4373e02d19be06385ec791b */
- 1.43082508100496581719048175506239770e-35L, /* 3f8b304d86f8d34cb1d5fccb68ca0f22 */
+ L(8.28848487609325734810171790119116638e-01), /* 3ffea85ed4373e02d19be06385ec791b */
+ L(1.43082508100496581719048175506239770e-35), /* 3f8b304d86f8d34cb1d5fccb68ca0f22 */
/* sin(x) = 0.8f39a191b2ba6122a3fa4f41d5a3ffd421417d46f19a22230a14f7fcc8fce5c75b4b28b29d1 */
- 5.59473131247366877384844006003116688e-01L, /* 3ffe1e7343236574c24547f49e83ab48 */
--1.28922620524163922306886952100992796e-37L, /* bf845ef5f415c8732eeee7af584019b8 */
+ L(5.59473131247366877384844006003116688e-01), /* 3ffe1e7343236574c24547f49e83ab48 */
+L(-1.28922620524163922306886952100992796e-37), /* bf845ef5f415c8732eeee7af584019b8 */
/* x = 6.01562500000000000000000000000000000e-01 3ffe3400000000000000000000000000 */
/* cos(x) = 0.d30f4f392c357ab0661c5fa8a7d9b26627846fef214b1d19a22379ff9eddba087cf410eb097 */
- 8.24452353914429207485643598212356053e-01L, /* 3ffea61e9e72586af560cc38bf514fb3 */
- 3.79160239225080026987031418939026741e-35L, /* 3f8c93313c237f790a58e8cd111bcffd */
+ L(8.24452353914429207485643598212356053e-01), /* 3ffea61e9e72586af560cc38bf514fb3 */
+ L(3.79160239225080026987031418939026741e-35), /* 3f8c93313c237f790a58e8cd111bcffd */
/* sin(x) = 0.90e0e0d81ca678796cc92c8ea8c2815bc72ca78abe571bfa8576aacc571e096a33237e0e830 */
- 5.65931370507905990773159095689276114e-01L, /* 3ffe21c1c1b0394cf0f2d992591d5185 */
- 1.02202775968053982310991962521535027e-36L, /* 3f875bc72ca78abe571bfa8576aacc57 */
+ L(5.65931370507905990773159095689276114e-01), /* 3ffe21c1c1b0394cf0f2d992591d5185 */
+ L(1.02202775968053982310991962521535027e-36), /* 3f875bc72ca78abe571bfa8576aacc57 */
/* x = 6.09375000000000000000000000000000000e-01 3ffe3800000000000000000000000000 */
/* cos(x) = 0.d1ebe81a95ee752e48a26bcd32d6e922d7eb44b8ad2232f6930795e84b56317269b9dd1dfa6 */
- 8.20005899897234008255550633876556043e-01L, /* 3ffea3d7d0352bdcea5c9144d79a65ae */
--1.72008811955230823416724332297991247e-35L, /* bf8b6dd2814bb4752ddcd096cf86a17b */
+ L(8.20005899897234008255550633876556043e-01), /* 3ffea3d7d0352bdcea5c9144d79a65ae */
+L(-1.72008811955230823416724332297991247e-35), /* bf8b6dd2814bb4752ddcd096cf86a17b */
/* sin(x) = 0.9285dc9bc45dd9ea3d02457bcce59c4175aab6ff7929a8d287195525fdace200dba032874fb */
- 5.72355068234507240384953706824503608e-01L, /* 3ffe250bb93788bbb3d47a048af799cb */
- 2.12572273479933123944580199464514529e-35L, /* 3f8bc4175aab6ff7929a8d2871955260 */
+ L(5.72355068234507240384953706824503608e-01), /* 3ffe250bb93788bbb3d47a048af799cb */
+ L(2.12572273479933123944580199464514529e-35), /* 3f8bc4175aab6ff7929a8d2871955260 */
/* x = 6.17187500000000000000000000000000000e-01 3ffe3c00000000000000000000000000 */
/* cos(x) = 0.d0c5394d772228195e25736c03574707de0af1ca344b13bd3914bfe27518e9e426f5deff1e1 */
- 8.15509396946375476876345384201386217e-01L, /* 3ffea18a729aee445032bc4ae6d806af */
--4.28589138410712954051679139949341961e-35L, /* bf8cc7c10fa871ae5da76216375a00ec */
+ L(8.15509396946375476876345384201386217e-01), /* 3ffea18a729aee445032bc4ae6d806af */
+L(-4.28589138410712954051679139949341961e-35), /* bf8cc7c10fa871ae5da76216375a00ec */
/* sin(x) = 0.94288e48bd0335fc41c4cbd2920497a8f5d1d8185c99fa0081f90c27e2a53ffdd208a0dbe69 */
- 5.78743832357770354521111378581385347e-01L, /* 3ffe28511c917a066bf8838997a52409 */
- 1.77998063432551282609698670002456093e-35L, /* 3f8b7a8f5d1d8185c99fa0081f90c27e */
+ L(5.78743832357770354521111378581385347e-01), /* 3ffe28511c917a066bf8838997a52409 */
+ L(1.77998063432551282609698670002456093e-35), /* 3f8b7a8f5d1d8185c99fa0081f90c27e */
/* x = 6.25000000000000000000000000000000000e-01 3ffe4000000000000000000000000000 */
/* cos(x) = 0.cf9b476c897c25c5bfe750dd3f308eaf7bcc1ed00179a256870f4200445043dcdb1974b5878 */
- 8.10963119505217902189534803941080724e-01L, /* 3ffe9f368ed912f84b8b7fcea1ba7e61 */
- 1.10481292856794436426051402418804358e-35L, /* 3f8ad5ef7983da002f344ad0e1e84009 */
+ L(8.10963119505217902189534803941080724e-01), /* 3ffe9f368ed912f84b8b7fcea1ba7e61 */
+ L(1.10481292856794436426051402418804358e-35), /* 3f8ad5ef7983da002f344ad0e1e84009 */
/* sin(x) = 0.95c8ef544210ec0b91c49bd2aa09e8515fa61a156ebb10f5f8c232a6445b61ebf3c2ec268f9 */
- 5.85097272940462154805399314150080459e-01L, /* 3ffe2b91dea88421d817238937a55414 */
--1.78164576278056195136525335403380464e-35L, /* bf8b7aea059e5ea9144ef0a073dcd59c */
+ L(5.85097272940462154805399314150080459e-01), /* 3ffe2b91dea88421d817238937a55414 */
+L(-1.78164576278056195136525335403380464e-35), /* bf8b7aea059e5ea9144ef0a073dcd59c */
/* x = 6.32812500000000000000000000000000000e-01 3ffe4400000000000000000000000000 */
/* cos(x) = 0.ce6e171f92f2e27f32225327ec440ddaefae248413efc0e58ceee1ae369aabe73f88c87ed1a */
- 8.06367345055103913698795406077297399e-01L, /* 3ffe9cdc2e3f25e5c4fe6444a64fd888 */
- 1.04235088143133625463876245029180850e-35L, /* 3f8abb5df5c490827df81cb19ddc35c7 */
+ L(8.06367345055103913698795406077297399e-01), /* 3ffe9cdc2e3f25e5c4fe6444a64fd888 */
+ L(1.04235088143133625463876245029180850e-35), /* 3f8abb5df5c490827df81cb19ddc35c7 */
/* sin(x) = 0.9766f93cd18413a6aafc1cfc6fc28abb6817bf94ce349901ae3f48c3215d3eb60acc5f78903 */
- 5.91415002201316315087000225758031236e-01L, /* 3ffe2ecdf279a308274d55f839f8df85 */
- 8.07390238063560077355762466502569603e-36L, /* 3f8a576d02f7f299c6932035c7e91864 */
+ L(5.91415002201316315087000225758031236e-01), /* 3ffe2ecdf279a308274d55f839f8df85 */
+ L(8.07390238063560077355762466502569603e-36), /* 3f8a576d02f7f299c6932035c7e91864 */
/* x = 6.40625000000000000000000000000000000e-01 3ffe4800000000000000000000000000 */
/* cos(x) = 0.cd3dad1b5328a2e459f993f4f5108819faccbc4eeba9604e81c7adad51cc8a2561631a06826 */
- 8.01722354098418450607492605652964208e-01L, /* 3ffe9a7b5a36a65145c8b3f327e9ea21 */
- 6.09487851305233089325627939458963741e-36L, /* 3f8a033f599789dd752c09d038f5b5aa */
+ L(8.01722354098418450607492605652964208e-01), /* 3ffe9a7b5a36a65145c8b3f327e9ea21 */
+ L(6.09487851305233089325627939458963741e-36), /* 3f8a033f599789dd752c09d038f5b5aa */
/* sin(x) = 0.9902a58a45e27bed68412b426b675ed503f54d14c8172e0d373f42cadf04daf67319a7f94be */
- 5.97696634538701531238647618967334337e-01L, /* 3ffe32054b148bc4f7dad0825684d6cf */
--2.49527608940873714527427941350461554e-35L, /* bf8c0957e0559759bf468f964605e9a9 */
+ L(5.97696634538701531238647618967334337e-01), /* 3ffe32054b148bc4f7dad0825684d6cf */
+L(-2.49527608940873714527427941350461554e-35), /* bf8c0957e0559759bf468f964605e9a9 */
/* x = 6.48437500000000000000000000000000000e-01 3ffe4c00000000000000000000000000 */
/* cos(x) = 0.cc0a0e21709883a3ff00911e11a07ee3bd7ea2b04e081be99be0264791170761ae64b8b744a */
- 7.97028430141468342004642741431945296e-01L, /* 3ffe98141c42e1310747fe01223c2341 */
--8.35364432831812599727083251866305534e-37L, /* bf871c42815d4fb1f7e416641fd9b86f */
+ L(7.97028430141468342004642741431945296e-01), /* 3ffe98141c42e1310747fe01223c2341 */
+L(-8.35364432831812599727083251866305534e-37), /* bf871c42815d4fb1f7e416641fd9b86f */
/* sin(x) = 0.9a9bedcdf01b38d993f3d7820781de292033ead73b89e28f39313dbe3a6e463f845b5fa8490 */
- 6.03941786554156657267270287527367726e-01L, /* 3ffe3537db9be03671b327e7af040f04 */
--2.54578992328947177770363936132309779e-35L, /* bf8c0eb6fe60a94623b0eb863676120e */
+ L(6.03941786554156657267270287527367726e-01), /* 3ffe3537db9be03671b327e7af040f04 */
+L(-2.54578992328947177770363936132309779e-35), /* bf8c0eb6fe60a94623b0eb863676120e */
/* x = 6.56250000000000000000000000000000000e-01 3ffe5000000000000000000000000000 */
/* cos(x) = 0.cad33f00658fe5e8204bbc0f3a66a0e6a773f87987a780b243d7be83b3db1448ca0e0e62787 */
- 7.92285859677178543141501323781709399e-01L, /* 3ffe95a67e00cb1fcbd04097781e74cd */
- 2.47519558228473167879248891673807645e-35L, /* 3f8c07353b9fc3cc3d3c05921ebdf41e */
+ L(7.92285859677178543141501323781709399e-01), /* 3ffe95a67e00cb1fcbd04097781e74cd */
+ L(2.47519558228473167879248891673807645e-35), /* 3f8c07353b9fc3cc3d3c05921ebdf41e */
/* sin(x) = 0.9c32cba2b14156ef05256c4f857991ca6a547cd7ceb1ac8a8e62a282bd7b9183648a462bd04 */
- 6.10150077075791371273742393566183220e-01L, /* 3ffe386597456282adde0a4ad89f0af3 */
- 1.33842237929938963780969418369150532e-35L, /* 3f8b1ca6a547cd7ceb1ac8a8e62a282c */
+ L(6.10150077075791371273742393566183220e-01), /* 3ffe386597456282adde0a4ad89f0af3 */
+ L(1.33842237929938963780969418369150532e-35), /* 3f8b1ca6a547cd7ceb1ac8a8e62a282c */
/* x = 6.64062500000000000000000000000000000e-01 3ffe5400000000000000000000000000 */
/* cos(x) = 0.c99944936cf48c8911ff93fe64b3ddb7981e414bdaf6aae1203577de44878c62bc3bc9cf7b9 */
- 7.87494932167606083931328295965533034e-01L, /* 3ffe93328926d9e9191223ff27fcc968 */
--2.57915385618070637156514241185180920e-35L, /* bf8c12433f0df5a1284aa8f6fe54410e */
+ L(7.87494932167606083931328295965533034e-01), /* 3ffe93328926d9e9191223ff27fcc968 */
+L(-2.57915385618070637156514241185180920e-35), /* bf8c12433f0df5a1284aa8f6fe54410e */
/* sin(x) = 0.9dc738ad14204e689ac582d0f85826590feece34886cfefe2e08cf2bb8488d55424dc9d3525 */
- 6.16321127181550943005700433761731837e-01L, /* 3ffe3b8e715a28409cd1358b05a1f0b0 */
- 2.88497530050197716298085892460478666e-35L, /* 3f8c32c87f7671a44367f7f17046795e */
+ L(6.16321127181550943005700433761731837e-01), /* 3ffe3b8e715a28409cd1358b05a1f0b0 */
+ L(2.88497530050197716298085892460478666e-35), /* 3f8c32c87f7671a44367f7f17046795e */
/* x = 6.71875000000000000000000000000000000e-01 3ffe5800000000000000000000000000 */
/* cos(x) = 0.c85c23c26ed7b6f014ef546c47929682122876bfbf157de0aff3c4247d820c746e32cd4174f */
- 7.82655940026272796930787447428139026e-01L, /* 3ffe90b84784ddaf6de029dea8d88f25 */
- 1.69332045679237919427807771288506254e-35L, /* 3f8b682122876bfbf157de0aff3c4248 */
+ L(7.82655940026272796930787447428139026e-01), /* 3ffe90b84784ddaf6de029dea8d88f25 */
+ L(1.69332045679237919427807771288506254e-35), /* 3f8b682122876bfbf157de0aff3c4248 */
/* sin(x) = 0.9f592e9b66a9cf906a3c7aa3c10199849040c45ec3f0a747597311038101780c5f266059dbf */
- 6.22454560222343683041926705090443330e-01L, /* 3ffe3eb25d36cd539f20d478f5478203 */
- 1.91974786921147072717621236192269859e-35L, /* 3f8b9849040c45ec3f0a747597311038 */
+ L(6.22454560222343683041926705090443330e-01), /* 3ffe3eb25d36cd539f20d478f5478203 */
+ L(1.91974786921147072717621236192269859e-35), /* 3f8b9849040c45ec3f0a747597311038 */
/* x = 6.79687500000000000000000000000000000e-01 3ffe5c00000000000000000000000000 */
/* cos(x) = 0.c71be181ecd6875ce2da5615a03cca207d9adcb9dfb0a1d6c40a4f0056437f1a59ccddd06ee */
- 7.77769178600317903122203513685412863e-01L, /* 3ffe8e37c303d9ad0eb9c5b4ac2b407a */
--4.05296033424632846931240580239929672e-35L, /* bf8caefc13291a31027af149dfad87fd */
+ L(7.77769178600317903122203513685412863e-01), /* 3ffe8e37c303d9ad0eb9c5b4ac2b407a */
+L(-4.05296033424632846931240580239929672e-35), /* bf8caefc13291a31027af149dfad87fd */
/* sin(x) = 0.a0e8a725d33c828c11fa50fd9e9a15ffecfad43f3e534358076b9b0f6865694842b1e8c67dc */
- 6.28550001845029662028004327939032867e-01L, /* 3ffe41d14e4ba679051823f4a1fb3d34 */
- 1.65507421184028099672784511397428852e-35L, /* 3f8b5ffecfad43f3e534358076b9b0f7 */
+ L(6.28550001845029662028004327939032867e-01), /* 3ffe41d14e4ba679051823f4a1fb3d34 */
+ L(1.65507421184028099672784511397428852e-35), /* 3f8b5ffecfad43f3e534358076b9b0f7 */
/* x = 6.87500000000000000000000000000000000e-01 3ffe6000000000000000000000000000 */
/* cos(x) = 0.c5d882d2ee48030c7c07d28e981e34804f82ed4cf93655d2365389b716de6ad44676a1cc5da */
- 7.72834946152471544810851845913425178e-01L, /* 3ffe8bb105a5dc900618f80fa51d303c */
- 3.94975229341211664237241534741146939e-35L, /* 3f8ca4027c176a67c9b2ae91b29c4db9 */
+ L(7.72834946152471544810851845913425178e-01), /* 3ffe8bb105a5dc900618f80fa51d303c */
+ L(3.94975229341211664237241534741146939e-35), /* 3f8ca4027c176a67c9b2ae91b29c4db9 */
/* sin(x) = 0.a2759c0e79c35582527c32b55f5405c182c66160cb1d9eb7bb0b7cdf4ad66f317bda4332914 */
- 6.34607080015269296850309914203671436e-01L, /* 3ffe44eb381cf386ab04a4f8656abea8 */
- 4.33025916939968369326060156455927002e-36L, /* 3f897060b1985832c767adeec2df37d3 */
+ L(6.34607080015269296850309914203671436e-01), /* 3ffe44eb381cf386ab04a4f8656abea8 */
+ L(4.33025916939968369326060156455927002e-36), /* 3f897060b1985832c767adeec2df37d3 */
/* x = 6.95312500000000000000000000000000000e-01 3ffe6400000000000000000000000000 */
/* cos(x) = 0.c4920cc2ec38fb891b38827db08884fc66371ac4c2052ca8885b981bbcfd3bb7b093ee31515 */
- 7.67853543842850365879920759114193964e-01L, /* 3ffe89241985d871f712367104fb6111 */
- 3.75100035267325597157244776081706979e-36L, /* 3f893f198dc6b130814b2a2216e606ef */
+ L(7.67853543842850365879920759114193964e-01), /* 3ffe89241985d871f712367104fb6111 */
+ L(3.75100035267325597157244776081706979e-36), /* 3f893f198dc6b130814b2a2216e606ef */
/* sin(x) = 0.a400072188acf49cd6b173825e038346f105e1301afe642bcc364cea455e21e506e3e927ed8 */
- 6.40625425040230409188409779413961021e-01L, /* 3ffe48000e431159e939ad62e704bc07 */
- 2.46542747294664049615806500747173281e-36L, /* 3f88a37882f0980d7f3215e61b267523 */
+ L(6.40625425040230409188409779413961021e-01), /* 3ffe48000e431159e939ad62e704bc07 */
+ L(2.46542747294664049615806500747173281e-36), /* 3f88a37882f0980d7f3215e61b267523 */
/* x = 7.03125000000000000000000000000000000e-01 3ffe6800000000000000000000000000 */
/* cos(x) = 0.c348846bbd3631338ffe2bfe9dd1381a35b4e9c0c51b4c13fe376bad1bf5caacc4542be0aa9 */
- 7.62825275710576250507098753625429792e-01L, /* 3ffe869108d77a6c62671ffc57fd3ba2 */
- 4.22067411888601505004748939382325080e-35L, /* 3f8cc0d1ada74e0628da609ff1bb5d69 */
+ L(7.62825275710576250507098753625429792e-01), /* 3ffe869108d77a6c62671ffc57fd3ba2 */
+ L(4.22067411888601505004748939382325080e-35), /* 3f8cc0d1ada74e0628da609ff1bb5d69 */
/* sin(x) = 0.a587e23555bb08086d02b9c662cdd29316c3e9bd08d93793634a21b1810cce73bdb97a99b9e */
- 6.46604669591152370524042159882800763e-01L, /* 3ffe4b0fc46aab761010da05738cc59c */
--3.41742981816219412415674365946079826e-35L, /* bf8c6b6749e0b217b9364364e5aef274 */
+ L(6.46604669591152370524042159882800763e-01), /* 3ffe4b0fc46aab761010da05738cc59c */
+L(-3.41742981816219412415674365946079826e-35), /* bf8c6b6749e0b217b9364364e5aef274 */
/* x = 7.10937500000000000000000000000000000e-01 3ffe6c00000000000000000000000000 */
/* cos(x) = 0.c1fbeef380e4ffdd5a613ec8722f643ffe814ec2343e53adb549627224fdc9f2a7b77d3d69f */
- 7.57750448655219342240234832230493361e-01L, /* 3ffe83f7dde701c9ffbab4c27d90e45f */
--2.08767968311222650582659938787920125e-35L, /* bf8bbc0017eb13dcbc1ac524ab69d8de */
+ L(7.57750448655219342240234832230493361e-01), /* 3ffe83f7dde701c9ffbab4c27d90e45f */
+L(-2.08767968311222650582659938787920125e-35), /* bf8bbc0017eb13dcbc1ac524ab69d8de */
/* sin(x) = 0.a70d272a76a8d4b6da0ec90712bb748b96dabf88c3079246f3db7eea6e58ead4ed0e2843303 */
- 6.52544448725765956407573982284767763e-01L, /* 3ffe4e1a4e54ed51a96db41d920e2577 */
--8.61758060284379660697102362141557170e-36L, /* bf8a6e8d24a80ee79f0db721849022b2 */
+ L(6.52544448725765956407573982284767763e-01), /* 3ffe4e1a4e54ed51a96db41d920e2577 */
+L(-8.61758060284379660697102362141557170e-36), /* bf8a6e8d24a80ee79f0db721849022b2 */
/* x = 7.18750000000000000000000000000000000e-01 3ffe7000000000000000000000000000 */
/* cos(x) = 0.c0ac518c8b6ae710ba37a3eeb90cb15aebcb8bed4356fb507a48a6e97de9aa6d9660116b436 */
- 7.52629372418066476054541324847143116e-01L, /* 3ffe8158a31916d5ce21746f47dd7219 */
- 3.71306958657663189665450864311104571e-35L, /* 3f8c8ad75e5c5f6a1ab7da83d245374c */
+ L(7.52629372418066476054541324847143116e-01), /* 3ffe8158a31916d5ce21746f47dd7219 */
+ L(3.71306958657663189665450864311104571e-35), /* 3f8c8ad75e5c5f6a1ab7da83d245374c */
/* sin(x) = 0.a88fcfebd9a8dd47e2f3c76ef9e2439920f7e7fbe735f8bcc985491ec6f12a2d4214f8cfa99 */
- 6.58444399910567541589583954884041989e-01L, /* 3ffe511f9fd7b351ba8fc5e78eddf3c5 */
--4.54412944084300330523721391865787219e-35L, /* bf8ce336f840c020c6503a19b3d5b70a */
+ L(6.58444399910567541589583954884041989e-01), /* 3ffe511f9fd7b351ba8fc5e78eddf3c5 */
+L(-4.54412944084300330523721391865787219e-35), /* bf8ce336f840c020c6503a19b3d5b70a */
/* x = 7.26562500000000000000000000000000000e-01 3ffe7400000000000000000000000000 */
/* cos(x) = 0.bf59b17550a4406875969296567cf3e3b4e483061877c02811c6cae85fad5a6c3da58f49292 */
- 7.47462359563216166669700384714767552e-01L, /* 3ffe7eb362eaa14880d0eb2d252cacfa */
--9.11094340926220027288083639048016945e-36L, /* bf8a8389636f9f3cf107fafdc726a2f4 */
+ L(7.47462359563216166669700384714767552e-01), /* 3ffe7eb362eaa14880d0eb2d252cacfa */
+L(-9.11094340926220027288083639048016945e-36), /* bf8a8389636f9f3cf107fafdc726a2f4 */
/* sin(x) = 0.aa0fd66eddb921232c28520d3911b8a03193b47f187f1471ac216fbcd5bb81029294d3a73f1 */
- 6.64304163042946276515506587432846246e-01L, /* 3ffe541facddbb7242465850a41a7223 */
- 4.26004843895378210155889028714676019e-35L, /* 3f8cc5018c9da3f8c3f8a38d610b7de7 */
+ L(6.64304163042946276515506587432846246e-01), /* 3ffe541facddbb7242465850a41a7223 */
+ L(4.26004843895378210155889028714676019e-35), /* 3f8cc5018c9da3f8c3f8a38d610b7de7 */
/* x = 7.34375000000000000000000000000000000e-01 3ffe7800000000000000000000000000 */
/* cos(x) = 0.be0413f84f2a771c614946a88cbf4da1d75a5560243de8f2283fefa0ea4a48468a52d51d8b3 */
- 7.42249725458501306991347253449610537e-01L, /* 3ffe7c0827f09e54ee38c2928d51197f */
--3.78925270049800913539923473871287550e-35L, /* bf8c92f1452d54fede10b86ebe0082f9 */
+ L(7.42249725458501306991347253449610537e-01), /* 3ffe7c0827f09e54ee38c2928d51197f */
+L(-3.78925270049800913539923473871287550e-35), /* bf8c92f1452d54fede10b86ebe0082f9 */
/* sin(x) = 0.ab8d34b36acd987210ed343ec65d7e3adc2e7109fce43d55c8d57dfdf55b9e01d2cc1f1b9ec */
- 6.70123380473162894654531583500648495e-01L, /* 3ffe571a6966d59b30e421da687d8cbb */
--1.33165852952743729897634069393684656e-36L, /* bf87c523d18ef6031bc2aa372a82020b */
+ L(6.70123380473162894654531583500648495e-01), /* 3ffe571a6966d59b30e421da687d8cbb */
+L(-1.33165852952743729897634069393684656e-36), /* bf87c523d18ef6031bc2aa372a82020b */
/* x = 7.42187500000000000000000000000000000e-01 3ffe7c00000000000000000000000000 */
/* cos(x) = 0.bcab7e6bfb2a14a9b122c574a376bec98ab14808c64a4e731b34047e217611013ac99c0f25d */
- 7.36991788256240741057089385586450844e-01L, /* 3ffe7956fcd7f654295362458ae946ed */
- 4.72358938637974850573747497460125519e-35L, /* 3f8cf64c558a404632527398d9a023f1 */
+ L(7.36991788256240741057089385586450844e-01), /* 3ffe7956fcd7f654295362458ae946ed */
+ L(4.72358938637974850573747497460125519e-35), /* 3f8cf64c558a404632527398d9a023f1 */
/* sin(x) = 0.ad07e4c409d08c4fa3a9057bb0ac24b8636e74e76f51e09bd6b2319707cbd9f5e254643897a */
- 6.75901697026178809189642203142423973e-01L, /* 3ffe5a0fc98813a1189f47520af76158 */
- 2.76252586616364878801928456702948857e-35L, /* 3f8c25c31b73a73b7a8f04deb5918cb8 */
+ L(6.75901697026178809189642203142423973e-01), /* 3ffe5a0fc98813a1189f47520af76158 */
+ L(2.76252586616364878801928456702948857e-35), /* 3f8c25c31b73a73b7a8f04deb5918cb8 */
/* x = 7.50000000000000000000000000000000000e-01 3ffe8000000000000000000000000000 */
/* cos(x) = 0.bb4ff632a908f73ec151839cb9d993b4e0bfb8f20e7e44e6e4aee845e35575c3106dbe6fd06 */
- 7.31688868873820886311838753000084529e-01L, /* 3ffe769fec655211ee7d82a3073973b3 */
- 1.48255637548931697184991710293198620e-35L, /* 3f8b3b4e0bfb8f20e7e44e6e4aee845e */
+ L(7.31688868873820886311838753000084529e-01), /* 3ffe769fec655211ee7d82a3073973b3 */
+ L(1.48255637548931697184991710293198620e-35), /* 3f8b3b4e0bfb8f20e7e44e6e4aee845e */
/* sin(x) = 0.ae7fe0b5fc786b2d966e1d6af140a488476747c2646425fc7533f532cd044cb10a971a49a6a */
- 6.81638760023334166733241952779893908e-01L, /* 3ffe5cffc16bf8f0d65b2cdc3ad5e281 */
- 2.74838775935027549024224114338667371e-35L, /* 3f8c24423b3a3e1323212fe3a99fa996 */
+ L(6.81638760023334166733241952779893908e-01), /* 3ffe5cffc16bf8f0d65b2cdc3ad5e281 */
+ L(2.74838775935027549024224114338667371e-35), /* 3f8c24423b3a3e1323212fe3a99fa996 */
/* x = 7.57812500000000000000000000000000000e-01 3ffe8400000000000000000000000000 */
/* cos(x) = 0.b9f180ba77dd0751628e135a9508299012230f14becacdd14c3f8862d122de5b56d55b53360 */
- 7.26341290974108590410147630237598973e-01L, /* 3ffe73e30174efba0ea2c51c26b52a10 */
- 3.12683579338351123545814364980658990e-35L, /* 3f8c4c80911878a5f6566e8a61fc4317 */
+ L(7.26341290974108590410147630237598973e-01), /* 3ffe73e30174efba0ea2c51c26b52a10 */
+ L(3.12683579338351123545814364980658990e-35), /* 3f8c4c80911878a5f6566e8a61fc4317 */
/* sin(x) = 0.aff522a954f2ba16d9defdc416e33f5e9a5dfd5a6c228e0abc4d521327ff6e2517a7b3851dd */
- 6.87334219303873534951703613035647220e-01L, /* 3ffe5fea4552a9e5742db3bdfb882dc6 */
- 4.76739454455410744997012795035529128e-35L, /* 3f8cfaf4d2efead361147055e26a9099 */
+ L(6.87334219303873534951703613035647220e-01), /* 3ffe5fea4552a9e5742db3bdfb882dc6 */
+ L(4.76739454455410744997012795035529128e-35), /* 3f8cfaf4d2efead361147055e26a9099 */
/* x = 7.65625000000000000000000000000000000e-01 3ffe8800000000000000000000000000 */
/* cos(x) = 0.b890237d3bb3c284b614a0539016bfa1053730bbdf940fa895e185f8e58884d3dda15e63371 */
- 7.20949380945696418043812784148447688e-01L, /* 3ffe712046fa776785096c2940a7202d */
- 4.78691285733673379499536326050811832e-35L, /* 3f8cfd0829b985defca07d44af0c2fc7 */
+ L(7.20949380945696418043812784148447688e-01), /* 3ffe712046fa776785096c2940a7202d */
+ L(4.78691285733673379499536326050811832e-35), /* 3f8cfd0829b985defca07d44af0c2fc7 */
/* sin(x) = 0.b167a4c90d63c4244cf5493b7cc23bd3c3c1225e078baa0c53d6d400b926281f537a1a260e6 */
- 6.92987727246317910281815490823048210e-01L, /* 3ffe62cf49921ac7884899ea9276f984 */
- 4.50089871077663557180849219529189918e-35L, /* 3f8cde9e1e0912f03c5d50629eb6a006 */
+ L(6.92987727246317910281815490823048210e-01), /* 3ffe62cf49921ac7884899ea9276f984 */
+ L(4.50089871077663557180849219529189918e-35), /* 3f8cde9e1e0912f03c5d50629eb6a006 */
/* x = 7.73437500000000000000000000000000000e-01 3ffe8c00000000000000000000000000 */
/* cos(x) = 0.b72be40067aaf2c050dbdb7a14c3d7d4f203f6b3f0224a4afe55d6ec8e92b508fd5c5984b3b */
- 7.15513467882981573520620561289896903e-01L, /* 3ffe6e57c800cf55e580a1b7b6f42988 */
--3.02191815581445336509438104625489192e-35L, /* bf8c41586fe04a607eedada80d51489c */
+ L(7.15513467882981573520620561289896903e-01), /* 3ffe6e57c800cf55e580a1b7b6f42988 */
+L(-3.02191815581445336509438104625489192e-35), /* bf8c41586fe04a607eedada80d51489c */
/* sin(x) = 0.b2d7614b1f3aaa24df2d6e20a77e1ca3e6d838c03e29c1bcb026e6733324815fadc9eb89674 */
- 6.98598938789681741301929277107891591e-01L, /* 3ffe65aec2963e755449be5adc414efc */
- 2.15465226809256290914423429408722521e-35L, /* 3f8bca3e6d838c03e29c1bcb026e6733 */
+ L(6.98598938789681741301929277107891591e-01), /* 3ffe65aec2963e755449be5adc414efc */
+ L(2.15465226809256290914423429408722521e-35), /* 3f8bca3e6d838c03e29c1bcb026e6733 */
/* x = 7.81250000000000000000000000000000000e-01 3ffe9000000000000000000000000000 */
/* cos(x) = 0.b5c4c7d4f7dae915ac786ccf4b1a498d3e73b6e5e74fe7519d9c53ee6d6b90e881bddfc33e1 */
- 7.10033883566079674974121643959490219e-01L, /* 3ffe6b898fa9efb5d22b58f0d99e9635 */
--4.09623224763692443220896752907902465e-35L, /* bf8cb3960c6248d0c580c573131d608d */
+ L(7.10033883566079674974121643959490219e-01), /* 3ffe6b898fa9efb5d22b58f0d99e9635 */
+L(-4.09623224763692443220896752907902465e-35), /* bf8cb3960c6248d0c580c573131d608d */
/* sin(x) = 0.b44452709a59752905913765434a59d111f0433eb2b133f7d103207e2aeb4aae111ddc385b3 */
- 7.04167511454533672780059509973942844e-01L, /* 3ffe6888a4e134b2ea520b226eca8695 */
--2.87259372740393348676633610275598640e-35L, /* bf8c3177707de60a6a76604177e6fc0f */
+ L(7.04167511454533672780059509973942844e-01), /* 3ffe6888a4e134b2ea520b226eca8695 */
+L(-2.87259372740393348676633610275598640e-35), /* bf8c3177707de60a6a76604177e6fc0f */
/* x = 7.89062500000000000000000000000000000e-01 3ffe9400000000000000000000000000 */
/* cos(x) = 0.b45ad4975b1294cadca4cf40ec8f22a68cd14b175835239a37e63acb85e8e9505215df18140 */
- 7.04510962440574606164129481545916976e-01L, /* 3ffe68b5a92eb6252995b9499e81d91e */
- 2.60682037357042658395360726992048803e-35L, /* 3f8c1534668a58bac1a91cd1bf31d65c */
+ L(7.04510962440574606164129481545916976e-01), /* 3ffe68b5a92eb6252995b9499e81d91e */
+ L(2.60682037357042658395360726992048803e-35), /* 3f8c1534668a58bac1a91cd1bf31d65c */
/* sin(x) = 0.b5ae7285bc10cf515753847e8f8b7a30e0a580d929d770103509880680f7b8b0e8ad23b65d8 */
- 7.09693105363899724959669028139035515e-01L, /* 3ffe6b5ce50b78219ea2aea708fd1f17 */
--4.37026016974122945368562319136420097e-36L, /* bf8973c7d69fc9b58a23fbf2bd9dfe60 */
+ L(7.09693105363899724959669028139035515e-01), /* 3ffe6b5ce50b78219ea2aea708fd1f17 */
+L(-4.37026016974122945368562319136420097e-36), /* bf8973c7d69fc9b58a23fbf2bd9dfe60 */
};
diff --git a/sysdeps/ieee754/ldbl-128/w_expl.c b/sysdeps/ieee754/ldbl-128/w_expl.c
deleted file mode 100644
index c32616e504..0000000000
--- a/sysdeps/ieee754/ldbl-128/w_expl.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* w_expl.c -- long double version of w_exp.c.
- * Conversion to long double by Ulrich Drepper,
- * Cygnus Support, drepper@cygnus.com.
- */
-
-/*
- * ====================================================
- * 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.
- * ====================================================
- */
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: $";
-#endif
-
-/*
- * wrapper expl(x)
- */
-
-#include <math.h>
-#include <math_private.h>
-
-long double __expl(long double x) /* wrapper exp */
-{
-#ifdef _IEEE_LIBM
- return __ieee754_expl(x);
-#else
- long double z = __ieee754_expl (x);
- if (__glibc_unlikely (!isfinite (z) || z == 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206 + !!signbit (x));
-
- return z;
-#endif
-}
-hidden_def (__expl)
-weak_alias (__expl, expl)
diff --git a/sysdeps/ieee754/ldbl-128/x2y2m1l.c b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
index 733742da04..390163fbc4 100644
--- a/sysdeps/ieee754/ldbl-128/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,59 +18,30 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_splitl.h>
#include <stdlib.h>
+
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
given that |X| >= |Y| and the values are small enough that no
overflow occurs. */
static inline void
-add_split (long double *hi, long double *lo, long double x, long double y)
+add_split (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
{
/* Apply Dekker's algorithm. */
*hi = x + y;
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
static int
compare (const void *p, const void *q)
{
- long double pld = fabsl (*(const long double *) p);
- long double qld = fabsl (*(const long double *) q);
+ _Float128 pld = fabsl (*(const _Float128 *) p);
+ _Float128 qld = fabsl (*(const _Float128 *) q);
if (pld < qld)
return -1;
else if (pld == qld)
@@ -83,22 +54,22 @@ compare (const void *p, const void *q)
It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
0.5. */
-long double
-__x2y2m1l (long double x, long double y)
+_Float128
+__x2y2m1l (_Float128 x, _Float128 y)
{
- long double vals[5];
+ _Float128 vals[5];
SET_RESTORE_ROUNDL (FE_TONEAREST);
- mul_split (&vals[1], &vals[0], x, x);
- mul_split (&vals[3], &vals[2], y, y);
- vals[4] = -1.0L;
- qsort (vals, 5, sizeof (long double), compare);
+ mul_splitl (&vals[1], &vals[0], x, x);
+ mul_splitl (&vals[3], &vals[2], y, y);
+ vals[4] = -1;
+ qsort (vals, 5, sizeof (_Float128), compare);
/* Add up the values so that each element of VALS has absolute value
at most equal to the last set bit of the next nonzero
element. */
for (size_t i = 0; i <= 3; i++)
{
add_split (&vals[i + 1], &vals[i], vals[i + 1], vals[i]);
- qsort (vals + i + 1, 4 - i, sizeof (long double), compare);
+ qsort (vals + i + 1, 4 - i, sizeof (_Float128), compare);
}
/* Now any error from this addition will be small. */
return vals[4] + vals[3] + vals[2] + vals[1] + vals[0];
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
new file mode 100644
index 0000000000..412beb5b5c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
@@ -0,0 +1,22 @@
+ifeq ($(subdir),stdio-common)
+routines += ieee128-printf_size
+
+tests-internal += test-printf-size-ieee128 test-printf-size-ibm128
+CFLAGS-test-printf-size-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
+CFLAGS-test-printf-size-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
+
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)test-printf-size-ieee128.out
+tests-special += $(objpfx)test-printf-size-ibm128.out
+endif
+
+$(objpfx)test-printf-size-ieee128.out: \
+ tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ieee128
+ $(SHELL) $^ '$(test-program-prefix)' $@; \
+ $(evaluate-test)
+
+$(objpfx)test-printf-size-ibm128.out: \
+ tst-printfsz-islongdouble.sh $(objpfx)test-printf-size-ibm128
+ $(SHELL) $^ '$(test-program-prefix)' $@; \
+ $(evaluate-test)
+endif
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
new file mode 100644
index 0000000000..4aa34dbe59
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
@@ -0,0 +1,123 @@
+%include <ldbl-128ibm-compat-abi.h>
+%ifndef LDBL_IBM128_VERSION
+% error "ldbl-128ibm-compat-abi.h must define LDBL_IBM128_VERSION"
+%endif
+
+libm {
+ LDBL_IBM128_VERSION {
+ __acoshieee128;
+ __acosieee128;
+ __asinhieee128;
+ __asinieee128;
+ __atan2ieee128;
+ __atanhieee128;
+ __atanieee128;
+ __cabsieee128;
+ __cacoshieee128;
+ __cacosieee128;
+ __canonicalizeieee128;
+ __cargieee128;
+ __casinhieee128;
+ __casinieee128;
+ __catanhieee128;
+ __catanieee128;
+ __cbrtieee128;
+ __ccoshieee128;
+ __ccosieee128;
+ __ceilieee128;
+ __cexpieee128;
+ __cimagieee128;
+ __clog10ieee128;
+ __clogieee128;
+ __conjieee128;
+ __copysignieee128;
+ __coshieee128;
+ __cosieee128;
+ __cpowieee128;
+ __cprojieee128;
+ __crealieee128;
+ __csinhieee128;
+ __csinieee128;
+ __csqrtieee128;
+ __ctanhieee128;
+ __ctanieee128;
+ __erfcieee128;
+ __erfieee128;
+ __exp10ieee128;
+ __exp2ieee128;
+ __expieee128;
+ __expm1ieee128;
+ __fabsieee128;
+ __fdimieee128;
+ __floorieee128;
+ __fmaieee128;
+ __fmaxieee128;
+ __fmaxmagieee128;
+ __fminieee128;
+ __fminmagieee128;
+ __fmodieee128;
+ __frexpieee128;
+ __fromfpieee128;
+ __fromfpxieee128;
+ __getpayloadieee128;
+ __hypotieee128;
+ __ilogbieee128;
+ __j0ieee128;
+ __j1ieee128;
+ __jnieee128;
+ __ldexpieee128;
+ __lgammaieee128;
+ __lgammaieee128_r;
+ __llogbieee128;
+ __llrintieee128;
+ __llroundieee128;
+ __log10ieee128;
+ __log1pieee128;
+ __log2ieee128;
+ __logbieee128;
+ __logieee128;
+ __lrintieee128;
+ __lroundieee128;
+ __modfieee128;
+ __nanieee128;
+ __nearbyintieee128;
+ __nextafterieee128;
+ __nextdownieee128;
+ __nextupieee128;
+ __powieee128;
+ __remainderieee128;
+ __remquoieee128;
+ __rintieee128;
+ __roundevenieee128;
+ __roundieee128;
+ __scalblnieee128;
+ __scalbnieee128;
+ __setpayloadieee128;
+ __setpayloadsigieee128;
+ __sincosieee128;
+ __sinhieee128;
+ __sinieee128;
+ __sqrtieee128;
+ __tanhieee128;
+ __tanieee128;
+ __tgammaieee128;
+ __totalorderieee128;
+ __totalordermagieee128;
+ __truncieee128;
+ __ufromfpieee128;
+ __ufromfpxieee128;
+ __y0ieee128;
+ __y1ieee128;
+ __ynieee128;
+ }
+}
+libc {
+ LDBL_IBM128_VERSION {
+ __strfromieee128;
+ __strtoieee128;
+ __strtoieee128_l;
+ __wcstoieee128;
+ __wcstoieee128_l;
+
+ __printf_sizeieee128;
+ }
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c
new file mode 100644
index 0000000000..646f673648
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf_size.c
@@ -0,0 +1,32 @@
+/* Wrapper for printf_size. IEEE128 version.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <printf.h>
+
+extern __typeof (printf_size) __printf_size;
+
+int
+___ieee128_printf_size (FILE *fp, const struct printf_info *info,
+ const void *const *args)
+{
+ struct printf_info info_ieee128 = *info;
+
+ info_ieee128.is_binary128 = info->is_long_double;
+ return __printf_size (fp, &info_ieee128, args);
+}
+strong_alias (___ieee128_printf_size, __printf_sizeieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h
new file mode 100644
index 0000000000..a21dfcaea5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h
@@ -0,0 +1,64 @@
+/* Define aliases for libm _Float128 functions.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBM_ALIAS_FLOAT128_H
+#define _LIBM_ALIAS_FLOAT128_H
+
+#include <bits/floatn.h>
+#include <ldbl-128ibm-compat-abi.h>
+
+/* This macro should be used on all long double functions that are not part of
+ the _Float128 API in order to provide *ieee128 symbols without exposing
+ internal *f128 symbols. */
+#define libm_alias_float128_other_r_ldbl(from, to, r) \
+ strong_alias (from ## f128 ## r, __ ## to ## ieee128 ## r)
+
+/* Define _FloatN / _FloatNx aliases (other than that for _Float128)
+ for a _Float128 libm function that has internal name FROM ## f128
+ ## R and public names TO ## suffix ## R for each suffix of a
+ supported _FloatN / _FloatNx floating-point type with the same
+ format as _Float128. */
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_float128_other_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f64x ## r); \
+ libm_alias_float128_other_r_ldbl(from, to, r)
+#else
+# define libm_alias_float128_other_r(from, to, r) \
+ libm_alias_float128_other_r_ldbl(from, to, r)
+#endif
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128_other(from, to) \
+ libm_alias_float128_other_r (from, to, )
+
+/* Define aliases for a _Float128 libm function that has internal name
+ FROM ## f128 ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ _Float128. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_float128_r(from, to, r) \
+ weak_alias (from ## f128 ## r, to ## f128 ## r); \
+ libm_alias_float128_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_float128(from, to) libm_alias_float128_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c
new file mode 100644
index 0000000000..21eeb94af0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c
@@ -0,0 +1,20 @@
+/* Definitions for strfromf128.
+
+ Copyright (C) 2018 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "../float128/strfromf128.c"
+weak_alias (strfromf128, __strfromieee128)
diff --git a/sysdeps/ieee754/ldbl-64-128/w_log1pl.c b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c
index 969fadc205..0cbdc2bc27 100644
--- a/sysdeps/ieee754/ldbl-64-128/w_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c
@@ -1,5 +1,5 @@
-/* Wrapper for __log1pl that handles setting errno.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Definition of strtof128.
+ Copyright (C) 2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log1pl.c>
-long_double_symbol (libm, __w_log1pl, log1pl);
+#include "../float128/strtof128.c"
+weak_alias (strtof128, __strtoieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c
index 7e73c9abf8..1a166cd4b0 100644
--- a/sysdeps/ieee754/ldbl-128ibm/w_scalblnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c
@@ -1,5 +1,5 @@
-/* Wrapper for __scalblnl handles setting errno.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(name, alias)
-#include <math/w_scalblnl.c>
-long_double_symbol (libm, __w_scalblnl, scalblnl);
+#include "../float128/strtof128_l.c"
+weak_alias (strtof128_l, __strtoieee128_l)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c
new file mode 100644
index 0000000000..3280597d13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ibm128.c
@@ -0,0 +1 @@
+#include <tst-printfsz-islongdouble.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c
new file mode 100644
index 0000000000..3280597d13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-size-ieee128.c
@@ -0,0 +1 @@
+#include <tst-printfsz-islongdouble.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c
new file mode 100644
index 0000000000..22bdd56aee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c
@@ -0,0 +1,20 @@
+/* Definition of wcstof128.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "../float128/wcstof128.c"
+weak_alias (wcstof128, __wcstoieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c
new file mode 100644
index 0000000000..adac083939
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c
@@ -0,0 +1,20 @@
+/* Convert string representing a number to a _Float128 value, with locale.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "../float128/wcstof128_l.c"
+weak_alias (wcstof128_l, __wcstoieee128_l)
diff --git a/sysdeps/ieee754/ldbl-128ibm/Makefile b/sysdeps/ieee754/ldbl-128ibm/Makefile
index 5591814824..bdba6cc6b5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm/Makefile
@@ -8,3 +8,9 @@ ifeq ($(subdir),stdlib)
tests += tst-strtold-ldbl-128ibm
$(objpfx)tst-strtold-ldbl-128ibm: $(libm)
endif
+
+ifeq ($(subdir),math)
+tests += test-fmodl-ldbl-128ibm test-remainderl-ldbl-128ibm \
+ test-remquol-ldbl-128ibm test-canonical-ldbl-128ibm \
+ test-totalorderl-ldbl-128ibm
+endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
new file mode 100644
index 0000000000..60c54cca46
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -0,0 +1,58 @@
+/* Define iscanonical macro. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+#ifdef __NO_LONG_DOUBLE_MATH
+# define iscanonical(x) ((void) (__typeof (x)) (x), 1)
+#else
+extern int __iscanonicall (long double __x)
+ __THROW __attribute__ ((__const__));
+# define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
+# define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+# if __HAVE_DISTINCT_FLOAT128
+# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+# endif
+
+/* Return nonzero value if X is canonical. In IEEE interchange binary
+ formats, all values are canonical, but the argument must still be
+ converted to its semantic type for any exceptions arising from the
+ conversion, before being discarded; in IBM long double, there are
+ encodings that are not consistently handled as corresponding to any
+ particular value of the type, and we return 0 for those. */
+# ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+# else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile)). */
+extern "C++" {
+inline int iscanonical (float __val) { return __iscanonicalf (__val); }
+inline int iscanonical (double __val) { return __iscanonical (__val); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+# endif /* __cplusplus */
+#endif /* __NO_LONG_DOUBLE_MATH */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index cab1da9995..f85fe678ba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -53,10 +53,10 @@ __ieee754_acoshl(long double x)
return 0.0; /* acosh(1) = 0 */
} else if (hx > 0x4000000000000000LL) { /* 2**56 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2.0*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
index 5974ee1338..1f8e405c9b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
@@ -51,7 +51,7 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtl.
*/
#include <math.h>
@@ -268,7 +268,7 @@ __ieee754_acosl (long double x)
double shi, slo;
z = (one - a) * 0.5;
- s = __ieee754_sqrtl (z);
+ s = sqrtl (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
The change w from s to the improved value is
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
index 6ed5e8d68d..e8b0221a92 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
@@ -61,8 +61,9 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
-long double sqrtl (long double);
+#include <math-underflow.h>
static const long double
one = 1.0L,
@@ -226,7 +227,7 @@ __ieee754_asinl (long double x)
return x + x * w;
}
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (a > 0.975L)
{
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
index b576f42030..25c286b8ff 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0L, huge = 1e300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
index 5699b8e53d..b4c17856b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index ca3cbb53af..16d4205465 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point e^x.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
Partly based on double-precision code
@@ -65,7 +65,9 @@
#include <fenv.h>
#include <inttypes.h>
#include <math_private.h>
-#include <sysdeps/ieee754/ldbl-128/t_expl.h>
+
+
+#include "t_expl.h"
static const long double C[] = {
/* Smallest integer x for which e^x overflows. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
index 205097d38f..fae7dbe888 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
@@ -55,6 +55,13 @@ __ieee754_fmodl (long double x, long double y)
return x;
/* At this point the absolute value of the high doubles of
x and y must be equal. */
+ if ((lx & 0x7fffffffffffffffLL) == 0
+ && (ly & 0x7fffffffffffffffLL) == 0)
+ /* Both low parts are zero. The result should be an
+ appropriately signed zero, but the subsequent logic
+ could treat them as unequal, depending on the signs
+ of the low parts. */
+ return Zero[(uint64_t) sx >> 63];
/* If the low double of y is the same sign as the high
double of y (ie. the low double increases |y|)... */
if (((ly ^ sy) & 0x8000000000000000LL) == 0
@@ -112,7 +119,7 @@ __ieee754_fmodl (long double x, long double y)
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz;
}
}
@@ -121,7 +128,7 @@ __ieee754_fmodl (long double x, long double y)
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
- return Zero[(u_int64_t)sx>>63];
+ return Zero[(uint64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx;
iy -= 1;
@@ -130,15 +137,11 @@ __ieee754_fmodl (long double x, long double y)
x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
} else { /* subnormal output */
n = -1022 - iy;
- if(n<=48) {
- lx = (lx>>n)|((u_int64_t)hx<<(64-n));
- hx >>= n;
- } else if (n<=63) {
- lx = (hx<<(64-n))|(lx>>n); hx = sx;
- } else {
- lx = hx>>(n-64); hx = sx;
- }
- x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
+ /* We know 1 <= N <= 52, and that there are no nonzero
+ bits in places below 2^-1074. */
+ lx = (lx >> n) | ((uint64_t) hx << (64 - n));
+ hx >>= n;
+ x = ldbl_insert_mantissa((sx>>63), -1023, hx, lx);
x *= one; /* create necessary signal */
}
return x; /* exact output */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
index 8dbb131f93..84ea7ee0f5 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -106,7 +107,7 @@ gammal_positive (long double x, int *exp2_adj)
long double ret = (__ieee754_powl (x_adj_mant, x_adj)
* __ieee754_exp2l (x_adj_log2 * x_adj_frac)
* __ieee754_expl (-x_adj)
- * __ieee754_sqrtl (2 * M_PIl / x_adj)
+ * sqrtl (2 * M_PIl / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
long double bsum = gamma_coeff[NCOEFF - 1];
@@ -134,7 +135,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return 1.0 / x;
}
- if (hx < 0 && (u_int64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
+ if (hx < 0 && (uint64_t) hx < 0xfff0000000000000ULL && __rintl (x) == x)
{
/* Return value for integer x < 0 is NaN with invalid exception. */
*signgamp = 0;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
index c68dac03b0..842f77b7ed 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
@@ -44,6 +44,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double
__ieee754_hypotl(long double x, long double y)
@@ -67,6 +68,8 @@ __ieee754_hypotl(long double x, long double y)
if(ha > 0x5f30000000000000LL) { /* a>2**500 */
if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
if(ha == 0x7ff0000000000000LL)
w = a;
if(hb == 0x7ff0000000000000LL)
@@ -105,7 +108,7 @@ __ieee754_hypotl(long double x, long double y)
= a1*(a1+a2) + a2*a + b*b
= a1*a1 + a1*a2 + a2*a + b*b
= a1*a1 + a2*(a+a1) + b*b */
- w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
+ w = sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
} else {
a = a+a;
ldbl_unpack (b, &hi, &lo);
@@ -122,7 +125,7 @@ __ieee754_hypotl(long double x, long double y)
= w*w + a1*b + a2*b
= w*w + a1*(b1+b2) + a2*b
= w*w + a1*b1 + a1*b2 + a2*b */
- w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
+ w = sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
}
if(k!=0)
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index 39a238aa9b..448cfb63fe 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -1,3 +1,864 @@
-/* Looks like we can use ieee854 e_j0l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j0l.c>
+/* Bessel function of order zero. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.ornl.gov).
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
+
+/* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
+ Peak relative error 3.4e-37
+ 0 <= x <= 2 */
+#define NJ0_2N 6
+static const long double J0_2N[NJ0_2N + 1] = {
+ 3.133239376997663645548490085151484674892E16L,
+ -5.479944965767990821079467311839107722107E14L,
+ 6.290828903904724265980249871997551894090E12L,
+ -3.633750176832769659849028554429106299915E10L,
+ 1.207743757532429576399485415069244807022E8L,
+ -2.107485999925074577174305650549367415465E5L,
+ 1.562826808020631846245296572935547005859E2L,
+};
+#define NJ0_2D 6
+static const long double J0_2D[NJ0_2D + 1] = {
+ 2.005273201278504733151033654496928968261E18L,
+ 2.063038558793221244373123294054149790864E16L,
+ 1.053350447931127971406896594022010524994E14L,
+ 3.496556557558702583143527876385508882310E11L,
+ 8.249114511878616075860654484367133976306E8L,
+ 1.402965782449571800199759247964242790589E6L,
+ 1.619910762853439600957801751815074787351E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2),
+ 0 <= 1/x <= .0625
+ Peak relative error 3.3e-36 */
+#define NP16_IN 9
+static const long double P16_IN[NP16_IN + 1] = {
+ -1.901689868258117463979611259731176301065E-16L,
+ -1.798743043824071514483008340803573980931E-13L,
+ -6.481746687115262291873324132944647438959E-11L,
+ -1.150651553745409037257197798528294248012E-8L,
+ -1.088408467297401082271185599507222695995E-6L,
+ -5.551996725183495852661022587879817546508E-5L,
+ -1.477286941214245433866838787454880214736E-3L,
+ -1.882877976157714592017345347609200402472E-2L,
+ -9.620983176855405325086530374317855880515E-2L,
+ -1.271468546258855781530458854476627766233E-1L,
+};
+#define NP16_ID 9
+static const long double P16_ID[NP16_ID + 1] = {
+ 2.704625590411544837659891569420764475007E-15L,
+ 2.562526347676857624104306349421985403573E-12L,
+ 9.259137589952741054108665570122085036246E-10L,
+ 1.651044705794378365237454962653430805272E-7L,
+ 1.573561544138733044977714063100859136660E-5L,
+ 8.134482112334882274688298469629884804056E-4L,
+ 2.219259239404080863919375103673593571689E-2L,
+ 2.976990606226596289580242451096393862792E-1L,
+ 1.713895630454693931742734911930937246254E0L,
+ 3.231552290717904041465898249160757368855E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 0.0625 <= 1/x <= 0.125
+ Peak relative error 2.4e-35 */
+#define NP8_16N 10
+static const long double P8_16N[NP8_16N + 1] = {
+ -2.335166846111159458466553806683579003632E-15L,
+ -1.382763674252402720401020004169367089975E-12L,
+ -3.192160804534716696058987967592784857907E-10L,
+ -3.744199606283752333686144670572632116899E-8L,
+ -2.439161236879511162078619292571922772224E-6L,
+ -9.068436986859420951664151060267045346549E-5L,
+ -1.905407090637058116299757292660002697359E-3L,
+ -2.164456143936718388053842376884252978872E-2L,
+ -1.212178415116411222341491717748696499966E-1L,
+ -2.782433626588541494473277445959593334494E-1L,
+ -1.670703190068873186016102289227646035035E-1L,
+};
+#define NP8_16D 10
+static const long double P8_16D[NP8_16D + 1] = {
+ 3.321126181135871232648331450082662856743E-14L,
+ 1.971894594837650840586859228510007703641E-11L,
+ 4.571144364787008285981633719513897281690E-9L,
+ 5.396419143536287457142904742849052402103E-7L,
+ 3.551548222385845912370226756036899901549E-5L,
+ 1.342353874566932014705609788054598013516E-3L,
+ 2.899133293006771317589357444614157734385E-2L,
+ 3.455374978185770197704507681491574261545E-1L,
+ 2.116616964297512311314454834712634820514E0L,
+ 5.850768316827915470087758636881584174432E0L,
+ 5.655273858938766830855753983631132928968E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ 0.125 <= 1/x <= 0.1875
+ Peak relative error 2.7e-35 */
+#define NP5_8N 10
+static const long double P5_8N[NP5_8N + 1] = {
+ -1.270478335089770355749591358934012019596E-12L,
+ -4.007588712145412921057254992155810347245E-10L,
+ -4.815187822989597568124520080486652009281E-8L,
+ -2.867070063972764880024598300408284868021E-6L,
+ -9.218742195161302204046454768106063638006E-5L,
+ -1.635746821447052827526320629828043529997E-3L,
+ -1.570376886640308408247709616497261011707E-2L,
+ -7.656484795303305596941813361786219477807E-2L,
+ -1.659371030767513274944805479908858628053E-1L,
+ -1.185340550030955660015841796219919804915E-1L,
+ -8.920026499909994671248893388013790366712E-3L,
+};
+#define NP5_8D 9
+static const long double P5_8D[NP5_8D + 1] = {
+ 1.806902521016705225778045904631543990314E-11L,
+ 5.728502760243502431663549179135868966031E-9L,
+ 6.938168504826004255287618819550667978450E-7L,
+ 4.183769964807453250763325026573037785902E-5L,
+ 1.372660678476925468014882230851637878587E-3L,
+ 2.516452105242920335873286419212708961771E-2L,
+ 2.550502712902647803796267951846557316182E-1L,
+ 1.365861559418983216913629123778747617072E0L,
+ 3.523825618308783966723472468855042541407E0L,
+ 3.656365803506136165615111349150536282434E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 3.5e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NP4_5N 9
+static const long double P4_5N[NP4_5N + 1] = {
+ -9.791405771694098960254468859195175708252E-10L,
+ -1.917193059944531970421626610188102836352E-7L,
+ -1.393597539508855262243816152893982002084E-5L,
+ -4.881863490846771259880606911667479860077E-4L,
+ -8.946571245022470127331892085881699269853E-3L,
+ -8.707474232568097513415336886103899434251E-2L,
+ -4.362042697474650737898551272505525973766E-1L,
+ -1.032712171267523975431451359962375617386E0L,
+ -9.630502683169895107062182070514713702346E-1L,
+ -2.251804386252969656586810309252357233320E-1L,
+};
+#define NP4_5D 9
+static const long double P4_5D[NP4_5D + 1] = {
+ 1.392555487577717669739688337895791213139E-8L,
+ 2.748886559120659027172816051276451376854E-6L,
+ 2.024717710644378047477189849678576659290E-4L,
+ 7.244868609350416002930624752604670292469E-3L,
+ 1.373631762292244371102989739300382152416E-1L,
+ 1.412298581400224267910294815260613240668E0L,
+ 7.742495637843445079276397723849017617210E0L,
+ 2.138429269198406512028307045259503811861E1L,
+ 2.651547684548423476506826951831712762610E1L,
+ 1.167499382465291931571685222882909166935E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 2.3e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NP3r2_4N 9
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+ -2.589155123706348361249809342508270121788E-8L,
+ -3.746254369796115441118148490849195516593E-6L,
+ -1.985595497390808544622893738135529701062E-4L,
+ -5.008253705202932091290132760394976551426E-3L,
+ -6.529469780539591572179155511840853077232E-2L,
+ -4.468736064761814602927408833818990271514E-1L,
+ -1.556391252586395038089729428444444823380E0L,
+ -2.533135309840530224072920725976994981638E0L,
+ -1.605509621731068453869408718565392869560E0L,
+ -2.518966692256192789269859830255724429375E-1L,
+};
+#define NP3r2_4D 9
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+ 3.682353957237979993646169732962573930237E-7L,
+ 5.386741661883067824698973455566332102029E-5L,
+ 2.906881154171822780345134853794241037053E-3L,
+ 7.545832595801289519475806339863492074126E-2L,
+ 1.029405357245594877344360389469584526654E0L,
+ 7.565706120589873131187989560509757626725E0L,
+ 2.951172890699569545357692207898667665796E1L,
+ 5.785723537170311456298467310529815457536E1L,
+ 5.095621464598267889126015412522773474467E1L,
+ 1.602958484169953109437547474953308401442E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.0e-35
+ 0.3125 <= 1/x <= 0.375 */
+#define NP2r7_3r2N 9
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+ -1.917322340814391131073820537027234322550E-7L,
+ -1.966595744473227183846019639723259011906E-5L,
+ -7.177081163619679403212623526632690465290E-4L,
+ -1.206467373860974695661544653741899755695E-2L,
+ -1.008656452188539812154551482286328107316E-1L,
+ -4.216016116408810856620947307438823892707E-1L,
+ -8.378631013025721741744285026537009814161E-1L,
+ -6.973895635309960850033762745957946272579E-1L,
+ -1.797864718878320770670740413285763554812E-1L,
+ -4.098025357743657347681137871388402849581E-3L,
+};
+#define NP2r7_3r2D 8
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+ 2.726858489303036441686496086962545034018E-6L,
+ 2.840430827557109238386808968234848081424E-4L,
+ 1.063826772041781947891481054529454088832E-2L,
+ 1.864775537138364773178044431045514405468E-1L,
+ 1.665660052857205170440952607701728254211E0L,
+ 7.723745889544331153080842168958348568395E0L,
+ 1.810726427571829798856428548102077799835E1L,
+ 1.986460672157794440666187503833545388527E1L,
+ 8.645503204552282306364296517220055815488E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.3e-36
+ 0.3125 <= 1/x <= 0.4375 */
+#define NP2r3_2r7N 9
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+ -1.594642785584856746358609622003310312622E-6L,
+ -1.323238196302221554194031733595194539794E-4L,
+ -3.856087818696874802689922536987100372345E-3L,
+ -5.113241710697777193011470733601522047399E-2L,
+ -3.334229537209911914449990372942022350558E-1L,
+ -1.075703518198127096179198549659283422832E0L,
+ -1.634174803414062725476343124267110981807E0L,
+ -1.030133247434119595616826842367268304880E0L,
+ -1.989811539080358501229347481000707289391E-1L,
+ -3.246859189246653459359775001466924610236E-3L,
+};
+#define NP2r3_2r7D 8
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+ 2.267936634217251403663034189684284173018E-5L,
+ 1.918112982168673386858072491437971732237E-3L,
+ 5.771704085468423159125856786653868219522E-2L,
+ 8.056124451167969333717642810661498890507E-1L,
+ 5.687897967531010276788680634413789328776E0L,
+ 2.072596760717695491085444438270778394421E1L,
+ 3.801722099819929988585197088613160496684E1L,
+ 3.254620235902912339534998592085115836829E1L,
+ 1.104847772130720331801884344645060675036E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+ Peak relative error 1.2e-35
+ 0.4375 <= 1/x <= 0.5 */
+#define NP2_2r3N 8
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+ -1.001042324337684297465071506097365389123E-4L,
+ -6.289034524673365824853547252689991418981E-3L,
+ -1.346527918018624234373664526930736205806E-1L,
+ -1.268808313614288355444506172560463315102E0L,
+ -5.654126123607146048354132115649177406163E0L,
+ -1.186649511267312652171775803270911971693E1L,
+ -1.094032424931998612551588246779200724257E1L,
+ -3.728792136814520055025256353193674625267E0L,
+ -3.000348318524471807839934764596331810608E-1L,
+};
+#define NP2_2r3D 8
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+ 1.423705538269770974803901422532055612980E-3L,
+ 9.171476630091439978533535167485230575894E-2L,
+ 2.049776318166637248868444600215942828537E0L,
+ 2.068970329743769804547326701946144899583E1L,
+ 1.025103500560831035592731539565060347709E2L,
+ 2.528088049697570728252145557167066708284E2L,
+ 2.992160327587558573740271294804830114205E2L,
+ 1.540193761146551025832707739468679973036E2L,
+ 2.779516701986912132637672140709452502650E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 2.2e-35
+ 0 <= 1/x <= .0625 */
+#define NQ16_IN 10
+static const long double Q16_IN[NQ16_IN + 1] = {
+ 2.343640834407975740545326632205999437469E-18L,
+ 2.667978112927811452221176781536278257448E-15L,
+ 1.178415018484555397390098879501969116536E-12L,
+ 2.622049767502719728905924701288614016597E-10L,
+ 3.196908059607618864801313380896308968673E-8L,
+ 2.179466154171673958770030655199434798494E-6L,
+ 8.139959091628545225221976413795645177291E-5L,
+ 1.563900725721039825236927137885747138654E-3L,
+ 1.355172364265825167113562519307194840307E-2L,
+ 3.928058355906967977269780046844768588532E-2L,
+ 1.107891967702173292405380993183694932208E-2L,
+};
+#define NQ16_ID 9
+static const long double Q16_ID[NQ16_ID + 1] = {
+ 3.199850952578356211091219295199301766718E-17L,
+ 3.652601488020654842194486058637953363918E-14L,
+ 1.620179741394865258354608590461839031281E-11L,
+ 3.629359209474609630056463248923684371426E-9L,
+ 4.473680923894354600193264347733477363305E-7L,
+ 3.106368086644715743265603656011050476736E-5L,
+ 1.198239259946770604954664925153424252622E-3L,
+ 2.446041004004283102372887804475767568272E-2L,
+ 2.403235525011860603014707768815113698768E-1L,
+ 9.491006790682158612266270665136910927149E-1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 5.1e-36
+ 0.0625 <= 1/x <= 0.125 */
+#define NQ8_16N 11
+static const long double Q8_16N[NQ8_16N + 1] = {
+ 1.001954266485599464105669390693597125904E-17L,
+ 7.545499865295034556206475956620160007849E-15L,
+ 2.267838684785673931024792538193202559922E-12L,
+ 3.561909705814420373609574999542459912419E-10L,
+ 3.216201422768092505214730633842924944671E-8L,
+ 1.731194793857907454569364622452058554314E-6L,
+ 5.576944613034537050396518509871004586039E-5L,
+ 1.051787760316848982655967052985391418146E-3L,
+ 1.102852974036687441600678598019883746959E-2L,
+ 5.834647019292460494254225988766702933571E-2L,
+ 1.290281921604364618912425380717127576529E-1L,
+ 7.598886310387075708640370806458926458301E-2L,
+};
+#define NQ8_16D 11
+static const long double Q8_16D[NQ8_16D + 1] = {
+ 1.368001558508338469503329967729951830843E-16L,
+ 1.034454121857542147020549303317348297289E-13L,
+ 3.128109209247090744354764050629381674436E-11L,
+ 4.957795214328501986562102573522064468671E-9L,
+ 4.537872468606711261992676606899273588899E-7L,
+ 2.493639207101727713192687060517509774182E-5L,
+ 8.294957278145328349785532236663051405805E-4L,
+ 1.646471258966713577374948205279380115839E-2L,
+ 1.878910092770966718491814497982191447073E-1L,
+ 1.152641605706170353727903052525652504075E0L,
+ 3.383550240669773485412333679367792932235E0L,
+ 3.823875252882035706910024716609908473970E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.9e-35
+ 0.125 <= 1/x <= 0.1875 */
+#define NQ5_8N 10
+static const long double Q5_8N[NQ5_8N + 1] = {
+ 1.750399094021293722243426623211733898747E-13L,
+ 6.483426211748008735242909236490115050294E-11L,
+ 9.279430665656575457141747875716899958373E-9L,
+ 6.696634968526907231258534757736576340266E-7L,
+ 2.666560823798895649685231292142838188061E-5L,
+ 6.025087697259436271271562769707550594540E-4L,
+ 7.652807734168613251901945778921336353485E-3L,
+ 5.226269002589406461622551452343519078905E-2L,
+ 1.748390159751117658969324896330142895079E-1L,
+ 2.378188719097006494782174902213083589660E-1L,
+ 8.383984859679804095463699702165659216831E-2L,
+};
+#define NQ5_8D 10
+static const long double Q5_8D[NQ5_8D + 1] = {
+ 2.389878229704327939008104855942987615715E-12L,
+ 8.926142817142546018703814194987786425099E-10L,
+ 1.294065862406745901206588525833274399038E-7L,
+ 9.524139899457666250828752185212769682191E-6L,
+ 3.908332488377770886091936221573123353489E-4L,
+ 9.250427033957236609624199884089916836748E-3L,
+ 1.263420066165922645975830877751588421451E-1L,
+ 9.692527053860420229711317379861733180654E-1L,
+ 3.937813834630430172221329298841520707954E0L,
+ 7.603126427436356534498908111445191312181E0L,
+ 5.670677653334105479259958485084550934305E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.2e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NQ4_5N 10
+static const long double Q4_5N[NQ4_5N + 1] = {
+ 2.233870042925895644234072357400122854086E-11L,
+ 5.146223225761993222808463878999151699792E-9L,
+ 4.459114531468296461688753521109797474523E-7L,
+ 1.891397692931537975547242165291668056276E-5L,
+ 4.279519145911541776938964806470674565504E-4L,
+ 5.275239415656560634702073291768904783989E-3L,
+ 3.468698403240744801278238473898432608887E-2L,
+ 1.138773146337708415188856882915457888274E-1L,
+ 1.622717518946443013587108598334636458955E-1L,
+ 7.249040006390586123760992346453034628227E-2L,
+ 1.941595365256460232175236758506411486667E-3L,
+};
+#define NQ4_5D 9
+static const long double Q4_5D[NQ4_5D + 1] = {
+ 3.049977232266999249626430127217988047453E-10L,
+ 7.120883230531035857746096928889676144099E-8L,
+ 6.301786064753734446784637919554359588859E-6L,
+ 2.762010530095069598480766869426308077192E-4L,
+ 6.572163250572867859316828886203406361251E-3L,
+ 8.752566114841221958200215255461843397776E-2L,
+ 6.487654992874805093499285311075289932664E-1L,
+ 2.576550017826654579451615283022812801435E0L,
+ 5.056392229924022835364779562707348096036E0L,
+ 4.179770081068251464907531367859072157773E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 1.4e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NQ3r2_4N 10
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+ 6.126167301024815034423262653066023684411E-10L,
+ 1.043969327113173261820028225053598975128E-7L,
+ 6.592927270288697027757438170153763220190E-6L,
+ 2.009103660938497963095652951912071336730E-4L,
+ 3.220543385492643525985862356352195896964E-3L,
+ 2.774405975730545157543417650436941650990E-2L,
+ 1.258114008023826384487378016636555041129E-1L,
+ 2.811724258266902502344701449984698323860E-1L,
+ 2.691837665193548059322831687432415014067E-1L,
+ 7.949087384900985370683770525312735605034E-2L,
+ 1.229509543620976530030153018986910810747E-3L,
+};
+#define NQ3r2_4D 9
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+ 8.364260446128475461539941389210166156568E-9L,
+ 1.451301850638956578622154585560759862764E-6L,
+ 9.431830010924603664244578867057141839463E-5L,
+ 3.004105101667433434196388593004526182741E-3L,
+ 5.148157397848271739710011717102773780221E-2L,
+ 4.901089301726939576055285374953887874895E-1L,
+ 2.581760991981709901216967665934142240346E0L,
+ 7.257105880775059281391729708630912791847E0L,
+ 1.006014717326362868007913423810737369312E1L,
+ 5.879416600465399514404064187445293212470E0L,
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.8e-36
+ 0.3125 <= 1/x <= 0.375 */
+#define NQ2r7_3r2N 9
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ 7.584861620402450302063691901886141875454E-8L,
+ 9.300939338814216296064659459966041794591E-6L,
+ 4.112108906197521696032158235392604947895E-4L,
+ 8.515168851578898791897038357239630654431E-3L,
+ 8.971286321017307400142720556749573229058E-2L,
+ 4.885856732902956303343015636331874194498E-1L,
+ 1.334506268733103291656253500506406045846E0L,
+ 1.681207956863028164179042145803851824654E0L,
+ 8.165042692571721959157677701625853772271E-1L,
+ 9.805848115375053300608712721986235900715E-2L,
+};
+#define NQ2r7_3r2D 9
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ 1.035586492113036586458163971239438078160E-6L,
+ 1.301999337731768381683593636500979713689E-4L,
+ 5.993695702564527062553071126719088859654E-3L,
+ 1.321184892887881883489141186815457808785E-1L,
+ 1.528766555485015021144963194165165083312E0L,
+ 9.561463309176490874525827051566494939295E0L,
+ 3.203719484883967351729513662089163356911E1L,
+ 5.497294687660930446641539152123568668447E1L,
+ 4.391158169390578768508675452986948391118E1L,
+ 1.347836630730048077907818943625789418378E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 2.2e-35
+ 0.375 <= 1/x <= 0.4375 */
+#define NQ2r3_2r7N 9
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ 4.455027774980750211349941766420190722088E-7L,
+ 4.031998274578520170631601850866780366466E-5L,
+ 1.273987274325947007856695677491340636339E-3L,
+ 1.818754543377448509897226554179659122873E-2L,
+ 1.266748858326568264126353051352269875352E-1L,
+ 4.327578594728723821137731555139472880414E-1L,
+ 6.892532471436503074928194969154192615359E-1L,
+ 4.490775818438716873422163588640262036506E-1L,
+ 8.649615949297322440032000346117031581572E-2L,
+ 7.261345286655345047417257611469066147561E-4L,
+};
+#define NQ2r3_2r7D 8
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ 6.082600739680555266312417978064954793142E-6L,
+ 5.693622538165494742945717226571441747567E-4L,
+ 1.901625907009092204458328768129666975975E-2L,
+ 2.958689532697857335456896889409923371570E-1L,
+ 2.343124711045660081603809437993368799568E0L,
+ 9.665894032187458293568704885528192804376E0L,
+ 2.035273104990617136065743426322454881353E1L,
+ 2.044102010478792896815088858740075165531E1L,
+ 8.445937177863155827844146643468706599304E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+ Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+ Peak relative error 3.1e-36
+ 0.4375 <= 1/x <= 0.5 */
+#define NQ2_2r3N 9
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+ 2.817566786579768804844367382809101929314E-6L,
+ 2.122772176396691634147024348373539744935E-4L,
+ 5.501378031780457828919593905395747517585E-3L,
+ 6.355374424341762686099147452020466524659E-2L,
+ 3.539652320122661637429658698954748337223E-1L,
+ 9.571721066119617436343740541777014319695E-1L,
+ 1.196258777828426399432550698612171955305E0L,
+ 6.069388659458926158392384709893753793967E-1L,
+ 9.026746127269713176512359976978248763621E-2L,
+ 5.317668723070450235320878117210807236375E-4L,
+};
+#define NQ2_2r3D 8
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+ 3.846924354014260866793741072933159380158E-5L,
+ 3.017562820057704325510067178327449946763E-3L,
+ 8.356305620686867949798885808540444210935E-2L,
+ 1.068314930499906838814019619594424586273E0L,
+ 6.900279623894821067017966573640732685233E0L,
+ 2.307667390886377924509090271780839563141E1L,
+ 3.921043465412723970791036825401273528513E1L,
+ 3.167569478939719383241775717095729233436E1L,
+ 1.051023841699200920276198346301543665909E1L,
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order zero. */
+
+long double
+__ieee754_j0l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return 1;
+
+ xx = fabsl (x);
+ if (xx <= 2)
+ {
+ if (xx < 0x1p-57L)
+ return 1;
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+ p -= 0.25L * z;
+ p += 1;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (xx + xx);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * cc / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_j0l, __j0l_finite)
+
+
+/* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2)
+ Peak absolute error 1.7e-36 (relative where Y0 > 1)
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -1.062023609591350692692296993537002558155E19L,
+ 2.542000883190248639104127452714966858866E19L,
+ -1.984190771278515324281415820316054696545E18L,
+ 4.982586044371592942465373274440222033891E16L,
+ -5.529326354780295177243773419090123407550E14L,
+ 3.013431465522152289279088265336861140391E12L,
+ -7.959436160727126750732203098982718347785E9L,
+ 8.230845651379566339707130644134372793322E6L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 1.438972634353286978700329883122253752192E20L,
+ 1.856409101981569254247700169486907405500E18L,
+ 1.219693352678218589553725579802986255614E16L,
+ 5.389428943282838648918475915779958097958E13L,
+ 1.774125762108874864433872173544743051653E11L,
+ 4.522104832545149534808218252434693007036E8L,
+ 8.872187401232943927082914504125234454930E5L,
+ 1.251945613186787532055610876304669413955E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
+
+/* Bessel function of the second kind, order zero. */
+
+long double
+ __ieee754_y0l(long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-57)
+ return U0 + TWOOPI * __ieee754_logl (x);
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j0l (x) + p;
+ return p;
+ }
+
+ /* X = x - pi/4
+ cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+ = 1/sqrt(2) * (cos(x) + sin(x))
+ sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+ = 1/sqrt(2) * (sin(x) - cos(x))
+ sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+ cf. Fdlibm. */
+ __sincosl (x, &s, &c);
+ ss = s - c;
+ cc = s + c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = -__cosl (x + x);
+ if ((s * c) < 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (x);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * xinv * q;
+ q = q - 0.125L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x);
+ return z;
+}
+strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index c86e24f7c0..5126900f96 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -1,2 +1,885 @@
-/* Looks like we can use ieee854 e_j1l.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_j1l.c>
+/* Bessel function of order one. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier (moshier@na-net.onrl.gov).
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
+#include <errno.h>
+#include <math.h>
+#include <math_private.h>
+#include <math-underflow.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
+/* 2 / pi */
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
+
+/* J1(x) = .5x + x x^2 R(x^2)
+ Peak relative error 1.9e-35
+ 0 <= x <= 2 */
+#define NJ0_2N 6
+static const long double J0_2N[NJ0_2N + 1] = {
+ -5.943799577386942855938508697619735179660E16L,
+ 1.812087021305009192259946997014044074711E15L,
+ -2.761698314264509665075127515729146460895E13L,
+ 2.091089497823600978949389109350658815972E11L,
+ -8.546413231387036372945453565654130054307E8L,
+ 1.797229225249742247475464052741320612261E6L,
+ -1.559552840946694171346552770008812083969E3L
+};
+#define NJ0_2D 6
+static const long double J0_2D[NJ0_2D + 1] = {
+ 9.510079323819108569501613916191477479397E17L,
+ 1.063193817503280529676423936545854693915E16L,
+ 5.934143516050192600795972192791775226920E13L,
+ 2.168000911950620999091479265214368352883E11L,
+ 5.673775894803172808323058205986256928794E8L,
+ 1.080329960080981204840966206372671147224E6L,
+ 1.411951256636576283942477881535283304912E3L,
+ /* 1.000000000000000000000000000000000000000E0L */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0 <= 1/x <= .0625
+ Peak relative error 3.6e-36 */
+#define NP16_IN 9
+static const long double P16_IN[NP16_IN + 1] = {
+ 5.143674369359646114999545149085139822905E-16L,
+ 4.836645664124562546056389268546233577376E-13L,
+ 1.730945562285804805325011561498453013673E-10L,
+ 3.047976856147077889834905908605310585810E-8L,
+ 2.855227609107969710407464739188141162386E-6L,
+ 1.439362407936705484122143713643023998457E-4L,
+ 3.774489768532936551500999699815873422073E-3L,
+ 4.723962172984642566142399678920790598426E-2L,
+ 2.359289678988743939925017240478818248735E-1L,
+ 3.032580002220628812728954785118117124520E-1L,
+};
+#define NP16_ID 9
+static const long double P16_ID[NP16_ID + 1] = {
+ 4.389268795186898018132945193912677177553E-15L,
+ 4.132671824807454334388868363256830961655E-12L,
+ 1.482133328179508835835963635130894413136E-9L,
+ 2.618941412861122118906353737117067376236E-7L,
+ 2.467854246740858470815714426201888034270E-5L,
+ 1.257192927368839847825938545925340230490E-3L,
+ 3.362739031941574274949719324644120720341E-2L,
+ 4.384458231338934105875343439265370178858E-1L,
+ 2.412830809841095249170909628197264854651E0L,
+ 4.176078204111348059102962617368214856874E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0.0625 <= 1/x <= 0.125
+ Peak relative error 1.9e-36 */
+#define NP8_16N 11
+static const long double P8_16N[NP8_16N + 1] = {
+ 2.984612480763362345647303274082071598135E-16L,
+ 1.923651877544126103941232173085475682334E-13L,
+ 4.881258879388869396043760693256024307743E-11L,
+ 6.368866572475045408480898921866869811889E-9L,
+ 4.684818344104910450523906967821090796737E-7L,
+ 2.005177298271593587095982211091300382796E-5L,
+ 4.979808067163957634120681477207147536182E-4L,
+ 6.946005761642579085284689047091173581127E-3L,
+ 5.074601112955765012750207555985299026204E-2L,
+ 1.698599455896180893191766195194231825379E-1L,
+ 1.957536905259237627737222775573623779638E-1L,
+ 2.991314703282528370270179989044994319374E-2L,
+};
+#define NP8_16D 10
+static const long double P8_16D[NP8_16D + 1] = {
+ 2.546869316918069202079580939942463010937E-15L,
+ 1.644650111942455804019788382157745229955E-12L,
+ 4.185430770291694079925607420808011147173E-10L,
+ 5.485331966975218025368698195861074143153E-8L,
+ 4.062884421686912042335466327098932678905E-6L,
+ 1.758139661060905948870523641319556816772E-4L,
+ 4.445143889306356207566032244985607493096E-3L,
+ 6.391901016293512632765621532571159071158E-2L,
+ 4.933040207519900471177016015718145795434E-1L,
+ 1.839144086168947712971630337250761842976E0L,
+ 2.715120873995490920415616716916149586579E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ 0.125 <= 1/x <= 0.1875
+ Peak relative error 1.3e-36 */
+#define NP5_8N 10
+static const long double P5_8N[NP5_8N + 1] = {
+ 2.837678373978003452653763806968237227234E-12L,
+ 9.726641165590364928442128579282742354806E-10L,
+ 1.284408003604131382028112171490633956539E-7L,
+ 8.524624695868291291250573339272194285008E-6L,
+ 3.111516908953172249853673787748841282846E-4L,
+ 6.423175156126364104172801983096596409176E-3L,
+ 7.430220589989104581004416356260692450652E-2L,
+ 4.608315409833682489016656279567605536619E-1L,
+ 1.396870223510964882676225042258855977512E0L,
+ 1.718500293904122365894630460672081526236E0L,
+ 5.465927698800862172307352821870223855365E-1L
+};
+#define NP5_8D 10
+static const long double P5_8D[NP5_8D + 1] = {
+ 2.421485545794616609951168511612060482715E-11L,
+ 8.329862750896452929030058039752327232310E-9L,
+ 1.106137992233383429630592081375289010720E-6L,
+ 7.405786153760681090127497796448503306939E-5L,
+ 2.740364785433195322492093333127633465227E-3L,
+ 5.781246470403095224872243564165254652198E-2L,
+ 6.927711353039742469918754111511109983546E-1L,
+ 4.558679283460430281188304515922826156690E0L,
+ 1.534468499844879487013168065728837900009E1L,
+ 2.313927430889218597919624843161569422745E1L,
+ 1.194506341319498844336768473218382828637E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.4e-36
+ 0.1875 <= 1/x <= 0.25 */
+#define NP4_5N 10
+static const long double P4_5N[NP4_5N + 1] = {
+ 1.846029078268368685834261260420933914621E-10L,
+ 3.916295939611376119377869680335444207768E-8L,
+ 3.122158792018920627984597530935323997312E-6L,
+ 1.218073444893078303994045653603392272450E-4L,
+ 2.536420827983485448140477159977981844883E-3L,
+ 2.883011322006690823959367922241169171315E-2L,
+ 1.755255190734902907438042414495469810830E-1L,
+ 5.379317079922628599870898285488723736599E-1L,
+ 7.284904050194300773890303361501726561938E-1L,
+ 3.270110346613085348094396323925000362813E-1L,
+ 1.804473805689725610052078464951722064757E-2L,
+};
+#define NP4_5D 9
+static const long double P4_5D[NP4_5D + 1] = {
+ 1.575278146806816970152174364308980863569E-9L,
+ 3.361289173657099516191331123405675054321E-7L,
+ 2.704692281550877810424745289838790693708E-5L,
+ 1.070854930483999749316546199273521063543E-3L,
+ 2.282373093495295842598097265627962125411E-2L,
+ 2.692025460665354148328762368240343249830E-1L,
+ 1.739892942593664447220951225734811133759E0L,
+ 5.890727576752230385342377570386657229324E0L,
+ 9.517442287057841500750256954117735128153E0L,
+ 6.100616353935338240775363403030137736013E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 3.0e-36
+ 0.25 <= 1/x <= 0.3125 */
+#define NP3r2_4N 9
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+ 8.240803130988044478595580300846665863782E-8L,
+ 1.179418958381961224222969866406483744580E-5L,
+ 6.179787320956386624336959112503824397755E-4L,
+ 1.540270833608687596420595830747166658383E-2L,
+ 1.983904219491512618376375619598837355076E-1L,
+ 1.341465722692038870390470651608301155565E0L,
+ 4.617865326696612898792238245990854646057E0L,
+ 7.435574801812346424460233180412308000587E0L,
+ 4.671327027414635292514599201278557680420E0L,
+ 7.299530852495776936690976966995187714739E-1L,
+};
+#define NP3r2_4D 9
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+ 7.032152009675729604487575753279187576521E-7L,
+ 1.015090352324577615777511269928856742848E-4L,
+ 5.394262184808448484302067955186308730620E-3L,
+ 1.375291438480256110455809354836988584325E-1L,
+ 1.836247144461106304788160919310404376670E0L,
+ 1.314378564254376655001094503090935880349E1L,
+ 4.957184590465712006934452500894672343488E1L,
+ 9.287394244300647738855415178790263465398E1L,
+ 7.652563275535900609085229286020552768399E1L,
+ 2.147042473003074533150718117770093209096E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.0e-35
+ 0.3125 <= 1/x <= 0.375 */
+#define NP2r7_3r2N 9
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+ 4.599033469240421554219816935160627085991E-7L,
+ 4.665724440345003914596647144630893997284E-5L,
+ 1.684348845667764271596142716944374892756E-3L,
+ 2.802446446884455707845985913454440176223E-2L,
+ 2.321937586453963310008279956042545173930E-1L,
+ 9.640277413988055668692438709376437553804E-1L,
+ 1.911021064710270904508663334033003246028E0L,
+ 1.600811610164341450262992138893970224971E0L,
+ 4.266299218652587901171386591543457861138E-1L,
+ 1.316470424456061252962568223251247207325E-2L,
+};
+#define NP2r7_3r2D 8
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+ 3.924508608545520758883457108453520099610E-6L,
+ 4.029707889408829273226495756222078039823E-4L,
+ 1.484629715787703260797886463307469600219E-2L,
+ 2.553136379967180865331706538897231588685E-1L,
+ 2.229457223891676394409880026887106228740E0L,
+ 1.005708903856384091956550845198392117318E1L,
+ 2.277082659664386953166629360352385889558E1L,
+ 2.384726835193630788249826630376533988245E1L,
+ 9.700989749041320895890113781610939632410E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.7e-36
+ 0.3125 <= 1/x <= 0.4375 */
+#define NP2r3_2r7N 9
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+ 3.916766777108274628543759603786857387402E-6L,
+ 3.212176636756546217390661984304645137013E-4L,
+ 9.255768488524816445220126081207248947118E-3L,
+ 1.214853146369078277453080641911700735354E-1L,
+ 7.855163309847214136198449861311404633665E-1L,
+ 2.520058073282978403655488662066019816540E0L,
+ 3.825136484837545257209234285382183711466E0L,
+ 2.432569427554248006229715163865569506873E0L,
+ 4.877934835018231178495030117729800489743E-1L,
+ 1.109902737860249670981355149101343427885E-2L,
+};
+#define NP2r3_2r7D 8
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+ 3.342307880794065640312646341190547184461E-5L,
+ 2.782182891138893201544978009012096558265E-3L,
+ 8.221304931614200702142049236141249929207E-2L,
+ 1.123728246291165812392918571987858010949E0L,
+ 7.740482453652715577233858317133423434590E0L,
+ 2.737624677567945952953322566311201919139E1L,
+ 4.837181477096062403118304137851260715475E1L,
+ 3.941098643468580791437772701093795299274E1L,
+ 1.245821247166544627558323920382547533630E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+ Peak relative error 1.7e-35
+ 0.4375 <= 1/x <= 0.5 */
+#define NP2_2r3N 8
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+ 3.397930802851248553545191160608731940751E-4L,
+ 2.104020902735482418784312825637833698217E-2L,
+ 4.442291771608095963935342749477836181939E-1L,
+ 4.131797328716583282869183304291833754967E0L,
+ 1.819920169779026500146134832455189917589E1L,
+ 3.781779616522937565300309684282401791291E1L,
+ 3.459605449728864218972931220783543410347E1L,
+ 1.173594248397603882049066603238568316561E1L,
+ 9.455702270242780642835086549285560316461E-1L,
+};
+#define NP2_2r3D 8
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+ 2.899568897241432883079888249845707400614E-3L,
+ 1.831107138190848460767699919531132426356E-1L,
+ 3.999350044057883839080258832758908825165E0L,
+ 3.929041535867957938340569419874195303712E1L,
+ 1.884245613422523323068802689915538908291E2L,
+ 4.461469948819229734353852978424629815929E2L,
+ 5.004998753999796821224085972610636347903E2L,
+ 2.386342520092608513170837883757163414100E2L,
+ 3.791322528149347975999851588922424189957E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 8.0e-36
+ 0 <= 1/x <= .0625 */
+#define NQ16_IN 10
+static const long double Q16_IN[NQ16_IN + 1] = {
+ -3.917420835712508001321875734030357393421E-18L,
+ -4.440311387483014485304387406538069930457E-15L,
+ -1.951635424076926487780929645954007139616E-12L,
+ -4.318256438421012555040546775651612810513E-10L,
+ -5.231244131926180765270446557146989238020E-8L,
+ -3.540072702902043752460711989234732357653E-6L,
+ -1.311017536555269966928228052917534882984E-4L,
+ -2.495184669674631806622008769674827575088E-3L,
+ -2.141868222987209028118086708697998506716E-2L,
+ -6.184031415202148901863605871197272650090E-2L,
+ -1.922298704033332356899546792898156493887E-2L,
+};
+#define NQ16_ID 9
+static const long double Q16_ID[NQ16_ID + 1] = {
+ 3.820418034066293517479619763498400162314E-17L,
+ 4.340702810799239909648911373329149354911E-14L,
+ 1.914985356383416140706179933075303538524E-11L,
+ 4.262333682610888819476498617261895474330E-9L,
+ 5.213481314722233980346462747902942182792E-7L,
+ 3.585741697694069399299005316809954590558E-5L,
+ 1.366513429642842006385029778105539457546E-3L,
+ 2.745282599850704662726337474371355160594E-2L,
+ 2.637644521611867647651200098449903330074E-1L,
+ 1.006953426110765984590782655598680488746E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.9e-36
+ 0.0625 <= 1/x <= 0.125 */
+#define NQ8_16N 11
+static const long double Q8_16N[NQ8_16N + 1] = {
+ -2.028630366670228670781362543615221542291E-17L,
+ -1.519634620380959966438130374006858864624E-14L,
+ -4.540596528116104986388796594639405114524E-12L,
+ -7.085151756671466559280490913558388648274E-10L,
+ -6.351062671323970823761883833531546885452E-8L,
+ -3.390817171111032905297982523519503522491E-6L,
+ -1.082340897018886970282138836861233213972E-4L,
+ -2.020120801187226444822977006648252379508E-3L,
+ -2.093169910981725694937457070649605557555E-2L,
+ -1.092176538874275712359269481414448063393E-1L,
+ -2.374790947854765809203590474789108718733E-1L,
+ -1.365364204556573800719985118029601401323E-1L,
+};
+#define NQ8_16D 11
+static const long double Q8_16D[NQ8_16D + 1] = {
+ 1.978397614733632533581207058069628242280E-16L,
+ 1.487361156806202736877009608336766720560E-13L,
+ 4.468041406888412086042576067133365913456E-11L,
+ 7.027822074821007443672290507210594648877E-9L,
+ 6.375740580686101224127290062867976007374E-7L,
+ 3.466887658320002225888644977076410421940E-5L,
+ 1.138625640905289601186353909213719596986E-3L,
+ 2.224470799470414663443449818235008486439E-2L,
+ 2.487052928527244907490589787691478482358E-1L,
+ 1.483927406564349124649083853892380899217E0L,
+ 4.182773513276056975777258788903489507705E0L,
+ 4.419665392573449746043880892524360870944E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.5e-35
+ 0.125 <= 1/x <= 0.1875 */
+#define NQ5_8N 10
+static const long double Q5_8N[NQ5_8N + 1] = {
+ -3.656082407740970534915918390488336879763E-13L,
+ -1.344660308497244804752334556734121771023E-10L,
+ -1.909765035234071738548629788698150760791E-8L,
+ -1.366668038160120210269389551283666716453E-6L,
+ -5.392327355984269366895210704976314135683E-5L,
+ -1.206268245713024564674432357634540343884E-3L,
+ -1.515456784370354374066417703736088291287E-2L,
+ -1.022454301137286306933217746545237098518E-1L,
+ -3.373438906472495080504907858424251082240E-1L,
+ -4.510782522110845697262323973549178453405E-1L,
+ -1.549000892545288676809660828213589804884E-1L,
+};
+#define NQ5_8D 10
+static const long double Q5_8D[NQ5_8D + 1] = {
+ 3.565550843359501079050699598913828460036E-12L,
+ 1.321016015556560621591847454285330528045E-9L,
+ 1.897542728662346479999969679234270605975E-7L,
+ 1.381720283068706710298734234287456219474E-5L,
+ 5.599248147286524662305325795203422873725E-4L,
+ 1.305442352653121436697064782499122164843E-2L,
+ 1.750234079626943298160445750078631894985E-1L,
+ 1.311420542073436520965439883806946678491E0L,
+ 5.162757689856842406744504211089724926650E0L,
+ 9.527760296384704425618556332087850581308E0L,
+ 6.604648207463236667912921642545100248584E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.3e-35
+ 0.1875 <= 1/x <= 0.25 */
+#define NQ4_5N 10
+static const long double Q4_5N[NQ4_5N + 1] = {
+ -4.079513568708891749424783046520200903755E-11L,
+ -9.326548104106791766891812583019664893311E-9L,
+ -8.016795121318423066292906123815687003356E-7L,
+ -3.372350544043594415609295225664186750995E-5L,
+ -7.566238665947967882207277686375417983917E-4L,
+ -9.248861580055565402130441618521591282617E-3L,
+ -6.033106131055851432267702948850231270338E-2L,
+ -1.966908754799996793730369265431584303447E-1L,
+ -2.791062741179964150755788226623462207560E-1L,
+ -1.255478605849190549914610121863534191666E-1L,
+ -4.320429862021265463213168186061696944062E-3L,
+};
+#define NQ4_5D 9
+static const long double Q4_5D[NQ4_5D + 1] = {
+ 3.978497042580921479003851216297330701056E-10L,
+ 9.203304163828145809278568906420772246666E-8L,
+ 8.059685467088175644915010485174545743798E-6L,
+ 3.490187375993956409171098277561669167446E-4L,
+ 8.189109654456872150100501732073810028829E-3L,
+ 1.072572867311023640958725265762483033769E-1L,
+ 7.790606862409960053675717185714576937994E-1L,
+ 3.016049768232011196434185423512777656328E0L,
+ 5.722963851442769787733717162314477949360E0L,
+ 4.510527838428473279647251350931380867663E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 2.1e-35
+ 0.25 <= 1/x <= 0.3125 */
+#define NQ3r2_4N 9
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+ -1.087480809271383885936921889040388133627E-8L,
+ -1.690067828697463740906962973479310170932E-6L,
+ -9.608064416995105532790745641974762550982E-5L,
+ -2.594198839156517191858208513873961837410E-3L,
+ -3.610954144421543968160459863048062977822E-2L,
+ -2.629866798251843212210482269563961685666E-1L,
+ -9.709186825881775885917984975685752956660E-1L,
+ -1.667521829918185121727268867619982417317E0L,
+ -1.109255082925540057138766105229900943501E0L,
+ -1.812932453006641348145049323713469043328E-1L,
+};
+#define NQ3r2_4D 9
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+ 1.060552717496912381388763753841473407026E-7L,
+ 1.676928002024920520786883649102388708024E-5L,
+ 9.803481712245420839301400601140812255737E-4L,
+ 2.765559874262309494758505158089249012930E-2L,
+ 4.117921827792571791298862613287549140706E-1L,
+ 3.323769515244751267093378361930279161413E0L,
+ 1.436602494405814164724810151689705353670E1L,
+ 3.163087869617098638064881410646782408297E1L,
+ 3.198181264977021649489103980298349589419E1L,
+ 1.203649258862068431199471076202897823272E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.6e-36
+ 0.3125 <= 1/x <= 0.375 */
+#define NQ2r7_3r2N 9
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+ -1.723405393982209853244278760171643219530E-7L,
+ -2.090508758514655456365709712333460087442E-5L,
+ -9.140104013370974823232873472192719263019E-4L,
+ -1.871349499990714843332742160292474780128E-2L,
+ -1.948930738119938669637865956162512983416E-1L,
+ -1.048764684978978127908439526343174139788E0L,
+ -2.827714929925679500237476105843643064698E0L,
+ -3.508761569156476114276988181329773987314E0L,
+ -1.669332202790211090973255098624488308989E0L,
+ -1.930796319299022954013840684651016077770E-1L,
+};
+#define NQ2r7_3r2D 9
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+ 1.680730662300831976234547482334347983474E-6L,
+ 2.084241442440551016475972218719621841120E-4L,
+ 9.445316642108367479043541702688736295579E-3L,
+ 2.044637889456631896650179477133252184672E-1L,
+ 2.316091982244297350829522534435350078205E0L,
+ 1.412031891783015085196708811890448488865E1L,
+ 4.583830154673223384837091077279595496149E1L,
+ 7.549520609270909439885998474045974122261E1L,
+ 5.697605832808113367197494052388203310638E1L,
+ 1.601496240876192444526383314589371686234E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 9.5e-36
+ 0.375 <= 1/x <= 0.4375 */
+#define NQ2r3_2r7N 9
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+ -8.603042076329122085722385914954878953775E-7L,
+ -7.701746260451647874214968882605186675720E-5L,
+ -2.407932004380727587382493696877569654271E-3L,
+ -3.403434217607634279028110636919987224188E-2L,
+ -2.348707332185238159192422084985713102877E-1L,
+ -7.957498841538254916147095255700637463207E-1L,
+ -1.258469078442635106431098063707934348577E0L,
+ -8.162415474676345812459353639449971369890E-1L,
+ -1.581783890269379690141513949609572806898E-1L,
+ -1.890595651683552228232308756569450822905E-3L,
+};
+#define NQ2r3_2r7D 8
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+ 8.390017524798316921170710533381568175665E-6L,
+ 7.738148683730826286477254659973968763659E-4L,
+ 2.541480810958665794368759558791634341779E-2L,
+ 3.878879789711276799058486068562386244873E-1L,
+ 3.003783779325811292142957336802456109333E0L,
+ 1.206480374773322029883039064575464497400E1L,
+ 2.458414064785315978408974662900438351782E1L,
+ 2.367237826273668567199042088835448715228E1L,
+ 9.231451197519171090875569102116321676763E0L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+ Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+ Peak relative error 1.4e-36
+ 0.4375 <= 1/x <= 0.5 */
+#define NQ2_2r3N 9
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+ -5.552507516089087822166822364590806076174E-6L,
+ -4.135067659799500521040944087433752970297E-4L,
+ -1.059928728869218962607068840646564457980E-2L,
+ -1.212070036005832342565792241385459023801E-1L,
+ -6.688350110633603958684302153362735625156E-1L,
+ -1.793587878197360221340277951304429821582E0L,
+ -2.225407682237197485644647380483725045326E0L,
+ -1.123402135458940189438898496348239744403E0L,
+ -1.679187241566347077204805190763597299805E-1L,
+ -1.458550613639093752909985189067233504148E-3L,
+};
+#define NQ2_2r3D 8
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+ 5.415024336507980465169023996403597916115E-5L,
+ 4.179246497380453022046357404266022870788E-3L,
+ 1.136306384261959483095442402929502368598E-1L,
+ 1.422640343719842213484515445393284072830E0L,
+ 8.968786703393158374728850922289204805764E0L,
+ 2.914542473339246127533384118781216495934E1L,
+ 4.781605421020380669870197378210457054685E1L,
+ 3.693865837171883152382820584714795072937E1L,
+ 1.153220502744204904763115556224395893076E1L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Bessel function of the first kind, order one. */
+
+long double
+__ieee754_j1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ {
+ if (x != x)
+ return x + x;
+ else
+ return 0;
+ }
+ if (x == 0)
+ return x;
+ xx = fabsl (x);
+ if (xx <= 0x1p-58L)
+ {
+ long double ret = x * 0.5L;
+ math_check_force_underflow (ret);
+ if (ret == 0)
+ __set_errno (ERANGE);
+ return ret;
+ }
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ z = xx * xx;
+ p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+ p += 0.5L * xx;
+ if (x < 0)
+ p = -p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ {
+ z = ONEOSQPI * cc / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+ }
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx);
+ if (x < 0)
+ z = -z;
+ return z;
+}
+strong_alias (__ieee754_j1l, __j1l_finite)
+
+
+/* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2)
+ Peak relative error 6.2e-38
+ 0 <= x <= 2 */
+#define NY0_2N 7
+static const long double Y0_2N[NY0_2N + 1] = {
+ -6.804415404830253804408698161694720833249E19L,
+ 1.805450517967019908027153056150465849237E19L,
+ -8.065747497063694098810419456383006737312E17L,
+ 1.401336667383028259295830955439028236299E16L,
+ -1.171654432898137585000399489686629680230E14L,
+ 5.061267920943853732895341125243428129150E11L,
+ -1.096677850566094204586208610960870217970E9L,
+ 9.541172044989995856117187515882879304461E5L,
+};
+#define NY0_2D 7
+static const long double Y0_2D[NY0_2D + 1] = {
+ 3.470629591820267059538637461549677594549E20L,
+ 4.120796439009916326855848107545425217219E18L,
+ 2.477653371652018249749350657387030814542E16L,
+ 9.954678543353888958177169349272167762797E13L,
+ 2.957927997613630118216218290262851197754E11L,
+ 6.748421382188864486018861197614025972118E8L,
+ 1.173453425218010888004562071020305709319E6L,
+ 1.450335662961034949894009554536003377187E3L,
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Bessel function of the second kind, order one. */
+
+long double
+__ieee754_y1l (long double x)
+{
+ long double xx, xinv, z, p, q, c, s, cc, ss;
+
+ if (! isfinite (x))
+ return 1 / (x + x * x);
+ if (x <= 0)
+ {
+ if (x < 0)
+ return (zero / (zero * x));
+ return -1 / zero; /* -inf and divide by zero exception. */
+ }
+ xx = fabsl (x);
+ if (xx <= 0x1p-114)
+ {
+ z = -TWOOPI / x;
+ if (isinf (z))
+ __set_errno (ERANGE);
+ return z;
+ }
+ if (xx <= 2)
+ {
+ /* 0 <= x <= 2 */
+ SET_RESTORE_ROUNDL (FE_TONEAREST);
+ z = xx * xx;
+ p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+ p = -TWOOPI / xx + p;
+ p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
+ return p;
+ }
+
+ /* X = x - 3 pi/4
+ cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+ = 1/sqrt(2) * (-cos(x) + sin(x))
+ sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+ = -1/sqrt(2) * (sin(x) + cos(x))
+ cf. Fdlibm. */
+ __sincosl (xx, &s, &c);
+ ss = -s - c;
+ cc = s - c;
+ if (xx <= LDBL_MAX / 2)
+ {
+ z = __cosl (xx + xx);
+ if ((s * c) > 0)
+ cc = z / ss;
+ else
+ ss = z / cc;
+ }
+
+ if (xx > 0x1p256L)
+ return ONEOSQPI * ss / sqrtl (xx);
+
+ xinv = 1 / xx;
+ z = xinv * xinv;
+ if (xinv <= 0.25)
+ {
+ if (xinv <= 0.125)
+ {
+ if (xinv <= 0.0625)
+ {
+ p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+ q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+ }
+ else
+ {
+ p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+ q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+ }
+ }
+ else if (xinv <= 0.1875)
+ {
+ p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+ q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+ }
+ else
+ {
+ p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+ q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+ }
+ } /* .25 */
+ else /* if (xinv <= 0.5) */
+ {
+ if (xinv <= 0.375)
+ {
+ if (xinv <= 0.3125)
+ {
+ p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+ q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+ }
+ else
+ {
+ p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+ / deval (z, P2r7_3r2D, NP2r7_3r2D);
+ q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+ / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+ }
+ }
+ else if (xinv <= 0.4375)
+ {
+ p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+ / deval (z, P2r3_2r7D, NP2r3_2r7D);
+ q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+ / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+ }
+ else
+ {
+ p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+ q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+ }
+ }
+ p = 1 + z * p;
+ q = z * q;
+ q = q * xinv + 0.375L * xinv;
+ z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx);
+ return z;
+}
+strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
index 4a8ccb044e..71b3addfba 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
@@ -60,6 +60,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
@@ -149,7 +150,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -385,7 +386,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 9bcaaf765a..5b628bedc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -1,3 +1,992 @@
-/* Looks like we can use ieee854 e_lgammal_r.c as is for IBM extended format. */
-#include <sysdeps/ieee754/ldbl-128/e_lgammal_r.c>
+/* Natural logarithm of gamma function. IBM Extended Precision version.
+ Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_lgammal_r.c. */
+
+
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
+static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
+static const long double one = 1;
+static const long double huge = LDBL_MAX;
+
+/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
+ 1/x <= 0.0741 (x >= 13.495...)
+ Peak relative error 1.5e-36 */
+static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
+#define NRASY 12
+static const long double RASY[NRASY + 1] =
+{
+ 8.333333333333333333333333333310437112111E-2L,
+ -2.777777777777777777777774789556228296902E-3L,
+ 7.936507936507936507795933938448586499183E-4L,
+ -5.952380952380952041799269756378148574045E-4L,
+ 8.417508417507928904209891117498524452523E-4L,
+ -1.917526917481263997778542329739806086290E-3L,
+ 6.410256381217852504446848671499409919280E-3L,
+ -2.955064066900961649768101034477363301626E-2L,
+ 1.796402955865634243663453415388336954675E-1L,
+ -1.391522089007758553455753477688592767741E0L,
+ 1.326130089598399157988112385013829305510E1L,
+ -1.420412699593782497803472576479997819149E2L,
+ 1.218058922427762808938869872528846787020E3L
+};
+
+
+/* log gamma(x+13) = log gamma(13) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 12.5 <= x+13 <= 13.5
+ Peak relative error 1.1e-36 */
+static const long double lgam13a = 1.9987213134765625E1L;
+static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
+#define NRN13 7
+static const long double RN13[NRN13 + 1] =
+{
+ 8.591478354823578150238226576156275285700E11L,
+ 2.347931159756482741018258864137297157668E11L,
+ 2.555408396679352028680662433943000804616E10L,
+ 1.408581709264464345480765758902967123937E9L,
+ 4.126759849752613822953004114044451046321E7L,
+ 6.133298899622688505854211579222889943778E5L,
+ 3.929248056293651597987893340755876578072E3L,
+ 6.850783280018706668924952057996075215223E0L
+};
+#define NRD13 6
+static const long double RD13[NRD13 + 1] =
+{
+ 3.401225382297342302296607039352935541669E11L,
+ 8.756765276918037910363513243563234551784E10L,
+ 8.873913342866613213078554180987647243903E9L,
+ 4.483797255342763263361893016049310017973E8L,
+ 1.178186288833066430952276702931512870676E7L,
+ 1.519928623743264797939103740132278337476E5L,
+ 7.989298844938119228411117593338850892311E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+12) = log gamma(12) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 11.5 <= x+12 <= 12.5
+ Peak relative error 4.1e-36 */
+static const long double lgam12a = 1.75023040771484375E1L;
+static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
+#define NRN12 7
+static const long double RN12[NRN12 + 1] =
+{
+ 4.709859662695606986110997348630997559137E11L,
+ 1.398713878079497115037857470168777995230E11L,
+ 1.654654931821564315970930093932954900867E10L,
+ 9.916279414876676861193649489207282144036E8L,
+ 3.159604070526036074112008954113411389879E7L,
+ 5.109099197547205212294747623977502492861E5L,
+ 3.563054878276102790183396740969279826988E3L,
+ 6.769610657004672719224614163196946862747E0L
+};
+#define NRD12 6
+static const long double RD12[NRD12 + 1] =
+{
+ 1.928167007860968063912467318985802726613E11L,
+ 5.383198282277806237247492369072266389233E10L,
+ 5.915693215338294477444809323037871058363E9L,
+ 3.241438287570196713148310560147925781342E8L,
+ 9.236680081763754597872713592701048455890E6L,
+ 1.292246897881650919242713651166596478850E5L,
+ 7.366532445427159272584194816076600211171E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+11) = log gamma(11) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 10.5 <= x+11 <= 11.5
+ Peak relative error 1.8e-35 */
+static const long double lgam11a = 1.5104400634765625E1L;
+static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
+#define NRN11 7
+static const long double RN11[NRN11 + 1] =
+{
+ 2.446960438029415837384622675816736622795E11L,
+ 7.955444974446413315803799763901729640350E10L,
+ 1.030555327949159293591618473447420338444E10L,
+ 6.765022131195302709153994345470493334946E8L,
+ 2.361892792609204855279723576041468347494E7L,
+ 4.186623629779479136428005806072176490125E5L,
+ 3.202506022088912768601325534149383594049E3L,
+ 6.681356101133728289358838690666225691363E0L
+};
+#define NRD11 6
+static const long double RD11[NRD11 + 1] =
+{
+ 1.040483786179428590683912396379079477432E11L,
+ 3.172251138489229497223696648369823779729E10L,
+ 3.806961885984850433709295832245848084614E9L,
+ 2.278070344022934913730015420611609620171E8L,
+ 7.089478198662651683977290023829391596481E6L,
+ 1.083246385105903533237139380509590158658E5L,
+ 6.744420991491385145885727942219463243597E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+10) = log gamma(10) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 9.5 <= x+10 <= 10.5
+ Peak relative error 5.4e-37 */
+static const long double lgam10a = 1.280181884765625E1L;
+static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
+#define NRN10 7
+static const long double RN10[NRN10 + 1] =
+{
+ -1.239059737177249934158597996648808363783E14L,
+ -4.725899566371458992365624673357356908719E13L,
+ -7.283906268647083312042059082837754850808E12L,
+ -5.802855515464011422171165179767478794637E11L,
+ -2.532349691157548788382820303182745897298E10L,
+ -5.884260178023777312587193693477072061820E8L,
+ -6.437774864512125749845840472131829114906E6L,
+ -2.350975266781548931856017239843273049384E4L
+};
+#define NRD10 7
+static const long double RD10[NRD10 + 1] =
+{
+ -5.502645997581822567468347817182347679552E13L,
+ -1.970266640239849804162284805400136473801E13L,
+ -2.819677689615038489384974042561531409392E12L,
+ -2.056105863694742752589691183194061265094E11L,
+ -8.053670086493258693186307810815819662078E9L,
+ -1.632090155573373286153427982504851867131E8L,
+ -1.483575879240631280658077826889223634921E6L,
+ -4.002806669713232271615885826373550502510E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+9) = log gamma(9) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 8.5 <= x+9 <= 9.5
+ Peak relative error 3.6e-36 */
+static const long double lgam9a = 1.06045989990234375E1L;
+static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
+#define NRN9 7
+static const long double RN9[NRN9 + 1] =
+{
+ -4.936332264202687973364500998984608306189E13L,
+ -2.101372682623700967335206138517766274855E13L,
+ -3.615893404644823888655732817505129444195E12L,
+ -3.217104993800878891194322691860075472926E11L,
+ -1.568465330337375725685439173603032921399E10L,
+ -4.073317518162025744377629219101510217761E8L,
+ -4.983232096406156139324846656819246974500E6L,
+ -2.036280038903695980912289722995505277253E4L
+};
+#define NRD9 7
+static const long double RD9[NRD9 + 1] =
+{
+ -2.306006080437656357167128541231915480393E13L,
+ -9.183606842453274924895648863832233799950E12L,
+ -1.461857965935942962087907301194381010380E12L,
+ -1.185728254682789754150068652663124298303E11L,
+ -5.166285094703468567389566085480783070037E9L,
+ -1.164573656694603024184768200787835094317E8L,
+ -1.177343939483908678474886454113163527909E6L,
+ -3.529391059783109732159524500029157638736E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+8) = log gamma(8) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 7.5 <= x+8 <= 8.5
+ Peak relative error 2.4e-37 */
+static const long double lgam8a = 8.525146484375E0L;
+static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
+#define NRN8 8
+static const long double RN8[NRN8 + 1] =
+{
+ 6.600775438203423546565361176829139703289E11L,
+ 3.406361267593790705240802723914281025800E11L,
+ 7.222460928505293914746983300555538432830E10L,
+ 8.102984106025088123058747466840656458342E9L,
+ 5.157620015986282905232150979772409345927E8L,
+ 1.851445288272645829028129389609068641517E7L,
+ 3.489261702223124354745894067468953756656E5L,
+ 2.892095396706665774434217489775617756014E3L,
+ 6.596977510622195827183948478627058738034E0L
+};
+#define NRD8 7
+static const long double RD8[NRD8 + 1] =
+{
+ 3.274776546520735414638114828622673016920E11L,
+ 1.581811207929065544043963828487733970107E11L,
+ 3.108725655667825188135393076860104546416E10L,
+ 3.193055010502912617128480163681842165730E9L,
+ 1.830871482669835106357529710116211541839E8L,
+ 5.790862854275238129848491555068073485086E6L,
+ 9.305213264307921522842678835618803553589E4L,
+ 6.216974105861848386918949336819572333622E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+7) = log gamma(7) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 6.5 <= x+7 <= 7.5
+ Peak relative error 3.2e-36 */
+static const long double lgam7a = 6.5792388916015625E0L;
+static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
+#define NRN7 8
+static const long double RN7[NRN7 + 1] =
+{
+ 2.065019306969459407636744543358209942213E11L,
+ 1.226919919023736909889724951708796532847E11L,
+ 2.996157990374348596472241776917953749106E10L,
+ 3.873001919306801037344727168434909521030E9L,
+ 2.841575255593761593270885753992732145094E8L,
+ 1.176342515359431913664715324652399565551E7L,
+ 2.558097039684188723597519300356028511547E5L,
+ 2.448525238332609439023786244782810774702E3L,
+ 6.460280377802030953041566617300902020435E0L
+};
+#define NRD7 7
+static const long double RD7[NRD7 + 1] =
+{
+ 1.102646614598516998880874785339049304483E11L,
+ 6.099297512712715445879759589407189290040E10L,
+ 1.372898136289611312713283201112060238351E10L,
+ 1.615306270420293159907951633566635172343E9L,
+ 1.061114435798489135996614242842561967459E8L,
+ 3.845638971184305248268608902030718674691E6L,
+ 7.081730675423444975703917836972720495507E4L,
+ 5.423122582741398226693137276201344096370E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+6) = log gamma(6) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 5.5 <= x+6 <= 6.5
+ Peak relative error 6.2e-37 */
+static const long double lgam6a = 4.7874908447265625E0L;
+static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
+#define NRN6 8
+static const long double RN6[NRN6 + 1] =
+{
+ -3.538412754670746879119162116819571823643E13L,
+ -2.613432593406849155765698121483394257148E13L,
+ -8.020670732770461579558867891923784753062E12L,
+ -1.322227822931250045347591780332435433420E12L,
+ -1.262809382777272476572558806855377129513E11L,
+ -7.015006277027660872284922325741197022467E9L,
+ -2.149320689089020841076532186783055727299E8L,
+ -3.167210585700002703820077565539658995316E6L,
+ -1.576834867378554185210279285358586385266E4L
+};
+#define NRD6 8
+static const long double RD6[NRD6 + 1] =
+{
+ -2.073955870771283609792355579558899389085E13L,
+ -1.421592856111673959642750863283919318175E13L,
+ -4.012134994918353924219048850264207074949E12L,
+ -6.013361045800992316498238470888523722431E11L,
+ -5.145382510136622274784240527039643430628E10L,
+ -2.510575820013409711678540476918249524123E9L,
+ -6.564058379709759600836745035871373240904E7L,
+ -7.861511116647120540275354855221373571536E5L,
+ -2.821943442729620524365661338459579270561E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+5) = log gamma(5) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 4.5 <= x+5 <= 5.5
+ Peak relative error 3.4e-37 */
+static const long double lgam5a = 3.17803955078125E0L;
+static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
+#define NRN5 9
+static const long double RN5[NRN5 + 1] =
+{
+ 2.010952885441805899580403215533972172098E11L,
+ 1.916132681242540921354921906708215338584E11L,
+ 7.679102403710581712903937970163206882492E10L,
+ 1.680514903671382470108010973615268125169E10L,
+ 2.181011222911537259440775283277711588410E9L,
+ 1.705361119398837808244780667539728356096E8L,
+ 7.792391565652481864976147945997033946360E6L,
+ 1.910741381027985291688667214472560023819E5L,
+ 2.088138241893612679762260077783794329559E3L,
+ 6.330318119566998299106803922739066556550E0L
+};
+#define NRD5 8
+static const long double RD5[NRD5 + 1] =
+{
+ 1.335189758138651840605141370223112376176E11L,
+ 1.174130445739492885895466097516530211283E11L,
+ 4.308006619274572338118732154886328519910E10L,
+ 8.547402888692578655814445003283720677468E9L,
+ 9.934628078575618309542580800421370730906E8L,
+ 6.847107420092173812998096295422311820672E7L,
+ 2.698552646016599923609773122139463150403E6L,
+ 5.526516251532464176412113632726150253215E4L,
+ 4.772343321713697385780533022595450486932E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+4) = log gamma(4) + x P(x)/Q(x)
+ -0.5 <= x <= 0.5
+ 3.5 <= x+4 <= 4.5
+ Peak relative error 6.7e-37 */
+static const long double lgam4a = 1.791748046875E0L;
+static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
+#define NRN4 9
+static const long double RN4[NRN4 + 1] =
+{
+ -1.026583408246155508572442242188887829208E13L,
+ -1.306476685384622809290193031208776258809E13L,
+ -7.051088602207062164232806511992978915508E12L,
+ -2.100849457735620004967624442027793656108E12L,
+ -3.767473790774546963588549871673843260569E11L,
+ -4.156387497364909963498394522336575984206E10L,
+ -2.764021460668011732047778992419118757746E9L,
+ -1.036617204107109779944986471142938641399E8L,
+ -1.895730886640349026257780896972598305443E6L,
+ -1.180509051468390914200720003907727988201E4L
+};
+#define NRD4 9
+static const long double RD4[NRD4 + 1] =
+{
+ -8.172669122056002077809119378047536240889E12L,
+ -9.477592426087986751343695251801814226960E12L,
+ -4.629448850139318158743900253637212801682E12L,
+ -1.237965465892012573255370078308035272942E12L,
+ -1.971624313506929845158062177061297598956E11L,
+ -1.905434843346570533229942397763361493610E10L,
+ -1.089409357680461419743730978512856675984E9L,
+ -3.416703082301143192939774401370222822430E7L,
+ -4.981791914177103793218433195857635265295E5L,
+ -2.192507743896742751483055798411231453733E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+3) = log gamma(3) + x P(x)/Q(x)
+ -0.25 <= x <= 0.5
+ 2.75 <= x+3 <= 3.5
+ Peak relative error 6.0e-37 */
+static const long double lgam3a = 6.93145751953125E-1L;
+static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
+
+#define NRN3 9
+static const long double RN3[NRN3 + 1] =
+{
+ -4.813901815114776281494823863935820876670E11L,
+ -8.425592975288250400493910291066881992620E11L,
+ -6.228685507402467503655405482985516909157E11L,
+ -2.531972054436786351403749276956707260499E11L,
+ -6.170200796658926701311867484296426831687E10L,
+ -9.211477458528156048231908798456365081135E9L,
+ -8.251806236175037114064561038908691305583E8L,
+ -4.147886355917831049939930101151160447495E7L,
+ -1.010851868928346082547075956946476932162E6L,
+ -8.333374463411801009783402800801201603736E3L
+};
+#define NRD3 9
+static const long double RD3[NRD3 + 1] =
+{
+ -5.216713843111675050627304523368029262450E11L,
+ -8.014292925418308759369583419234079164391E11L,
+ -5.180106858220030014546267824392678611990E11L,
+ -1.830406975497439003897734969120997840011E11L,
+ -3.845274631904879621945745960119924118925E10L,
+ -4.891033385370523863288908070309417710903E9L,
+ -3.670172254411328640353855768698287474282E8L,
+ -1.505316381525727713026364396635522516989E7L,
+ -2.856327162923716881454613540575964890347E5L,
+ -1.622140448015769906847567212766206894547E3L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+2.5) = log gamma(2.5) + x P(x)/Q(x)
+ -0.125 <= x <= 0.25
+ 2.375 <= x+2.5 <= 2.75 */
+static const long double lgam2r5a = 2.8466796875E-1L;
+static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
+#define NRN2r5 8
+static const long double RN2r5[NRN2r5 + 1] =
+{
+ -4.676454313888335499356699817678862233205E9L,
+ -9.361888347911187924389905984624216340639E9L,
+ -7.695353600835685037920815799526540237703E9L,
+ -3.364370100981509060441853085968900734521E9L,
+ -8.449902011848163568670361316804900559863E8L,
+ -1.225249050950801905108001246436783022179E8L,
+ -9.732972931077110161639900388121650470926E6L,
+ -3.695711763932153505623248207576425983573E5L,
+ -4.717341584067827676530426007495274711306E3L
+};
+#define NRD2r5 8
+static const long double RD2r5[NRD2r5 + 1] =
+{
+ -6.650657966618993679456019224416926875619E9L,
+ -1.099511409330635807899718829033488771623E10L,
+ -7.482546968307837168164311101447116903148E9L,
+ -2.702967190056506495988922973755870557217E9L,
+ -5.570008176482922704972943389590409280950E8L,
+ -6.536934032192792470926310043166993233231E7L,
+ -4.101991193844953082400035444146067511725E6L,
+ -1.174082735875715802334430481065526664020E5L,
+ -9.932840389994157592102947657277692978511E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+2) = x P(x)/Q(x)
+ -0.125 <= x <= +0.375
+ 1.875 <= x+2 <= 2.375
+ Peak relative error 4.6e-36 */
+#define NRN2 9
+static const long double RN2[NRN2 + 1] =
+{
+ -3.716661929737318153526921358113793421524E9L,
+ -1.138816715030710406922819131397532331321E10L,
+ -1.421017419363526524544402598734013569950E10L,
+ -9.510432842542519665483662502132010331451E9L,
+ -3.747528562099410197957514973274474767329E9L,
+ -8.923565763363912474488712255317033616626E8L,
+ -1.261396653700237624185350402781338231697E8L,
+ -9.918402520255661797735331317081425749014E6L,
+ -3.753996255897143855113273724233104768831E5L,
+ -4.778761333044147141559311805999540765612E3L
+};
+#define NRD2 9
+static const long double RD2[NRD2 + 1] =
+{
+ -8.790916836764308497770359421351673950111E9L,
+ -2.023108608053212516399197678553737477486E10L,
+ -1.958067901852022239294231785363504458367E10L,
+ -1.035515043621003101254252481625188704529E10L,
+ -3.253884432621336737640841276619272224476E9L,
+ -6.186383531162456814954947669274235815544E8L,
+ -6.932557847749518463038934953605969951466E7L,
+ -4.240731768287359608773351626528479703758E6L,
+ -1.197343995089189188078944689846348116630E5L,
+ -1.004622911670588064824904487064114090920E3L
+/* 1.0E0 */
+};
+
+
+/* log gamma(x+1.75) = log gamma(1.75) + x P(x)/Q(x)
+ -0.125 <= x <= +0.125
+ 1.625 <= x+1.75 <= 1.875
+ Peak relative error 9.2e-37 */
+static const long double lgam1r75a = -8.441162109375E-2L;
+static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
+#define NRN1r75 8
+static const long double RN1r75[NRN1r75 + 1] =
+{
+ -5.221061693929833937710891646275798251513E7L,
+ -2.052466337474314812817883030472496436993E8L,
+ -2.952718275974940270675670705084125640069E8L,
+ -2.132294039648116684922965964126389017840E8L,
+ -8.554103077186505960591321962207519908489E7L,
+ -1.940250901348870867323943119132071960050E7L,
+ -2.379394147112756860769336400290402208435E6L,
+ -1.384060879999526222029386539622255797389E5L,
+ -2.698453601378319296159355612094598695530E3L
+};
+#define NRD1r75 8
+static const long double RD1r75[NRD1r75 + 1] =
+{
+ -2.109754689501705828789976311354395393605E8L,
+ -5.036651829232895725959911504899241062286E8L,
+ -4.954234699418689764943486770327295098084E8L,
+ -2.589558042412676610775157783898195339410E8L,
+ -7.731476117252958268044969614034776883031E7L,
+ -1.316721702252481296030801191240867486965E7L,
+ -1.201296501404876774861190604303728810836E6L,
+ -5.007966406976106636109459072523610273928E4L,
+ -6.155817990560743422008969155276229018209E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+x0) = y0 + x^2 P(x)/Q(x)
+ -0.0867 <= x <= +0.1634
+ 1.374932... <= x+x0 <= 1.625032...
+ Peak relative error 4.0e-36 */
+static const long double x0a = 1.4616241455078125L;
+static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
+static const long double y0a = -1.21490478515625E-1L;
+static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
+#define NRN1r5 8
+static const long double RN1r5[NRN1r5 + 1] =
+{
+ 6.827103657233705798067415468881313128066E5L,
+ 1.910041815932269464714909706705242148108E6L,
+ 2.194344176925978377083808566251427771951E6L,
+ 1.332921400100891472195055269688876427962E6L,
+ 4.589080973377307211815655093824787123508E5L,
+ 8.900334161263456942727083580232613796141E4L,
+ 9.053840838306019753209127312097612455236E3L,
+ 4.053367147553353374151852319743594873771E2L,
+ 5.040631576303952022968949605613514584950E0L
+};
+#define NRD1r5 8
+static const long double RD1r5[NRD1r5 + 1] =
+{
+ 1.411036368843183477558773688484699813355E6L,
+ 4.378121767236251950226362443134306184849E6L,
+ 5.682322855631723455425929877581697918168E6L,
+ 3.999065731556977782435009349967042222375E6L,
+ 1.653651390456781293163585493620758410333E6L,
+ 4.067774359067489605179546964969435858311E5L,
+ 5.741463295366557346748361781768833633256E4L,
+ 4.226404539738182992856094681115746692030E3L,
+ 1.316980975410327975566999780608618774469E2L,
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+1.25) = log gamma(1.25) + x P(x)/Q(x)
+ -.125 <= x <= +.125
+ 1.125 <= x+1.25 <= 1.375
+ Peak relative error = 4.9e-36 */
+static const long double lgam1r25a = -9.82818603515625E-2L;
+static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
+#define NRN1r25 9
+static const long double RN1r25[NRN1r25 + 1] =
+{
+ -9.054787275312026472896002240379580536760E4L,
+ -8.685076892989927640126560802094680794471E4L,
+ 2.797898965448019916967849727279076547109E5L,
+ 6.175520827134342734546868356396008898299E5L,
+ 5.179626599589134831538516906517372619641E5L,
+ 2.253076616239043944538380039205558242161E5L,
+ 5.312653119599957228630544772499197307195E4L,
+ 6.434329437514083776052669599834938898255E3L,
+ 3.385414416983114598582554037612347549220E2L,
+ 4.907821957946273805080625052510832015792E0L
+};
+#define NRD1r25 8
+static const long double RD1r25[NRD1r25 + 1] =
+{
+ 3.980939377333448005389084785896660309000E5L,
+ 1.429634893085231519692365775184490465542E6L,
+ 2.145438946455476062850151428438668234336E6L,
+ 1.743786661358280837020848127465970357893E6L,
+ 8.316364251289743923178092656080441655273E5L,
+ 2.355732939106812496699621491135458324294E5L,
+ 3.822267399625696880571810137601310855419E4L,
+ 3.228463206479133236028576845538387620856E3L,
+ 1.152133170470059555646301189220117965514E2L
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ 0.0 <= x <= +0.125
+ 1.0 <= x+1 <= 1.125
+ Peak relative error 1.1e-35 */
+#define NRN1 8
+static const long double RN1[NRN1 + 1] =
+{
+ -9.987560186094800756471055681088744738818E3L,
+ -2.506039379419574361949680225279376329742E4L,
+ -1.386770737662176516403363873617457652991E4L,
+ 1.439445846078103202928677244188837130744E4L,
+ 2.159612048879650471489449668295139990693E4L,
+ 1.047439813638144485276023138173676047079E4L,
+ 2.250316398054332592560412486630769139961E3L,
+ 1.958510425467720733041971651126443864041E2L,
+ 4.516830313569454663374271993200291219855E0L
+};
+#define NRD1 7
+static const long double RD1[NRD1 + 1] =
+{
+ 1.730299573175751778863269333703788214547E4L,
+ 6.807080914851328611903744668028014678148E4L,
+ 1.090071629101496938655806063184092302439E5L,
+ 9.124354356415154289343303999616003884080E4L,
+ 4.262071638655772404431164427024003253954E4L,
+ 1.096981664067373953673982635805821283581E4L,
+ 1.431229503796575892151252708527595787588E3L,
+ 7.734110684303689320830401788262295992921E1L
+ /* 1.0E0 */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+ -0.125 <= x <= 0
+ 0.875 <= x+1 <= 1.0
+ Peak relative error 7.0e-37 */
+#define NRNr9 8
+static const long double RNr9[NRNr9 + 1] =
+{
+ 4.441379198241760069548832023257571176884E5L,
+ 1.273072988367176540909122090089580368732E6L,
+ 9.732422305818501557502584486510048387724E5L,
+ -5.040539994443998275271644292272870348684E5L,
+ -1.208719055525609446357448132109723786736E6L,
+ -7.434275365370936547146540554419058907156E5L,
+ -2.075642969983377738209203358199008185741E5L,
+ -2.565534860781128618589288075109372218042E4L,
+ -1.032901669542994124131223797515913955938E3L,
+};
+#define NRDr9 8
+static const long double RDr9[NRDr9 + 1] =
+{
+ -7.694488331323118759486182246005193998007E5L,
+ -3.301918855321234414232308938454112213751E6L,
+ -5.856830900232338906742924836032279404702E6L,
+ -5.540672519616151584486240871424021377540E6L,
+ -3.006530901041386626148342989181721176919E6L,
+ -9.350378280513062139466966374330795935163E5L,
+ -1.566179100031063346901755685375732739511E5L,
+ -1.205016539620260779274902967231510804992E4L,
+ -2.724583156305709733221564484006088794284E2L
+/* 1.0E0 */
+};
+
+
+/* Evaluate P[n] x^n + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+neval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+/* Evaluate x^n+1 + P[n] x^(n) + P[n-1] x^(n-1) + ... + P[0] */
+
+static long double
+deval (long double x, const long double *p, int n)
+{
+ long double y;
+
+ p += n;
+ y = x + *p--;
+ do
+ {
+ y = y * x + *p--;
+ }
+ while (--n > 0);
+ return y;
+}
+
+
+long double
+__ieee754_lgammal_r (long double x, int *signgamp)
+{
+ long double p, q, w, z, nx;
+ int i, nn;
+
+ *signgamp = 1;
+
+ if (! isfinite (x))
+ return x * x;
+
+ if (x == 0)
+ {
+ if (signbit (x))
+ *signgamp = -1;
+ }
+
+ if (x < 0)
+ {
+ if (x < -2 && x > -48)
+ return __lgamma_negl (x, signgamp);
+ q = -x;
+ p = __floorl (q);
+ if (p == q)
+ return (one / fabsl (p - p));
+ long double halfp = p * 0.5L;
+ if (halfp == __floorl (halfp))
+ *signgamp = -1;
+ else
+ *signgamp = 1;
+ if (q < 0x1p-120L)
+ return -__logl (q);
+ z = q - p;
+ if (z > 0.5L)
+ {
+ p += 1;
+ z = p - q;
+ }
+ z = q * __sinl (PIL * z);
+ w = __ieee754_lgammal_r (q, &i);
+ z = __logl (PIL / z) - w;
+ return (z);
+ }
+
+ if (x < 13.5L)
+ {
+ p = 0;
+ nx = __floorl (x + 0.5L);
+ nn = nx;
+ switch (nn)
+ {
+ case 0:
+ /* log gamma (x + 1) = log(x) + log gamma(x) */
+ if (x < 0x1p-120L)
+ return -__logl (x);
+ else if (x <= 0.125)
+ {
+ p = x * neval (x, RN1, NRN1) / deval (x, RD1, NRD1);
+ }
+ else if (x <= 0.375)
+ {
+ z = x - 0.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else if (x <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ z = x - 1;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ p = p - __logl (x);
+ break;
+
+ case 1:
+ if (x < 0.875L)
+ {
+ if (x <= 0.625)
+ {
+ z = x + (1 - x0a);
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x <= 0.875)
+ {
+ z = x - 0.75L;
+ p = z * neval (z, RN1r75, NRN1r75)
+ / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else
+ {
+ z = x - 1;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ p = p - __logl (x);
+ }
+ else if (x < 1)
+ {
+ z = x - 1;
+ p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
+ }
+ else if (x == 1)
+ p = 0;
+ else if (x <= 1.125L)
+ {
+ z = x - 1;
+ p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
+ }
+ else if (x <= 1.375)
+ {
+ z = x - 1.25L;
+ p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+ p += lgam1r25b;
+ p += lgam1r25a;
+ }
+ else
+ {
+ /* 1.375 <= x+x0 <= 1.625 */
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ break;
+
+ case 2:
+ if (x < 1.625L)
+ {
+ z = x - x0a;
+ z = z - x0b;
+ p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+ p = p * z * z;
+ p = p + y0b;
+ p = p + y0a;
+ }
+ else if (x < 1.875L)
+ {
+ z = x - 1.75L;
+ p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+ p += lgam1r75b;
+ p += lgam1r75a;
+ }
+ else if (x == 2)
+ p = 0;
+ else if (x < 2.375L)
+ {
+ z = x - 2;
+ p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+ }
+ else
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ break;
+
+ case 3:
+ if (x < 2.75)
+ {
+ z = x - 2.5L;
+ p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+ p += lgam2r5b;
+ p += lgam2r5a;
+ }
+ else
+ {
+ z = x - 3;
+ p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
+ p += lgam3b;
+ p += lgam3a;
+ }
+ break;
+
+ case 4:
+ z = x - 4;
+ p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
+ p += lgam4b;
+ p += lgam4a;
+ break;
+
+ case 5:
+ z = x - 5;
+ p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
+ p += lgam5b;
+ p += lgam5a;
+ break;
+
+ case 6:
+ z = x - 6;
+ p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
+ p += lgam6b;
+ p += lgam6a;
+ break;
+
+ case 7:
+ z = x - 7;
+ p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
+ p += lgam7b;
+ p += lgam7a;
+ break;
+
+ case 8:
+ z = x - 8;
+ p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
+ p += lgam8b;
+ p += lgam8a;
+ break;
+
+ case 9:
+ z = x - 9;
+ p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
+ p += lgam9b;
+ p += lgam9a;
+ break;
+
+ case 10:
+ z = x - 10;
+ p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
+ p += lgam10b;
+ p += lgam10a;
+ break;
+
+ case 11:
+ z = x - 11;
+ p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
+ p += lgam11b;
+ p += lgam11a;
+ break;
+
+ case 12:
+ z = x - 12;
+ p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
+ p += lgam12b;
+ p += lgam12a;
+ break;
+
+ case 13:
+ z = x - 13;
+ p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
+ p += lgam13b;
+ p += lgam13a;
+ break;
+ }
+ return p;
+ }
+
+ if (x > MAXLGM)
+ return (*signgamp * huge * huge);
+
+ if (x > 0x1p120L)
+ return x * (__logl (x) - 1);
+ q = ls2pi - x;
+ q = (x - 0.5L) * __logl (x) + q;
+ if (x > 1.0e18L)
+ return (q);
+
+ p = 1 / (x * x);
+ q += neval (p, RASY, NRASY) / x;
+ return (q);
+}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
index 7477791b77..62e3214ca4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
@@ -189,7 +189,7 @@ __ieee754_log10l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log10l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
index e39eaba72a..1f8b6e9d7f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
@@ -183,7 +183,7 @@ __ieee754_log2l (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (hx, xhi);
if ((hx & 0x7fffffffffffffffLL) == 0)
- return (-1.0L / (x - x));
+ return (-1.0L / fabsl (x)); /* log2l(+-0)=-inf */
if (hx < 0)
return (x - x) / (x - x);
if (hx >= 0x7ff0000000000000LL)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index 14acfc2db7..c44feca65b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -58,6 +58,7 @@
License along with this library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <math.h>
#include <math_private.h>
/* log(1+x) = x - .5 x^2 + x^3 l(x)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
index 90340e890e..f59ad4e113 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_powl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_powl.c
@@ -66,6 +66,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double bp[] = {
1.0L,
@@ -148,7 +149,7 @@ long double
__ieee754_powl (long double x, long double y)
{
long double z, ax, z_h, z_l, p_h, p_l;
- long double y1, t1, t2, r, s, t, u, v, w;
+ long double y1, t1, t2, r, s, sgn, t, u, v, w;
long double s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
uint32_t ix, iy;
@@ -165,11 +166,11 @@ __ieee754_powl (long double x, long double y)
iy = hy & 0x7fffffff;
/* y==zero: x**0 = 1 */
- if ((iy | ly) == 0)
+ if ((iy | ly) == 0 && !issignaling (x))
return one;
/* 1.0**y = 1; -1.0**+-Inf = 1 */
- if (x == one)
+ if (x == one && !issignaling (y))
return one;
if (x == -1.0L && ((iy - 0x7ff00000) | ly) == 0)
return one;
@@ -233,7 +234,7 @@ __ieee754_powl (long double x, long double y)
if (hy == 0x3fe00000)
{ /* y is 0.5 */
if (hx >= 0) /* x >= +0 */
- return __ieee754_sqrtl (x);
+ return sqrtl (x);
}
}
}
@@ -260,9 +261,14 @@ __ieee754_powl (long double x, long double y)
}
/* (x<0)**(non-int) is NaN */
- if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0)
+ if (((((uint32_t) hx >> 31) - 1) | yisint) == 0)
return (x - x) / (x - x);
+ /* sgn (sign of result -ve**odd) = -1 else = 1 */
+ sgn = one;
+ if (((((uint32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
+ sgn = -one; /* (-ve)**(odd int) */
+
/* |y| is huge.
2^-16495 = 1/2 of smallest representable value.
If (1 - 1/131072)^y underflows, y > 1.4986e9 */
@@ -272,15 +278,15 @@ __ieee754_powl (long double x, long double y)
if (iy > 0x47d654b0)
{
if (ix <= 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix >= 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
/* over/underflow if x is not close to one */
if (ix < 0x3fefffff)
- return (hy < 0) ? huge * huge : tiny * tiny;
+ return (hy < 0) ? sgn * huge * huge : sgn * tiny * tiny;
if (ix > 0x3ff00000)
- return (hy > 0) ? huge * huge : tiny * tiny;
+ return (hy > 0) ? sgn * huge * huge : sgn * tiny * tiny;
}
ay = y > 0 ? y : -y;
@@ -351,11 +357,6 @@ __ieee754_powl (long double x, long double y)
t1 = ldbl_high (t1);
t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);
- /* s (sign of result -ve**odd) = -1 else = 1 */
- s = one;
- if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0)
- s = -one; /* (-ve)**(odd int) */
-
/* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
y1 = ldbl_high (y);
p_l = (y - y1) * t1 + y * t2;
@@ -367,22 +368,22 @@ __ieee754_powl (long double x, long double y)
{
/* if z > 16384 */
if (((j - 0x40d00000) | lj) != 0)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
else
{
if (p_l + ovt > z - p_h)
- return s * huge * huge; /* overflow */
+ return sgn * huge * huge; /* overflow */
}
}
else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */
{
/* z < -16495 */
if (((j - 0xc0d01bc0) | lj) != 0)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
else
{
if (p_l <= z - p_h)
- return s * tiny * tiny; /* underflow */
+ return sgn * tiny * tiny; /* underflow */
}
}
/* compute 2**(p_h+p_l) */
@@ -408,8 +409,8 @@ __ieee754_powl (long double x, long double y)
t1 = z - t * u / v;
r = (z * t1) / (t1 - two) - (w + z * w);
z = one - (r - z);
- z = __scalbnl (z, n);
- math_check_force_underflow_nonneg (z);
- return s * z;
+ z = __scalbnl (sgn * z, n);
+ math_check_force_underflow (z);
+ return z;
}
strong_alias (__ieee754_powl, __powl_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
index cc2b235534..07cb1e8b4c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -200,7 +200,7 @@ int32_t __ieee754_rem_pio2l(long double x, long double *y)
double tx[8];
int exp;
int64_t n, ix, hx, ixd;
- u_int64_t lxd;
+ uint64_t lxd;
double xhi;
xhi = ldbl_high (x);
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
index 800416f29a..efa83bdab7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
@@ -31,7 +31,7 @@ long double
__ieee754_remainderl(long double x, long double p)
{
int64_t hx,hp;
- u_int64_t sx,lx,lp;
+ uint64_t sx,lx,lp;
long double p_half;
double xhi, xlo, phi, plo;
@@ -42,8 +42,14 @@ __ieee754_remainderl(long double x, long double p)
EXTRACT_WORDS64 (hp, phi);
EXTRACT_WORDS64 (lp, plo);
sx = hx&0x8000000000000000ULL;
+ lp ^= hp & 0x8000000000000000ULL;
hp &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
+ if (lp == 0x8000000000000000ULL)
+ lp = 0;
+ if (lx == 0x8000000000000000ULL)
+ lx = 0;
/* purge off exception values */
if(hp==0) return (x*p)/(x*p); /* p = 0 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
index 67d9d24ce7..f869fb068c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
@@ -31,6 +31,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, shuge = 1.0e307;
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
index 96845fe5f8..28b208883d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2018 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -91,11 +91,9 @@ long double __ieee754_sqrtl(long double x)
return c.x * i;
}
else {
- if (k>=INT64_C(0x7ff0000000000000)) {
- if (a.i[0] == INT64_C(0xfff0000000000000))
- return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */
- return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
- }
+ if (k>=INT64_C(0x7ff0000000000000))
+ /* sqrt (-Inf) = NaN, sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
+ return x * x + x;
if (x == 0) return x;
if (x < 0) return (big1-big1)/(big-big);
return tm256*__ieee754_sqrtl(x*t512);
diff --git a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
index b631f90a44..e4d9887b6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
index c07a6def4b..8017d9846f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ieee754.h
+++ b/sysdeps/ieee754/ldbl-128ibm/ieee754.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
new file mode 100644
index 0000000000..bee080bd29
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h
@@ -0,0 +1,5 @@
+#include_next <bits/iscanonical.h>
+
+#ifndef _ISOMAC
+libm_hidden_proto (__iscanonicall)
+#endif
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
index 2a3189ad36..e40c53cad3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -86,7 +86,7 @@ __kernel_cosl(long double x, long double y)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
index 4e43c8622e..ba95337c31 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
index 44da02b0f3..46d1d7b52a 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
@@ -20,6 +20,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double c[] = {
#define ONE c[0]
@@ -82,12 +83,12 @@ __kernel_sinl(long double x, long double y, int iy)
{
long double h, l, z, sin_l, cos_l_m1;
int64_t ix;
- u_int32_t tix, hix, index;
+ uint32_t tix, hix, index;
double xhi, hhi;
xhi = ldbl_high (x);
EXTRACT_WORDS64 (ix, xhi);
- tix = ((u_int64_t)ix) >> 32;
+ tix = ((uint64_t)ix) >> 32;
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
index 3c1bf32af9..3927fca25c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/k_tanl.c
@@ -57,9 +57,11 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
+
static const long double
one = 1.0L,
pio4hi = 7.8539816339744830961566084581987569936977E-1L,
diff --git a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
index 4f550ef47c..0e265ff5b2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,12 @@
bits (106 for long double) and an integral power of two (MPN
frexpl). */
+
+/* When signs differ, the actual value is the difference between the
+ significant double and the less significant double. Sometimes a
+ bit can be lost when we borrow from the significant mantissa. */
+#define EXTRA_INTERNAL_PRECISION (7)
+
mp_size_t
__mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
int *expt, int *is_neg,
@@ -45,10 +51,15 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;
hi = ((long long) u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;
+ /* Hold 7 extra bits of precision in the mantissa. This allows
+ the normalizing shifts below to prevent losing precision when
+ the signs differ and the exponents are sufficiently far apart. */
+ lo <<= EXTRA_INTERNAL_PRECISION;
+
/* If the lower double is not a denormal or zero then set the hidden
53rd bit. */
if (u.d[1].ieee.exponent != 0)
- lo |= 1ULL << 52;
+ lo |= 1ULL << (52 + EXTRA_INTERNAL_PRECISION);
else
lo = lo << 1;
@@ -72,12 +83,12 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
if (u.d[0].ieee.negative != u.d[1].ieee.negative
&& lo != 0)
{
- lo = (1ULL << 53) - lo;
+ lo = (1ULL << (53 + EXTRA_INTERNAL_PRECISION)) - lo;
if (hi == 0)
{
/* we have a borrow from the hidden bit, so shift left 1. */
- hi = 0x0ffffffffffffeLL | (lo >> 51);
- lo = 0x1fffffffffffffLL & (lo << 1);
+ hi = 0x000ffffffffffffeLL | (lo >> (52 + EXTRA_INTERNAL_PRECISION));
+ lo = 0x0fffffffffffffffLL & (lo << 1);
(*expt)--;
}
else
@@ -85,14 +96,14 @@ __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
}
#if BITS_PER_MP_LIMB == 32
/* Combine the mantissas to be contiguous. */
- res_ptr[0] = lo;
- res_ptr[1] = (hi << (53 - 32)) | (lo >> 32);
+ res_ptr[0] = lo >> EXTRA_INTERNAL_PRECISION;
+ res_ptr[1] = (hi << (53 - 32)) | (lo >> (32 + EXTRA_INTERNAL_PRECISION));
res_ptr[2] = hi >> 11;
res_ptr[3] = hi >> (32 + 11);
#define N 4
#elif BITS_PER_MP_LIMB == 64
/* Combine the two mantissas to be contiguous. */
- res_ptr[0] = (hi << 53) | lo;
+ res_ptr[0] = (hi << 53) | (lo >> EXTRA_INTERNAL_PRECISION);
res_ptr[1] = hi >> 11;
#define N 2
#else
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
index c2a5cd29b6..e00f7b9889 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
index c5fa81be8e..dc0e8dd723 100644
--- a/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
index d827112446..653407597f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math-nan-payload-ldouble.h
@@ -1,5 +1,5 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-128ibm.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* NaN payload handling or ldbl-128ibm.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ibm_extended_long_double u; \
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
index 051352f9f7..ccb646620e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
@@ -1,6 +1,23 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_LDBL_H_
+#define _MATH_LDBL_H_ 1
#include <ieee754.h>
#include <stdint.h>
@@ -230,3 +247,44 @@ ldbl_nearbyint (double a)
}
return a;
}
+
+/* Canonicalize a result from an integer rounding function, in any
+ rounding mode. *A and *AA are finite and integers, with *A being
+ nonzero; if the result is not already canonical, *AA is plus or
+ minus a power of 2 that does not exceed the least set bit in
+ *A. */
+static inline void
+ldbl_canonicalize_int (double *a, double *aa)
+{
+ /* Previously we used EXTRACT_WORDS64 from math_private.h, but in order
+ to avoid including internal headers we duplicate that code here. */
+ uint64_t ax, aax;
+ union { double value; uint64_t word; } extractor;
+ extractor.value = *a;
+ ax = extractor.word;
+ extractor.value = *aa;
+ aax = extractor.word;
+
+ int expdiff = ((ax >> 52) & 0x7ff) - ((aax >> 52) & 0x7ff);
+ if (expdiff <= 53)
+ {
+ if (expdiff == 53)
+ {
+ /* Half way between two double values; noncanonical iff the
+ low bit of A's mantissa is 1. */
+ if ((ax & 1) != 0)
+ {
+ *a += 2 * *aa;
+ *aa = -*aa;
+ }
+ }
+ else
+ {
+ /* The sum can be represented in a single double. */
+ *a += *aa;
+ *aa = 0;
+ }
+ }
+}
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index 42f5e6a02d..ff9f6496bd 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
index 06be1c52d4..2908e8a819 100644
--- a/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
index aa9a9ba213..d4977e5414 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
@@ -28,6 +28,7 @@ static char rcsid[] = "$NetBSD: s_asinh.c,v 1.9 1995/05/12 04:57:37 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double
@@ -53,10 +54,10 @@ long double __asinhl(long double x)
w = __ieee754_logl(fabsl(x))+ln2;
} else if (ix>0x4000000000000000LL) { /* 2**56 >= |x| > 2.0 */
t = fabs(x);
- w = __ieee754_logl(2.0*t+one/(__ieee754_sqrtl(x*x+one)+t));
+ w = __ieee754_logl(2.0*t+one/(sqrtl(x*x+one)+t));
} else { /* 2.0 >= |x| >= 2**-56 */
t = x*x;
- w =__log1pl(fabsl(x)+t/(one+__ieee754_sqrtl(one+t)));
+ w =__log1pl(fabsl(x)+t/(one+sqrtl(one+t)));
}
if(hx>0) return w; else return -w;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
index 0560d820ae..32cf36c65d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
@@ -62,6 +62,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
/* arctan(k/8), k = 0, ..., 82 */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 010a671dce..317d238057 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -1,6 +1,102 @@
-/* Looks like we can use ieee854 s_cbrtl.c as is for IBM extended format. */
+/* Implementation of cbrtl. IBM Extended Precision version.
+ Cephes Math Library Release 2.2: January, 1991
+ Copyright 1984, 1991 by Stephen L. Moshier
+ Adapted for glibc October, 2001.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c. */
+
+
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
+#include <math.h>
+#include <math_private.h>
+
+static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
+static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
+static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
+static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
+
+
+long double
+__cbrtl (long double x)
+{
+ int e, rem, sign;
+ long double z;
+
+ if (!isfinite (x))
+ return x + x;
+
+ if (x == 0)
+ return (x);
+
+ if (x > 0)
+ sign = 1;
+ else
+ {
+ sign = -1;
+ x = -x;
+ }
+
+ z = x;
+ /* extract power of 2, leaving mantissa between 0.5 and 1 */
+ x = __frexpl (x, &e);
+
+ /* Approximate cube root of number between .5 and 1,
+ peak relative error = 1.2e-6 */
+ x = ((((1.3584464340920900529734e-1L * x
+ - 6.3986917220457538402318e-1L) * x
+ + 1.2875551670318751538055e0L) * x
+ - 1.4897083391357284957891e0L) * x
+ + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L;
+
+ /* exponent divided by 3 */
+ if (e >= 0)
+ {
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2;
+ else if (rem == 2)
+ x *= CBRT4;
+ }
+ else
+ { /* argument less than 1 */
+ e = -e;
+ rem = e;
+ e /= 3;
+ rem -= 3 * e;
+ if (rem == 1)
+ x *= CBRT2I;
+ else if (rem == 2)
+ x *= CBRT4I;
+ e = -e;
+ }
+
+ /* multiply by power of 2 */
+ x = __ldexpl (x, e);
+
+ /* Newton iteration */
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+ x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+
+ if (sign < 0)
+ x = -x;
+ return (x);
+}
+
long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
index ac649b7215..7dcff021c4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c
@@ -1,6 +1,6 @@
/* Ceil (round to +inf) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,43 +36,26 @@ __ceill (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. ceill must
- round towards +Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
+ hi = __ceil (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_daddl.c b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
new file mode 100644
index 0000000000..28b7e06ace
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_daddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__daddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
new file mode 100644
index 0000000000..6bbbbcf09d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ddivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__ddivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dmull.c b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
new file mode 100644
index 0000000000..7b75b2b0f1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__dmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
new file mode 100644
index 0000000000..e0e80f26a4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_dsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+double
+__dsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, double);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
index 7b761b0afa..5302fee522 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@@ -105,6 +105,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
#include <fix-int-fp-convert-zero.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 66f75e1c80..42d57c6eec 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -106,8 +106,8 @@ __expm1l (long double x)
/* Infinity (which must be negative infinity). */
if (((ix - 0x7ff00000) | lx) == 0)
return -1.0L;
- /* NaN. No invalid exception. */
- return x;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
index c801c97065..54bf9b9cc1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
@@ -28,7 +28,7 @@ static char rcsid[] = "$NetBSD: $";
long double __fabsl(long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_faddl.c b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
new file mode 100644
index 0000000000..55a391885c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_faddl.c
@@ -0,0 +1,27 @@
+/* Add long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__faddl (long double x, long double y)
+{
+ NARROW_ADD_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
new file mode 100644
index 0000000000..dd34c05502
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fdivl.c
@@ -0,0 +1,27 @@
+/* Divide long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fdivl (long double x, long double y)
+{
+ NARROW_DIV_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
index 912230870a..4aae5ae608 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_floorl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,36 +36,26 @@ __floorl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo += -1.0;
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
+ hi = __floor (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. */
+ lo = __floor (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
index eb3ee3cfb8..e72a3e4d59 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2011-2016 Free Software Foundation, Inc.
+ Copyright (C) 2011-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Flaherty <flaherty@linux.vnet.ibm.com>.
@@ -17,25 +17,240 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <fenv.h>
+#include <float.h>
#include <math.h>
+#include <math-barriers.h>
+#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
+#include <mul_split.h>
+#include <stdlib.h>
+
+/* Calculate X + Y exactly and store the result in *HI + *LO. It is
+ given that |X| >= |Y| and the values are small enough that no
+ overflow occurs. */
+
+static void
+add_split (double *hi, double *lo, double x, double y)
+{
+ /* Apply Dekker's algorithm. */
+ *hi = x + y;
+ *lo = (x - *hi) + y;
+}
+
+/* Value with extended range, used in intermediate computations. */
+typedef struct
+{
+ /* Value in [0.5, 1), as from frexp, or 0. */
+ double val;
+ /* Exponent of power of 2 it is multiplied by, or 0 for zero. */
+ int exp;
+} ext_val;
+
+/* Store D as an ext_val value. */
+
+static void
+store_ext_val (ext_val *v, double d)
+{
+ v->val = __frexp (d, &v->exp);
+}
+
+/* Store X * Y as ext_val values *V0 and *V1. */
+
+static void
+mul_ext_val (ext_val *v0, ext_val *v1, double x, double y)
+{
+ int xexp, yexp;
+ x = __frexp (x, &xexp);
+ y = __frexp (y, &yexp);
+ double hi, lo;
+ mul_split (&hi, &lo, x, y);
+ store_ext_val (v0, hi);
+ if (hi != 0)
+ v0->exp += xexp + yexp;
+ store_ext_val (v1, lo);
+ if (lo != 0)
+ v1->exp += xexp + yexp;
+}
+
+/* Compare absolute values of ext_val values pointed to by P and Q for
+ qsort. */
+
+static int
+compare (const void *p, const void *q)
+{
+ const ext_val *pe = p;
+ const ext_val *qe = q;
+ if (pe->val == 0)
+ return qe->val == 0 ? 0 : -1;
+ else if (qe->val == 0)
+ return 1;
+ else if (pe->exp < qe->exp)
+ return -1;
+ else if (pe->exp > qe->exp)
+ return 1;
+ else
+ {
+ double pd = fabs (pe->val);
+ double qd = fabs (qe->val);
+ if (pd < qd)
+ return -1;
+ else if (pd == qd)
+ return 0;
+ else
+ return 1;
+ }
+}
+
+/* Calculate *X + *Y exactly, storing the high part in *X (rounded to
+ nearest) and the low part in *Y. It is given that |X| >= |Y|. */
+
+static void
+add_split_ext (ext_val *x, ext_val *y)
+{
+ int xexp = x->exp, yexp = y->exp;
+ if (y->val == 0 || xexp - yexp > 53)
+ return;
+ double hi = x->val;
+ double lo = __scalbn (y->val, yexp - xexp);
+ add_split (&hi, &lo, hi, lo);
+ store_ext_val (x, hi);
+ if (hi != 0)
+ x->exp += xexp;
+ store_ext_val (y, lo);
+ if (lo != 0)
+ y->exp += xexp;
+}
long double
__fmal (long double x, long double y, long double z)
{
- /* An IBM long double 128 is really just 2 IEEE64 doubles, and in
- * the case of inf/nan only the first double counts. So we use the
- * (double) cast to avoid any data movement. */
- if ((isfinite ((double)x) && isfinite ((double)y)) && isinf ((double)z))
- return (z);
-
- /* If z is zero and x are y are nonzero, compute the result
- as x * y to avoid the wrong sign of a zero result if x * y
- underflows to 0. */
- if (z == 0 && x != 0 && y != 0)
- return x * y;
-
- return (x * y) + z;
+ double xhi, xlo, yhi, ylo, zhi, zlo;
+ int64_t hx, hy, hz;
+ int xexp, yexp, zexp;
+ double scale_val;
+ int scale_exp;
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ xexp = (hx & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+ yexp = (hy & 0x7ff0000000000000LL) >> 52;
+ ldbl_unpack (z, &zhi, &zlo);
+ EXTRACT_WORDS64 (hz, zhi);
+ zexp = (hz & 0x7ff0000000000000LL) >> 52;
+
+ /* If z is Inf or NaN, but x and y are finite, avoid any exceptions
+ from computing x * y. */
+ if (zexp == 0x7ff && xexp != 0x7ff && yexp != 0x7ff)
+ return (z + x) + y;
+
+ /* If z is zero and x are y are nonzero, compute the result as x * y
+ to avoid the wrong sign of a zero result if x * y underflows to
+ 0. */
+ if (z == 0 && x != 0 && y != 0)
+ return x * y;
+
+ /* If x or y or z is Inf/NaN, or if x * y is zero, compute as x * y
+ + z. */
+ if (xexp == 0x7ff || yexp == 0x7ff || zexp == 0x7ff
+ || x == 0 || y == 0)
+ return (x * y) + z;
+
+ {
+ SET_RESTORE_ROUND (FE_TONEAREST);
+
+ ext_val vals[10];
+ store_ext_val (&vals[0], zhi);
+ store_ext_val (&vals[1], zlo);
+ mul_ext_val (&vals[2], &vals[3], xhi, yhi);
+ mul_ext_val (&vals[4], &vals[5], xhi, ylo);
+ mul_ext_val (&vals[6], &vals[7], xlo, yhi);
+ mul_ext_val (&vals[8], &vals[9], xlo, ylo);
+ qsort (vals, 10, sizeof (ext_val), compare);
+ /* Add up the values so that each element of VALS has absolute
+ value at most equal to the last set bit of the next nonzero
+ element. */
+ for (size_t i = 0; i <= 8; i++)
+ {
+ add_split_ext (&vals[i + 1], &vals[i]);
+ qsort (vals + i + 1, 9 - i, sizeof (ext_val), compare);
+ }
+ /* Add up the values in the other direction, so that each element
+ of VALS has absolute value less than 5ulp of the next
+ value. */
+ size_t dstpos = 9;
+ for (size_t i = 1; i <= 9; i++)
+ {
+ if (vals[dstpos].val == 0)
+ {
+ vals[dstpos] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ else
+ {
+ add_split_ext (&vals[dstpos], &vals[9 - i]);
+ if (vals[9 - i].val != 0)
+ {
+ if (9 - i < dstpos - 1)
+ {
+ vals[dstpos - 1] = vals[9 - i];
+ vals[9 - i].val = 0;
+ vals[9 - i].exp = 0;
+ }
+ dstpos--;
+ }
+ }
+ }
+ /* If the result is an exact zero, it results from adding two
+ values with opposite signs; recompute in the original rounding
+ mode. */
+ if (vals[9].val == 0)
+ goto zero_out;
+ /* Adding the top three values will now give a result as accurate
+ as the underlying long double arithmetic. */
+ add_split_ext (&vals[9], &vals[8]);
+ if (compare (&vals[8], &vals[7]) < 0)
+ {
+ ext_val tmp = vals[7];
+ vals[7] = vals[8];
+ vals[8] = tmp;
+ }
+ add_split_ext (&vals[8], &vals[7]);
+ add_split_ext (&vals[9], &vals[8]);
+ if (vals[9].exp > DBL_MAX_EXP || vals[9].exp < DBL_MIN_EXP)
+ {
+ /* Overflow or underflow, with the result depending on the
+ original rounding mode, but not on the low part computed
+ here. */
+ scale_val = vals[9].val;
+ scale_exp = vals[9].exp;
+ goto scale_out;
+ }
+ double hi = __scalbn (vals[9].val, vals[9].exp);
+ double lo = __scalbn (vals[8].val, vals[8].exp);
+ /* It is possible that the low part became subnormal and was
+ rounded so that the result is no longer canonical. */
+ ldbl_canonicalize (&hi, &lo);
+ long double ret = ldbl_pack (hi, lo);
+ math_check_force_underflow (ret);
+ return ret;
+ }
+
+ scale_out:
+ scale_val = math_opt_barrier (scale_val);
+ scale_val = __scalbn (scale_val, scale_exp);
+ if (fabs (scale_val) == DBL_MAX)
+ return __copysignl (LDBL_MAX, scale_val);
+ math_check_force_underflow (scale_val);
+ return scale_val;
+
+ zero_out:;
+ double zero = 0.0;
+ zero = math_opt_barrier (zero);
+ return zero - zero;
}
#if IS_IN (libm)
long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmull.c b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
new file mode 100644
index 0000000000..d1988f168d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fmull.c
@@ -0,0 +1,27 @@
+/* Multiply long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fmull (long double x, long double y)
+{
+ NARROW_MUL_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
index 83c3a8dc51..92c08cc995 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
@@ -1,5 +1,5 @@
/* Return classification value corresponding to argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -44,7 +44,7 @@
int
___fpclassifyl (long double x)
{
- u_int64_t hx, lx;
+ uint64_t hx, lx;
int retval = FP_NORMAL;
double xhi, xlo;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
index 52d2d3ea90..210c5d2ed4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c
@@ -47,7 +47,7 @@ long double __frexpl(long double x, int *eptr)
{
/* 0,inf,nan. */
*eptr = expon;
- return x;
+ return x + x;
}
expon = ix >> 52;
if (expon == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
new file mode 100644
index 0000000000..f3fdba33c1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpl, fromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
new file mode 100644
index 0000000000..76287c33dc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c
@@ -0,0 +1,147 @@
+/* Round to integer type. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3ff
+#define MANT_DIG 53
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (long double x, int round, unsigned int width)
+{
+ double hi, lo;
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint64_t hx, lx;
+ ldbl_unpack (x, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ bool negative = (hx & 0x8000000000000000ULL) != 0;
+ bool lo_negative = (lx & 0x8000000000000000ULL) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ hx &= 0x7fffffffffffffffULL;
+ lx &= 0x7fffffffffffffffULL;
+ if ((hx | lx) == 0)
+ return 0;
+ int hi_exponent = hx >> (MANT_DIG - 1);
+ hi_exponent -= BIAS;
+ int exponent = hi_exponent;
+ hx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ if (hx == 0 && lx != 0 && lo_negative != negative)
+ exponent--;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+ int lo_exponent = lx >> (MANT_DIG - 1);
+ lo_exponent -= BIAS;
+
+ /* Convert the high part to integer. */
+ hx |= 1ULL << (MANT_DIG - 1);
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (hi_exponent >= MANT_DIG - 1)
+ {
+ uret = hx;
+ uret <<= hi_exponent - (MANT_DIG - 1);
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (hi_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - hi_exponent);
+ half_bit = (hx & h) != 0;
+ more_bits = (hx & (h - 1)) != 0;
+ uret = hx >> (MANT_DIG - 1 - hi_exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+
+ /* Likewise, the low part. */
+ if (lx != 0)
+ {
+ uintmax_t lo_uret;
+ bool lo_half_bit, lo_more_bits;
+ lx &= ((1ULL << (MANT_DIG - 1)) - 1);
+ lx |= 1ULL << (MANT_DIG - 1);
+ /* The high part exponent is at most 64, so the low part
+ exponent is at most 11. */
+ if (lo_exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - lo_exponent);
+ lo_half_bit = (lx & h) != 0;
+ lo_more_bits = (lx & (h - 1)) != 0;
+ lo_uret = lx >> (MANT_DIG - 1 - lo_exponent);
+ }
+ else
+ {
+ lo_uret = 0;
+ lo_half_bit = false;
+ lo_more_bits = true;
+ }
+ if (lo_negative == negative)
+ {
+ uret += lo_uret;
+ half_bit |= lo_half_bit;
+ more_bits |= lo_more_bits;
+ }
+ else
+ {
+ uret -= lo_uret;
+ if (lo_half_bit)
+ {
+ uret--;
+ half_bit = true;
+ }
+ if (lo_more_bits && !more_bits)
+ {
+ if (half_bit)
+ {
+ half_bit = false;
+ more_bits = true;
+ }
+ else
+ {
+ uret--;
+ half_bit = true;
+ more_bits = true;
+ }
+ }
+ }
+ }
+
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
new file mode 100644
index 0000000000..9477cc2ea7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__fromfpxl, fromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
new file mode 100644
index 0000000000..aa6662de05
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_fsubl.c
@@ -0,0 +1,27 @@
+/* Subtract long double (ldbl-128ibm) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math-narrow.h>
+
+float
+__fsubl (long double x, long double y)
+{
+ NARROW_SUB_TRIVIAL (x, y, float);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
new file mode 100644
index 0000000000..5b24955353
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c
@@ -0,0 +1,35 @@
+/* Get NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fix-int-fp-convert-zero.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+long double
+__getpayloadl (const long double *x)
+{
+ double xhi = ldbl_high (*x);
+ uint64_t ix;
+ EXTRACT_WORDS64 (ix, xhi);
+ ix &= 0x7ffffffffffffULL;
+ if (FIX_INT_FP_CONVERT_ZERO && ix == 0)
+ return 0.0L;
+ return (long double) ix;
+}
+weak_alias (__getpayloadl, getpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
new file mode 100644
index 0000000000..91ce417992
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c
@@ -0,0 +1,60 @@
+/* Test whether long double value is canonical. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <stdint.h>
+
+int
+__iscanonicall (long double x)
+{
+ double xhi, xlo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ int64_t ix = hx & 0x7fffffffffffffffULL;
+ int64_t iy = lx & 0x7fffffffffffffffULL;
+ int hexp = (ix & 0x7ff0000000000000LL) >> 52;
+ int lexp = (iy & 0x7ff0000000000000LL) >> 52;
+
+ if (iy == 0)
+ /* Low part 0 is always OK. */
+ return 1;
+
+ if (hexp == 0x7ff)
+ /* If a NaN, the low part does not matter. If an infinity, the
+ low part must be 0, in which case we have already returned. */
+ return ix != 0x7ff0000000000000LL;
+
+ /* The high part is finite and the low part is nonzero. There must
+ be sufficient difference between the exponents. */
+ bool low_p2;
+ if (lexp == 0)
+ {
+ /* Adjust the exponent for subnormal low part. */
+ lexp = 12 - __builtin_clzll (iy);
+ low_p2 = iy == (1LL << (51 + lexp));
+ }
+ else
+ low_p2 = (iy & 0xfffffffffffffLL) == 0;
+ int expdiff = hexp - lexp;
+ return expdiff > 53 || (expdiff == 53 && low_p2 && (ix & 1) == 0);
+}
+libm_hidden_def (__iscanonicall)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
index 091513908b..126abce2de 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingl (long double x)
@@ -29,7 +30,7 @@ __issignalingl (long double x)
xhi = ldbl_high (x);
EXTRACT_WORDS64 (xi, xhi);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
# error untested
/* We only have to care about the high-order bit of x's significand, because
having it set (sNaN) already makes the significand different from that
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
index 860ede1e0b..9d4535103e 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
index 9fba087d5b..de6a7b5be2 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_llroundl.c
@@ -1,6 +1,6 @@
/* Round to long long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
index 743693bfd6..e499c9f604 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
@@ -131,8 +131,8 @@ __log1pl (long double xm1)
/* Test for NaN or infinity input. */
xhi = ldbl_high (xm1);
EXTRACT_WORDS (hx, lx, xhi);
- if (hx >= 0x7ff00000)
- return xm1;
+ if ((hx & 0x7fffffff) >= 0x7ff00000)
+ return xm1 + xm1 * xm1;
/* log1p(+- 0) = +- 0. */
if (((hx & 0x7fffffff) | lx) == 0)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
index 988de70c5a..05fe7fefdf 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -84,7 +85,7 @@ __lrintl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -105,27 +106,27 @@ __lrintl (long double x)
return res;
if (xh < 0.0)
- res -= 1;
+ res -= 1UL;
else
- res += 1;
+ res += 1UL;
break;
case FE_TOWARDZERO:
if (res > 0 && (xh < 0.0 || (xh == 0.0 && xl < 0.0)))
- res -= 1;
+ res -= 1UL;
else if (res < 0 && (xh > 0.0 || (xh == 0.0 && xl > 0.0)))
- res += 1;
+ res += 1UL;
return res;
break;
case FE_UPWARD:
if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- res += 1;
+ res += 1UL;
break;
case FE_DOWNWARD:
if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- res -= 1;
+ res -= 1UL;
break;
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
index aa48f680d4..bc8dda4c1d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_lroundl.c
@@ -1,6 +1,6 @@
/* Round to long int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <math.h>
#include <fenv.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -80,7 +81,7 @@ __lroundl (long double x)
/* Peg at max/min values, assuming that the above conversions do so.
Strictly speaking, we can return anything for values that overflow,
but this is more useful. */
- res = hi + lo;
+ res = (long int) ((unsigned long int) hi + (unsigned long int) lo);
/* This is just sign(hi) == sign(lo) && sign(res) != sign(hi). */
if (__glibc_unlikely (((~(hi ^ lo) & (res ^ hi)) < 0)))
@@ -92,21 +93,21 @@ __lroundl (long double x)
hi = res;
if (xh > 0.5)
{
- res += 1;
+ res += 1UL;
}
else if (xh == 0.5)
{
if (xl > 0.0 || (xl == 0.0 && res >= 0))
- res += 1;
+ res += 1UL;
}
else if (-xh > 0.5)
{
- res -= 1;
+ res -= 1UL;
}
else if (-xh == 0.5)
{
if (xl < 0.0 || (xl == 0.0 && res <= 0))
- res -= 1;
+ res -= 1UL;
}
if (__glibc_unlikely (((~(hi ^ (res - hi)) & (res ^ hi)) < 0)))
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
index 260cc3e33c..1dc6c40e9c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_modfl.c
@@ -36,7 +36,7 @@ static const long double one = 1.0;
long double __modfl(long double x, long double *iptr)
{
int64_t i0,i1,j0;
- u_int64_t i;
+ uint64_t i;
double xhi, xlo;
ldbl_unpack (x, &xhi, &xlo);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
index 08134edd10..bd691f3310 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values without raising inexact.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,110 +17,5 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* This has been coded in assembler because GCC makes such a mess of it
- when it's coded in C. */
-
-#include <math.h>
-#include <math_private.h>
-#include <fenv.h>
-#include <math_ldbl_opt.h>
-#include <float.h>
-#include <ieee754.h>
-
-
-long double
-__nearbyintl (long double x)
-{
- fenv_t env;
- static const long double TWO52 = 4503599627370496.0L;
- union ibm_extended_long_double u;
- u.ld = x;
-
- if (!isfinite (u.d[0].d))
- return x;
- else if (fabs (u.d[0].d) < TWO52)
- {
- double xh = u.d[0].d;
- double high = u.d[0].d;
- feholdexcept (&env);
- if (high > 0.0)
- {
- high += TWO52;
- high -= TWO52;
- if (high == -0.0) high = 0.0;
- }
- else if (high < 0.0)
- {
- high -= TWO52;
- high += TWO52;
- if (high == 0.0) high = -0.0;
- }
- if (u.d[1].d > 0.0 && (xh - high == 0.5))
- high += 1.0;
- else if (u.d[1].d < 0.0 && (-(xh - high) == 0.5))
- high -= 1.0;
- u.d[0].d = high;
- u.d[1].d = 0.0;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
- else if (fabs (u.d[1].d) < TWO52 && u.d[1].d != 0.0)
- {
- double high = u.d[0].d, low = u.d[1].d, tau;
- /* In this case we have to round the low double and handle any
- adjustment to the high double that may be caused by rounding
- (up). This is complicated by the fact that the high double
- may already be rounded and the low double may have the
- opposite sign to compensate. */
- feholdexcept (&env);
- if (u.d[0].d > 0.0)
- {
- if (u.d[1].d > 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d < 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
-
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low += TWO52;
- low -= TWO52;
- }
- else if (u.d[0].d < 0.0)
- {
- if (u.d[1].d < 0.0)
- {
- /* If the high/low doubles are the same sign then simply
- round the low double. */
- }
- else if (u.d[1].d > 0.0)
- {
- /* Else the high double is pre rounded and we need to
- adjust for that. */
- tau = __nextafter (u.d[0].d, 0.0);
- tau = (u.d[0].d - tau) * 2.0;
- high -= tau;
- low += tau;
- }
- low = TWO52 - low;
- low = -(low - TWO52);
- }
- u.d[0].d = high + low;
- u.d[1].d = high - u.d[0].d + low;
- math_force_eval (u.d[0]);
- math_force_eval (u.d[1]);
- fesetenv (&env);
- }
-
- return u.ld;
-}
-
-long_double_symbol (libm, __nearbyintl, nearbyintl);
+#define USE_AS_NEARBYINTL
+#include "s_rintl.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
index 515aa1ef5b..e29f7d60a3 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
@@ -87,6 +88,9 @@ long double __nextafterl(long double x, long double y)
math_force_eval (u); /* raise underflow flag */
__set_errno (ERANGE);
}
+ /* Avoid returning -0 in FE_DOWNWARD mode. */
+ if (x == 0.0L)
+ return 0.0L;
return x;
}
/* If the high double is an exact power of two and the low
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
index d8f4fc6523..8456bd5145 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
@@ -27,6 +27,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
index 7c5d1cc112..960ffd9aee 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
@@ -20,6 +20,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -43,7 +44,7 @@ float __nexttowardf(float x, long double y)
if((long double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
new file mode 100644
index 0000000000..9b532a3a25
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextupl.c
@@ -0,0 +1,79 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+/* Return the least floating-point number greater than X. */
+long double
+__nextupl (long double x)
+{
+ int64_t hx, ihx, lx;
+ double xhi, xlo, yhi;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo);
+ ihx = hx & 0x7fffffffffffffffLL;
+
+ if (ihx > 0x7ff0000000000000LL) /* x is nan. */
+ return x + x; /* Signal the nan. */
+ if (ihx == 0)
+ return LDBL_TRUE_MIN;
+
+ long double u;
+ if ((hx == 0x7fefffffffffffffLL) && (lx == 0x7c8ffffffffffffeLL))
+ return INFINITY;
+ if ((uint64_t) hx >= 0xfff0000000000000ULL)
+ {
+ u = -0x1.fffffffffffff7ffffffffffff8p+1023L;
+ return u;
+ }
+ if (ihx <= 0x0360000000000000LL)
+ { /* x <= LDBL_MIN. */
+ x += LDBL_TRUE_MIN;
+ if (x == 0.0L) /* Handle negative LDBL_TRUE_MIN case. */
+ x = -0.0L;
+ return x;
+ }
+ /* If the high double is an exact power of two and the low
+ double is the opposite sign, then 1ulp is one less than
+ what we might determine from the high double. Similarly
+ if X is an exact power of two, and negative, because
+ making it a little larger will result in the exponent
+ decreasing by one and normalisation of the mantissa. */
+ if ((hx & 0x000fffffffffffffLL) == 0
+ && ((lx != 0 && lx != 0x8000000000000000LL && (hx ^ lx) < 0)
+ || ((lx == 0 || lx == 0x8000000000000000LL) && hx < 0)))
+ ihx -= 1LL << 52;
+ if (ihx < (106LL << 52))
+ { /* ulp will denormal. */
+ INSERT_WORDS64 (yhi, ihx & (0x7ffLL << 52));
+ u = yhi * 0x1p-105;
+ }
+ else
+ {
+ INSERT_WORDS64 (yhi, (ihx & (0x7ffLL << 52)) - (105LL << 52));
+ u = yhi;
+ }
+ return x + u;
+}
+
+weak_alias (__nextupl, nextupl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
index 20e17cc823..d87bce7982 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -31,7 +31,7 @@ long double
__remquol (long double x, long double y, int *quo)
{
int64_t hx,hy;
- u_int64_t sx,lx,ly,qs;
+ uint64_t sx,lx,ly,qs;
int cquo;
double xhi, xlo, yhi, ylo;
@@ -43,7 +43,9 @@ __remquol (long double x, long double y, int *quo)
EXTRACT_WORDS64 (ly, ylo);
sx = hx & 0x8000000000000000ULL;
qs = sx ^ (hy & 0x8000000000000000ULL);
+ ly ^= hy & 0x8000000000000000ULL;
hy &= 0x7fffffffffffffffLL;
+ lx ^= sx;
hx &= 0x7fffffffffffffffLL;
/* Purge off exception values. */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
index 8c51ded1d6..f003609d95 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_rintl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,10 +22,17 @@
#include <math.h>
#include <fenv.h>
+#include <math-barriers.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
+#ifdef USE_AS_NEARBYINTL
+# define rintl nearbyintl
+# define __rintl __nearbyintl
+#endif
+
long double
__rintl (long double x)
@@ -44,7 +51,11 @@ __rintl (long double x)
/* Long double arithmetic, including the canonicalisation below,
only works in round-to-nearest mode. */
+#ifdef USE_AS_NEARBYINTL
+ SET_RESTORE_ROUND_NOEX (FE_TONEAREST);
+#else
fesetround (FE_TONEAREST);
+#endif
/* Convert the high double to integer. */
orig_xh = xh;
@@ -103,8 +114,16 @@ __rintl (long double x)
if (orig_xh < 0.0)
xh = -__builtin_fabs (xh);
+#ifdef USE_AS_NEARBYINTL
+ math_force_eval (xh);
+ math_force_eval (xl);
+#else
fesetround (save_round);
+#endif
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
new file mode 100644
index 0000000000..84950e215f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c
@@ -0,0 +1,70 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+
+long double
+__roundevenl (long double x)
+{
+ double xh, xl, hi;
+
+ ldbl_unpack (x, &xh, &xl);
+
+ if (xh != 0 && isfinite (xh))
+ {
+ hi = __roundeven (xh);
+ if (hi != xh)
+ {
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero in the
+ opposite direction to the rounding of the high part. */
+ double diff = hi - xh;
+ if (fabs (diff) == 0.5)
+ {
+ if (xl < 0 && diff > 0)
+ xh = hi - 1;
+ else if (xl > 0 && diff < 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
+ }
+ else
+ {
+ /* The high part is a nonzero integer. Rounding the low
+ part to nearest, ties round to even, is always correct,
+ as a high part that is an odd integer together with a low
+ part with magnitude 0.5 is not a valid long double. */
+ xl = __roundeven (xl);
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
+ }
+ }
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
+
+ return ldbl_pack (xh, xl);
+}
+weak_alias (__roundevenl, roundevenl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
index 20813ed366..94a62dcd6c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_roundl.c
@@ -1,6 +1,6 @@
/* Round to int long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
when it's coded in C. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -38,47 +39,48 @@ __roundl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is exactly 0.5. nearbyint
- rounds values halfway between integers to the nearest even
- integer. roundl must round away from zero.
- Also correct cases where nearbyint returns an incorrect value
- for LO. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
- if (xh == 0.5)
+ hi = __round (xh);
+ if (hi != xh)
{
- if (xl > 0.0 || (xl == 0.0 && orig_xh > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part only
+ affects the result if the high part is exactly half way
+ between two integers and the low part is nonzero with the
+ opposite sign. */
+ if (fabs (hi - xh) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xh = hi - 1;
+ else if (xh < 0 && xl > 0)
+ xh = hi + 1;
+ else
+ xh = hi;
+ }
+ else
+ xh = hi;
+ xl = 0;
}
- else if (-xh == 0.5)
+ else
{
- if (xl < 0.0 || (xl == 0.0 && orig_xh < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = __round (xl);
+ if (fabs (lo - xl) == 0.5)
+ {
+ if (xh > 0 && xl < 0)
+ xl = lo + 1;
+ else if (xh < 0 && lo > 0)
+ xl = lo - 1;
+ else
+ xl = lo;
+ }
+ else
+ xl = lo;
+ xh = hi;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
new file mode 100644
index 0000000000..bb07a3533a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadl, setpayloadl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
new file mode 100644
index 0000000000..e5b49d03a2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadl_main.c
@@ -0,0 +1,60 @@
+/* Set NaN payload. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3ff
+#define PAYLOAD_DIG 51
+#define EXPLICIT_MANT_DIG 52
+
+int
+FUNC (long double *x, long double payload)
+{
+ double hi, lo;
+ uint64_t hx, lx;
+
+ ldbl_unpack (payload, &hi, &lo);
+ EXTRACT_WORDS64 (hx, hi);
+ EXTRACT_WORDS64 (lx, lo);
+ int exponent = hx >> EXPLICIT_MANT_DIG;
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. All valid
+ arguments have the low part zero. */
+ if ((lx & 0x7fffffffffffffffULL) != 0
+ || exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT && hx == 0))
+ || (hx & ((1ULL << (BIAS + EXPLICIT_MANT_DIG - exponent)) - 1)) != 0)
+ {
+ *x = 0.0L;
+ return 1;
+ }
+ if (hx != 0)
+ {
+ hx &= (1ULL << EXPLICIT_MANT_DIG) - 1;
+ hx |= 1ULL << EXPLICIT_MANT_DIG;
+ hx >>= BIAS + EXPLICIT_MANT_DIG - exponent;
+ }
+ hx |= 0x7ff0000000000000ULL | (SET_HIGH_BIT ? 0x8000000000000ULL : 0);
+ INSERT_WORDS64 (hi, hx);
+ *x = ldbl_pack (hi, 0.0);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
new file mode 100644
index 0000000000..4e920360d4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+weak_alias (__setpayloadsigl, setpayloadsigl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
index b4e8256329..2f7eb62ee8 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
index fae4020a7b..ca4f9dff2f 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz>.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
index e6457a1c1c..3504862402 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@@ -41,6 +41,7 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <math_ldbl_opt.h>
static const long double one=1.0L, two=2.0L, tiny = 1.0e-300L;
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
new file mode 100644
index 0000000000..9f20e01adc
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c
@@ -0,0 +1,63 @@
+/* Total order operation. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorderl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t hx_sign = hx >> 63;
+ uint64_t hy_sign = hy >> 63;
+ int64_t hx_adj = hx ^ (hx_sign >> 1);
+ int64_t hy_adj = hy ^ (hy_sign >> 1);
+ if (hx_adj < hy_adj)
+ return 1;
+ else if (hx_adj > hy_adj)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if ((hx & 0x7fffffffffffffffULL) >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
+weak_alias (__totalorderl, totalorderl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
new file mode 100644
index 0000000000..d8027ffbb0
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c
@@ -0,0 +1,65 @@
+/* Total order operation on absolute values. ldbl-128ibm version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagl (long double x, long double y)
+{
+ double xhi, xlo, yhi, ylo;
+ int64_t hx, hy, lx, ly;
+
+ ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi);
+ ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint64_t x_sign = hx & 0x8000000000000000ULL;
+ uint64_t y_sign = hy & 0x8000000000000000ULL;
+ hx ^= x_sign;
+ hy ^= y_sign;
+ if (hx < hy)
+ return 1;
+ else if (hx > hy)
+ return 0;
+
+ /* The high doubles are identical. If they are NaNs or both the low
+ parts are zero, the low parts are not significant (and if they
+ are infinities, both the low parts must be zero). */
+ if (hx >= 0x7ff0000000000000ULL)
+ return 1;
+ EXTRACT_WORDS64 (lx, xlo);
+ EXTRACT_WORDS64 (ly, ylo);
+ if (((lx | ly) & 0x7fffffffffffffffULL) == 0)
+ return 1;
+ lx ^= x_sign;
+ ly ^= y_sign;
+
+ /* Otherwise compare the low parts. */
+ uint64_t lx_sign = lx >> 63;
+ uint64_t ly_sign = ly >> 63;
+ lx ^= lx_sign >> 1;
+ ly ^= ly_sign >> 1;
+ return lx <= ly;
+}
+weak_alias (__totalordermagl, totalordermagl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
index df58b64b53..a915a01ac6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_truncl.c
@@ -1,6 +1,6 @@
/* Truncate (toward zero) long double floating-point values.
IBM extended format long double version.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
#include <ieee754.h>
@@ -35,51 +36,26 @@ __truncl (long double x)
&& __builtin_isless (__builtin_fabs (xh),
__builtin_inf ()), 1))
{
- double orig_xh;
-
- /* Long double arithmetic, including the canonicalisation below,
- only works in round-to-nearest mode. */
-
- /* Convert the high double to integer. */
- orig_xh = xh;
- hi = ldbl_nearbyint (xh);
-
- /* Subtract integral high part from the value. */
- xh -= hi;
- ldbl_canonicalize (&xh, &xl);
-
- /* Now convert the low double, adjusted for any remainder from the
- high double. */
- lo = ldbl_nearbyint (xh);
-
- /* Adjust the result when the remainder is non-zero. nearbyint
- rounds values to the nearest integer, and values halfway
- between integers to the nearest even integer. floorl must
- round towards -Inf. */
- xh -= lo;
- ldbl_canonicalize (&xh, &xl);
-
- if (orig_xh < 0.0)
+ hi = __trunc (xh);
+ if (hi != xh)
{
- if (xh > 0.0 || (xh == 0.0 && xl > 0.0))
- lo += 1.0;
+ /* The high part is not an integer; the low part does not
+ affect the result. */
+ xh = hi;
+ xl = 0;
}
else
{
- if (xh < 0.0 || (xh == 0.0 && xl < 0.0))
- lo -= 1.0;
+ /* The high part is a nonzero integer. */
+ lo = xh > 0 ? __floor (xl) : __ceil (xl);
+ xh = hi;
+ xl = lo;
+ ldbl_canonicalize_int (&xh, &xl);
}
-
- /* Ensure the final value is canonical. In certain cases,
- rounding causes hi,lo calculated so far to be non-canonical. */
- xh = hi;
- xl = lo;
- ldbl_canonicalize (&xh, &xl);
-
- /* Ensure we return -0 rather than +0 when appropriate. */
- if (orig_xh < 0.0)
- xh = -__builtin_fabs (xh);
}
+ else
+ /* Quiet signaling NaN arguments. */
+ xh += xh;
return ldbl_pack (xh, xl);
}
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
new file mode 100644
index 0000000000..2176aa0cdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpl, ufromfpl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
new file mode 100644
index 0000000000..2901151312
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+weak_alias (__ufromfpxl, ufromfpxl)
diff --git a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
index a8181740a8..862fd533be 100644
--- a/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,6 @@
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
-#include <xlocale.h>
/* The actual implementation for all floating point sizes is in strtod.c.
These macros tell it to produce the `long double' version, `strtold'. */
@@ -26,13 +25,13 @@
#define FLOAT long double
#define FLT LDBL
#ifdef USE_WIDE_CHAR
-extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t);
# define STRTOF __new_wcstold_l
# define __STRTOF ____new_wcstold_l
# define ____STRTOF_INTERNAL ____wcstold_l_internal
# define STRTOF_NAN __wcstold_nan
#else
-extern long double ____new_strtold_l (const char *, char **, __locale_t);
+extern long double ____new_strtold_l (const char *, char **, locale_t);
# define STRTOF __new_strtold_l
# define __STRTOF ____new_strtold_l
# define ____STRTOF_INTERNAL ____strtold_l_internal
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_expl.h b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
new file mode 100644
index 0000000000..ca2481caa1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
@@ -0,0 +1,970 @@
+/* Accurate table for expl().
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* __expl_table basically consists of four tables, T_EXPL_ARG{1,2} and
+ T_EXPL_RES{1,2}. All tables use positive and negative indexes, the 0 points
+ are marked by T_EXPL_* defines.
+ For ARG1 and RES1 tables lets B be 89 and S 256.0, for ARG2 and RES2 B is 65
+ and S 32768.0.
+ These table have the property that, for all integers -B <= i <= B
+ expl(__expl_table[T_EXPL_ARGN+2*i]+__expl_table[T_EXPL_ARGN+2*i+1]+r) ==
+ __expl_table[T_EXPL_RESN+i], __expl_table[T_EXPL_RESN+i] is some exact number
+ with the low 58 bits of the mantissa 0,
+ __expl_table[T_EXPL_ARGN+2*i] == i/S+s
+ where absl(s) <= 2^-54 and absl(r) <= 2^-212. */
+
+
+static const long double __expl_table [] = {
+ -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
+ 6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
+ -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
+ -7.16021898043268093462818380603370350E-33L, /* bf94296c8219427edc1431ac2498583e */
+ -3.39843750000000013418643523138766329E-01L, /* bffd5c000000000003de1f027a30e000 */
+ 8.16920774283317801641347327589583265E-32L, /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ -3.35937500000000014998092453039303051E-01L, /* bffd5800000000000452a9f4d8857000 */
+ -6.55865578425428447938248396879359670E-32L, /* bf97548b7d240f3d034b395e6eecfac8 */
+ -3.32031250000000000981984049529998541E-01L, /* bffd540000000000004875277cda5000 */
+ 6.91213046334032232108944519541512737E-32L, /* 3f9766e5f925338a19045c94443b66e1 */
+ -3.28124999999999986646017645350399708E-01L, /* bffd4ffffffffffffc26a667bf44d000 */
+ -6.16281060996110316602421505683742661E-32L, /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ -3.24218749999999991645717430645867963E-01L, /* bffd4bfffffffffffd97901063e48000 */
+ -7.90797211087760527593856542417304137E-32L, /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ -3.20312499999999998918211610690789652E-01L, /* bffd47ffffffffffffb02d9856d71000 */
+ 8.64024799457616856987630373786503376E-32L, /* 3f97c0a098623f95579d5d9b2b67342d */
+ -3.16406249999999998153974811017181883E-01L, /* bffd43ffffffffffff77c991f1076000 */
+ -2.73176610180696076418536105483668404E-32L, /* bf961baeccb32f9b1fcbb8e60468e95a */
+ -3.12500000000000011420976192575972779E-01L, /* bffd400000000000034ab8240483d000 */
+ 7.16573502812389453744433792609989420E-32L, /* 3f977410f4c2cfc4335f28446c0fb363 */
+ -3.08593750000000001735496343854851414E-01L, /* bffd3c000000000000800e995c176000 */
+ -1.56292999645122272621237565671593071E-32L, /* bf95449b9cbdaff6ac1246adb2c826ac */
+ -3.04687499999999982592401295899221626E-01L, /* bffd37fffffffffffafb8bc1e061a000 */
+ 6.48993208584888904958594509625158417E-32L, /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ -3.00781249999999999230616898937763959E-01L, /* bffd33ffffffffffffc73ac39da54000 */
+ 6.57082437496961397305801409357792029E-32L, /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ -2.96874999999999998788769281703245722E-01L, /* bffd2fffffffffffffa6a07fa5021000 */
+ -3.26588297198283968096426564544269170E-32L, /* bf9653260fc1802f46b629aee171809b */
+ -2.92968750000000015318089182805941695E-01L, /* bffd2c0000000000046a468614bd6000 */
+ -1.73291974845198589684358727559290718E-32L, /* bf9567e9d158f52e483c8d8dcb5961dd */
+ -2.89062500000000007736778942676309681E-01L, /* bffd280000000000023adf9f4c3d3000 */
+ -6.83629745986675744404029225571026236E-32L, /* bf9762f5face6281c1daf1c6aedbdb45 */
+ -2.85156250000000001367091555763661937E-01L, /* bffd2400000000000064dfa11e3fb000 */
+ -5.44898442619766878281110054067026237E-32L, /* bf971aed6d2db9f542986a785edae072 */
+ -2.81249999999999986958718100227029406E-01L, /* bffd1ffffffffffffc3db9265ca9d000 */
+ 1.13007318374506125723591889451107046E-32L, /* 3f94d569fe387f456a97902907ac3856 */
+ -2.77343750000000000356078829380495179E-01L, /* bffd1c0000000000001a462390083000 */
+ -4.98979365468978332358409063436543102E-32L, /* bf970315bbf3e0d14b5c94c900702d4c */
+ -2.73437499999999990276993957508540484E-01L, /* bffd17fffffffffffd32919bcdc94000 */
+ -8.79390484115892344533724650295100871E-32L, /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ -2.69531250000000002434203866460082225E-01L, /* bffd14000000000000b39ccf9e130000 */
+ 9.44060754687026590886751809927191596E-32L, /* 3f97ea2f32cfecca5c64a26137a9210f */
+ -2.65624999999999997296320716986257179E-01L, /* bffd0fffffffffffff3880f13a2bc000 */
+ 2.07142664067265697791007875348396921E-32L, /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ -2.61718750000000010237478733739017956E-01L, /* bffd0c000000000002f3648179d40000 */
+ -6.10552936159265665298996309192680256E-32L, /* bf973d0467d31e407515a3cca0f3b4e2 */
+ -2.57812500000000011948220522778370303E-01L, /* bffd08000000000003719f81275bd000 */
+ 6.72477169058908902499239631466443836E-32L, /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ -2.53906249999999991822993360536596860E-01L, /* bffd03fffffffffffda4a4b62f818000 */
+ -2.44868296623215865054704392917190994E-32L, /* bf95fc92516c6d057d29fc2528855976 */
+ -2.49999999999999986862019457428548084E-01L, /* bffcfffffffffffff86d2d20d5ff4000 */
+ -3.85302898949105073614122724961613078E-32L, /* bf96901f147cb7d643af71b6129ce929 */
+ -2.46093750000000000237554160737318435E-01L, /* bffcf8000000000000230e8ade26b000 */
+ -1.52823675242678363494345369284988589E-32L, /* bf953d6700c5f3fc303f79d0ec8c680a */
+ -2.42187500000000003023380963205457065E-01L, /* bffcf0000000000001be2c1a78bb0000 */
+ -7.78402037952209709489481182714311699E-34L, /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ -2.38281249999999995309623303145485725E-01L, /* bffce7fffffffffffd4bd2940f43f000 */
+ -3.54307216794236899443913216397197696E-32L, /* bf966fef03ab69c3f289436205b21d02 */
+ -2.34374999999999998425804947623207526E-01L, /* bffcdfffffffffffff17b097a6092000 */
+ -2.86038428948386602859761879407549696E-32L, /* bf96290a0eba0131efe3a05fe188f2e3 */
+ -2.30468749999999993822207406785200832E-01L, /* bffcd7fffffffffffc70519834eae000 */
+ -2.54339521031747516806893838749365762E-32L, /* bf96081f0ad7f9107ae6cddb32c178ab */
+ -2.26562499999999997823524030344489884E-01L, /* bffccffffffffffffebecf10093df000 */
+ 4.31904611473158635644635628922959401E-32L, /* 3f96c083f0b1faa7c4c686193e38d67c */
+ -2.22656250000000004835132405125162742E-01L, /* bffcc8000000000002c98a233f19f000 */
+ 2.54709791629335691650310168420597566E-33L, /* 3f92a735903f5eed07a716ab931e20d9 */
+ -2.18749999999999988969454021829236626E-01L, /* bffcbffffffffffff9a42dc14ce36000 */
+ -3.77236096429336082213752014054909454E-32L, /* bf9687be8e5b2fca54d3e81157eac660 */
+ -2.14843750000000010613256919115758495E-01L, /* bffcb80000000000061e3d828ecac000 */
+ -4.55194148712216691177097854305964738E-32L, /* bf96d8b35c776aa3e1a4768271380503 */
+ -2.10937499999999993204656148110447201E-01L, /* bffcaffffffffffffc152f2aea118000 */
+ -2.95044199165561453749332254271716417E-32L, /* bf96326433b00b2439094d9bef22ddd1 */
+ -2.07031250000000012233944895423355677E-01L, /* bffca80000000000070d695ee0e94000 */
+ 1.93146788688385419095981415411012357E-32L, /* 3f959126729135a5e390d4bb802a0bde */
+ -2.03125000000000008030983633336321863E-01L, /* bffca0000000000004a129fbc51af000 */
+ 2.37361904671826193563212931215900137E-32L, /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ -1.99218750000000001763815712796132779E-01L, /* bffc98000000000001044b12d9950000 */
+ -3.63171243370923753295192486732883239E-33L, /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ -1.95312500000000004883660234506677272E-01L, /* bffc90000000000002d0b3779d1f9000 */
+ -3.19989507343607877747980892249711601E-33L, /* bf9309d63de96bb3ef744c865f22f1bd */
+ -1.91406250000000013720152363227519348E-01L, /* bffc88000000000007e8bcb387121000 */
+ -1.89295754093147174148371614722178860E-32L, /* bf958926e2e67dfe812c508290add2e7 */
+ -1.87500000000000000182342082774432620E-01L, /* bffc800000000000001ae8b06a39f000 */
+ -2.96812835183184815200854214892983927E-32L, /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ -1.83593750000000012410147185883290345E-01L, /* bffc78000000000007276a1adda8d000 */
+ -2.02191931237489669058466239995304587E-32L, /* bf95a3efab92d26ec2df90df036a117f */
+ -1.79687499999999997439177363346082917E-01L, /* bffc6ffffffffffffe8616db2927d000 */
+ -9.92752326937775530007399526834009465E-33L, /* bf949c5f88ed17041e1a3f1829d543cd */
+ -1.75781249999999995824373974504785174E-01L, /* bffc67fffffffffffd97c94f13ea3000 */
+ 1.44184772065335613487885714828816178E-32L, /* 3f952b75c63476e7fcc2f5841c27bcce */
+ -1.71874999999999986685050259043077809E-01L, /* bffc5ffffffffffff8530f6bc531a000 */
+ -3.49007014971241147689894940544402482E-32L, /* bf966a6dfaa012aea8ffe6d90b02330f */
+ -1.67968749999999997316058782350439701E-01L, /* bffc57fffffffffffe73eb914f2aa000 */
+ 3.34025733574205019081305778794376391E-32L, /* 3f965adf4572561fd5456a6c13d8babf */
+ -1.64062499999999993322730602128318480E-01L, /* bffc4ffffffffffffc269be4f68f3000 */
+ -1.83345916769684984022099095506340635E-32L, /* bf957ccb69026cb2f6024c211576d5f4 */
+ -1.60156249999999992419000744447607979E-01L, /* bffc47fffffffffffba13df21784a000 */
+ 2.73442789798110494773517431626534726E-32L, /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ -1.56249999999999987665010524130393080E-01L, /* bffc3ffffffffffff8e3ad45e7508000 */
+ 2.02695576464836145806428118889332191E-32L, /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ -1.52343749999999989905291167951491803E-01L, /* bffc37fffffffffffa2e48aecfc24000 */
+ -3.61436631548815190395331054871041524E-32L, /* bf967756567ebd108075ae527cc2e7f0 */
+ -1.48437500000000006686107754967759751E-01L, /* bffc30000000000003dab20261b3c000 */
+ -2.15524270159131591469319477922198390E-32L, /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ -1.44531250000000005132889939177166485E-01L, /* bffc28000000000002f57b1969e7b000 */
+ 2.74741116529653547935086189244019604E-32L, /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ -1.40625000000000000707469094533647325E-01L, /* bffc2000000000000068676d3d5c4000 */
+ 4.40607097220049957013547629906723266E-33L, /* 3f936e0ac425daf795b42913cf0ef881 */
+ -1.36718749999999995713752139187543306E-01L, /* bffc17fffffffffffd87762255991000 */
+ -3.73751317180116492404578048203389108E-32L, /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ -1.32812500000000007198453630478482191E-01L, /* bffc10000000000004264de3a4379000 */
+ -3.97050085179660203884930593717220728E-32L, /* bf969c52048de14be3c9c1971e50869c */
+ -1.28906250000000006070486371645733082E-01L, /* bffc080000000000037fd87db2cb0000 */
+ 3.59610068058504988294019521946586131E-32L, /* 3f967570c10687cb8e9ebd0b280abf5a */
+ -1.25000000000000003700729208608337966E-01L, /* bffc00000000000002222198bbc74000 */
+ 3.23464851393124362331846965931995969E-33L, /* 3f930cb95da3bfc847e593716c91d57a */
+ -1.21093750000000013729038501177102555E-01L, /* bffbf000000000000fd418d1f5fda000 */
+ 2.45242487730722066611358741283977619E-32L, /* 3f95fd5945ad86a464292e26ac192a84 */
+ -1.17187499999999999765305306880205578E-01L, /* bffbdfffffffffffffbabaf869845000 */
+ -1.14557520298960389903199646350205537E-32L, /* bf94dbda735322179d9bcf392e1dd06d */
+ -1.13281250000000009579647893740755690E-01L, /* bffbd000000000000b0b69bae7ab9000 */
+ 2.37873962873837390105423621772752350E-32L, /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ -1.09375000000000008981153004560108539E-01L, /* bffbc000000000000a5ac4bc1d2c3000 */
+ 1.53152444860014076105003555837231015E-32L, /* 3f953e15ce931e12ef9a152522e32bdd */
+ -1.05468749999999992399063850363228723E-01L, /* bffbaffffffffffff73c998091408000 */
+ -8.75920903597804862471749360196688834E-33L, /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ -1.01562500000000007685885179918350550E-01L, /* bffba0000000000008dc7910a648c000 */
+ -4.63820993797174451904075397785059501E-33L, /* bf938153d0e54001a472da180fb5e8aa */
+ -9.76562499999999887262211517861331814E-02L, /* bffb8ffffffffffff300915aa6fd6000 */
+ -2.63767025974952608658936466715705903E-33L, /* bf92b64215bb8d520be5404620d38088 */
+ -9.37499999999999939650246024457439795E-02L, /* bffb7ffffffffffff90aca26bd0fc000 */
+ -1.72047822349322956713582039121348377E-32L, /* bf9565545015c5b9b56d02cfefca2c7d */
+ -8.98437500000000033088896383977486369E-02L, /* bffb70000000000003d09ca1e3cbe000 */
+ 3.04831994420989436248526129869697270E-33L, /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ -8.59374999999999947312400115121319225E-02L, /* bffb5ffffffffffff9ecefc03376e000 */
+ 1.50416954438393392150792422537312281E-32L, /* 3f9538675ee99bd722fad0023c09c915 */
+ -8.20312500000000054182280847004695514E-02L, /* bffb500000000000063f2dbd40200000 */
+ 2.68399664523430004488075638997207289E-33L, /* 3f92bdf49766629882c49a3da88928ed */
+ -7.81250000000000114767533968079748798E-02L, /* bffb4000000000000d3b56f81ba70000 */
+ 1.72318124201659121296305402819694281E-32L, /* 3f9565e407aaabfb359e8a567d760de3 */
+ -7.42187500000000035531829472486812869E-02L, /* bffb3000000000000418b6e9b5388000 */
+ 2.09401756478514117051383998628099655E-32L, /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ -7.03124999999999987474933134860732535E-02L, /* bffb1ffffffffffffe8e53453d2ac000 */
+ 2.28515798224350800271565551341211666E-32L, /* 3f95da9bd6adf00894f05b5cc5530125 */
+ -6.64062500000000042267533361089054159E-02L, /* bffb10000000000004df8473dbcf2000 */
+ 1.97576478800281368377376002585430031E-32L, /* 3f959a59acbddb2f53bd3096b66370e9 */
+ -6.25000000000000066329769382774201686E-02L, /* bffb00000000000007a5b5914e336000 */
+ -1.46422615813786836245343723048221678E-33L, /* bf91e69295f069fc0c4a9db181ea25a3 */
+ -5.85937500000000002823707957982406053E-02L, /* bffae0000000000000a6aeab10592000 */
+ 9.25637741701318872896718218457555829E-33L, /* 3f94807eb021f1f40a37d4015b1eb76b */
+ -5.46875000000000081586888005226044448E-02L, /* bffac0000000000012d00a3171e3a000 */
+ -4.87144542459404765480424673678105050E-33L, /* bf9394b42faba6b7036fe7b36269daf3 */
+ -5.07812499999999927720348253140567013E-02L, /* bffa9fffffffffffef555cc8dd914000 */
+ -3.01901021987395945826043649523451725E-33L, /* bf92f59e7e3025691f290f8f67277faf */
+ -4.68749999999999935349476738962633103E-02L, /* bffa7ffffffffffff117b4ea2b876000 */
+ 1.21521638219189777347767475937119750E-32L, /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ -4.29687500000000056305562847814228219E-02L, /* bffa6000000000000cfbb19be30c0000 */
+ -1.18643699217679276275559592978275214E-32L, /* bf94ecd39f0833a876550e83eb012b99 */
+ -3.90624999999999962692914526031373542E-02L, /* bffa3ffffffffffff765c743922f9000 */
+ -4.91277156857520035712509544689973679E-33L, /* bf939823189996193872e58ac0dececb */
+ -3.51562500000000108152468207687602886E-02L, /* bffa20000000000018f031e41177f000 */
+ 1.18599806302656253755207072755609820E-32L, /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ -3.12500000000000077376981036742289578E-02L, /* bffa00000000000011d787e0b386f000 */
+ 9.97730386477005171963635210799577079E-33L, /* 3f949e70e498c46a0173ac0d46c699fc */
+ -2.73437500000000139436129596418623235E-02L, /* bff9c00000000000404db66e70a08000 */
+ 2.25755321633070123579875157841633859E-33L, /* 3f927719b1a93074bdf9f3c2cb784785 */
+ -2.34375000000000088003629211828324876E-02L, /* bff98000000000002895a27d45feb000 */
+ 2.84374279216848803102126617873942975E-33L, /* 3f92d87f70e749d6da6c260b68dc210b */
+ -1.95312500000000107408831063404855424E-02L, /* bff9400000000000318898ba69f71000 */
+ 2.47348089686935458989103979140011912E-33L, /* 3f929afa3de45086fe909fdddb41edce */
+ -1.56250000000000081443917555362290635E-02L, /* bff9000000000000258f335e9cdd6000 */
+ -2.43379314483517422161458863218426254E-33L, /* bf9294621c8a9ccacf2b020ec19cad27 */
+ -1.17187500000000051490597418161403184E-02L, /* bff88000000000002f7ddfa26221f000 */
+ 1.83405297208145390679150568810924707E-33L, /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ -7.81249999999999715861805208310174953E-03L, /* bff7ffffffffffffcb95f3fff157d000 */
+ 3.51548384878710915171654413641872451E-34L, /* 3f8fd349b76c22966f77a39fc37ed704 */
+ -3.90625000000000309326013918295097128E-03L, /* bff7000000000000390f820c8e153000 */
+ 6.38058004651791109324060099097251911E-36L, /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+#define T_EXPL_ARG1 (2*89)
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 3.90625000000000245479958859972588985E-03L, /* 3ff70000000000002d48769ac9874000 */
+ -6.58439598384342854976169982902779828E-36L, /* bf8a1811b923e6c626b07ef29761482a */
+ 7.81250000000001311374391093664996358E-03L, /* 3ff800000000000078f3f3cd89111000 */
+ 2.60265650555493781464273319671555602E-33L, /* 3f92b070c3b635b87af426735a71fc87 */
+ 1.17187500000000269581156218247101912E-02L, /* 3ff8800000000000f8a50d02fe20d000 */
+ 1.00961747974945520631836275894919326E-33L, /* 3f914f80c1a4f8042044fe3b757b030b */
+ 1.56249999999999797878275270751825475E-02L, /* 3ff8ffffffffffff45935b69da62e000 */
+ 2.03174577741375590087897353146748580E-33L, /* 3f925194e863496e0f6e91cbf6b22e26 */
+ 1.95312499999999760319884511789111533E-02L, /* 3ff93fffffffffff917790ff9a8f4000 */
+ 4.62788519658803722282100289809515007E-33L, /* 3f9380783ba81295feeb3e4879d7d52d */
+ 2.34374999999999822953909016349145918E-02L, /* 3ff97fffffffffffae5a163bd3cd5000 */
+ -3.19499956304699705390404384504876533E-33L, /* bf93096e2037ced8194cf344c692f8d6 */
+ 2.73437500000000137220327275871555682E-02L, /* 3ff9c000000000003f481dea5dd51000 */
+ -2.25757776523031994464630107442723424E-33L, /* bf92771abcf988a02b414bf2614e3734 */
+ 3.12499999999999790857640618332718621E-02L, /* 3ff9ffffffffffff9f8cd40b51509000 */
+ -4.22479470489989916319395454536511458E-33L, /* bf935efb7245612f371deca17cb7b30c */
+ 3.51562499999999840753382405747597346E-02L, /* 3ffa1fffffffffffdb47bd275f722000 */
+ 1.08459658374118041980976756063083500E-34L, /* 3f8e2055d18b7117c9db1c318b1e889b */
+ 3.90624999999999989384433621470426757E-02L, /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ -7.41674226146122000759491297811091830E-33L, /* bf94341454e48029e5b0205d91baffdc */
+ 4.29687500000000107505739500500200462E-02L, /* 3ffa60000000000018ca04cd9085c000 */
+ -4.74689012756713017494437969420919847E-34L, /* bf903b7c268103c6f7fbaaa24142e287 */
+ 4.68749999999999978700749928325717352E-02L, /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ -1.06208165308448830117773486334902917E-32L, /* bf94b92be4b3b5b5a596a0a5187cc955 */
+ 5.07812499999999815072625435955786253E-02L, /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ -9.37038897148383660401929567549111394E-33L, /* bf94853b111b0175b491c80d00419416 */
+ 5.46874999999999809511553152189867394E-02L, /* 3ffabfffffffffffd4138bfa74a61000 */
+ 1.06642963074562437340498606682822123E-32L, /* 3f94bafa3fe991b39255d563dfa05d89 */
+ 5.85937500000000184331996330905145551E-02L, /* 3ffae000000000002a810a5f2f8bf000 */
+ -1.76639977694797200820296641773791945E-34L, /* bf8ed596f07ce4408f1705c8ec16864c */
+ 6.25000000000000021544696744852045001E-02L, /* 3ffb000000000000027be32045e2b000 */
+ 1.68616371995798354366633034788947149E-32L, /* 3f955e33d7440794d8a1b25233d086ab */
+ 6.64062499999999965563110718495802889E-02L, /* 3ffb0ffffffffffffc079a38a3fed000 */
+ -1.82463217667830160048872113565316215E-32L, /* bf957af6163bcdb97cefab44a942482a */
+ 7.03124999999999759989183341261898222E-02L, /* 3ffb1fffffffffffe454218acea05000 */
+ -1.07843770101525495515646940862541503E-32L, /* bf94bff72aada26d94e76e71c07e0580 */
+ 7.42187499999999898968873730710101412E-02L, /* 3ffb2ffffffffffff45a166496dc1000 */
+ 1.28629441689592874462780757154138223E-32L, /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+ 7.81249999999999957198938523510804668E-02L, /* 3ffb3ffffffffffffb10bc52adbc5000 */
+ 1.13297573459968118467100063135856856E-33L, /* 3f91787eea895b3c245899cf34ad0abd */
+ 8.20312500000000199911640621145851159E-02L, /* 3ffb500000000000170c59a661a89000 */
+ -1.51161335208135146756554123073528707E-32L, /* bf9539f326c5ca84e7db5401566f3775 */
+ 8.59375000000000134175373433347670743E-02L, /* 3ffb6000000000000f78287547af0000 */
+ 1.09763629458404270323909815379924900E-32L, /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+ 8.98437500000000036533922600308306335E-02L, /* 3ffb70000000000004364a83b7a14000 */
+ 3.11459653680110433194288029777718358E-33L, /* 3f9302c0248136d65cebeab69488d949 */
+ 9.37500000000000184977946245216914691E-02L, /* 3ffb800000000000155395d870b17000 */
+ -4.66656154468277949130395786965043927E-33L, /* bf9383aec9b993b6db492b1ede786d8a */
+ 9.76562500000000237839723100419376084E-02L, /* 3ffb9000000000001b6bca237f6c4000 */
+ -1.03028043424658760249140747856831301E-32L, /* bf94abf6352e3d2bb398e47919a343fb */
+ 1.01562500000000012345545575236836572E-01L, /* 3ffba000000000000e3bc30cd9a1f000 */
+ 2.15755372310795701322789783729456319E-32L, /* 3f95c01b3b819edd9d07548fafd61550 */
+ 1.05468749999999976493840484471911438E-01L, /* 3ffbafffffffffffe4e634cd77985000 */
+ 1.78771847038773333029677216592309083E-32L, /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+ 1.09375000000000002267015055992785402E-01L, /* 3ffbc00000000000029d1ad08de7b000 */
+ 6.23263106693943817730045115112427717E-33L, /* 3f9402e4b39ce2198a45e1d045868cd6 */
+ 1.13281250000000022354208618429577398E-01L, /* 3ffbd0000000000019c5cc3f9d2b5000 */
+ 5.40514416644786448581426756221178868E-33L, /* 3f93c10ab4021472c662f69435de9269 */
+ 1.17187500000000013252367133076817603E-01L, /* 3ffbe000000000000f47688cc561b000 */
+ -7.12412585457324989451327215568641325E-33L, /* bf9427ecb343a8d1758990565fcfbf45 */
+ 1.21093750000000020759863992944300792E-01L, /* 3ffbf0000000000017ef3af97bf04000 */
+ 6.26591408357572503875647872077266444E-33L, /* 3f940446a09a2da771b45fc075514d12 */
+ 1.25000000000000004739659392396765618E-01L, /* 3ffc00000000000002bb7344ecd89000 */
+ -1.55611398459729463981000080101758830E-32L, /* bf95433135febefa9e6aa4db39e263d2 */
+ 1.28906249999999982360888081057894783E-01L, /* 3ffc07fffffffffff5d4ed3154361000 */
+ -1.77531518652835570781208599686606474E-32L, /* bf9570b7f225ea076f97f418d11359c1 */
+ 1.32812500000000010568583998727400436E-01L, /* 3ffc1000000000000617a5d09526a000 */
+ 2.12104021624990594668286391598300893E-32L, /* 3f95b885d767a1048d93055927a27adc */
+ 1.36718749999999998434125157367005292E-01L, /* 3ffc17ffffffffffff18eaebc7970000 */
+ 2.50454798592543203967309921276955297E-32L, /* 3f9604164e5598528a76faff26cd1c97 */
+ 1.40625000000000015550032422969330356E-01L, /* 3ffc20000000000008f6c79d8928c000 */
+ 7.80972982879849783680252962992639832E-33L, /* 3f9444674acf2b3225c7647e0d95edf3 */
+ 1.44531250000000012402535562111122522E-01L, /* 3ffc28000000000007264a8bc1ff1000 */
+ 2.79662468716455159585514763921671876E-32L, /* 3f96226b095bd78aa650faf95a221993 */
+ 1.48437500000000007761020440087419948E-01L, /* 3ffc3000000000000479530ff8fe3000 */
+ 2.15518492972728435680556239996258527E-32L, /* 3f95bf9d49295e73a957906a029768cb */
+ 1.52343750000000001733189947520484032E-01L, /* 3ffc38000000000000ffc6109f71f000 */
+ 8.34032236093545825619420380704500188E-33L, /* 3f945a71851226a1d0ce5e656693153e */
+ 1.56249999999999988073295321246958484E-01L, /* 3ffc3ffffffffffff91fedd62ae0f000 */
+ 2.44119337150624789345260194989620908E-32L, /* 3f95fb041a57bc1c1280680ac1620bea */
+ 1.60156250000000002076894210913572460E-01L, /* 3ffc48000000000001327ed84a199000 */
+ -7.36124501128859978061216696286151753E-33L, /* bf9431c62f01e59d2c1e00f195a0037f */
+ 1.64062500000000000950861276373482172E-01L, /* 3ffc500000000000008c5285fba85000 */
+ -4.80566184447001164583855800470217373E-33L, /* bf938f3d1fcafd390f22f80e6c19421f */
+ 1.67968749999999989878071706155265999E-01L, /* 3ffc57fffffffffffa2a445c548c5000 */
+ -4.42154428718618459799673088733365064E-32L, /* bf96cb28cf1c1b28006d53ffe633b22a */
+ 1.71874999999999999459734108403218175E-01L, /* 3ffc5fffffffffffffb04554e9dd4000 */
+ -3.29736288190321377985697972236270628E-32L, /* bf96566af0ebc852e84be12859b24a31 */
+ 1.75781249999999997987525759778901845E-01L, /* 3ffc67fffffffffffed702df6ffff000 */
+ -1.28800728638468399687523924685844352E-32L, /* bf950b8236b88ca0c1b739dc91a7e3fc */
+ 1.79687500000000004929565820437175783E-01L, /* 3ffc70000000000002d779bb32d2e000 */
+ 1.60624461317978482424582320675174225E-32L, /* 3f954d9a9cc0c963fd081f3dc922d04e */
+ 1.83593750000000016873727045739708856E-01L, /* 3ffc78000000000009ba1f6263c9a000 */
+ -3.83390389582056606880506003118452558E-32L, /* bf968e22a5d826f77f19ee788474df22 */
+ 1.87500000000000013443068740761666872E-01L, /* 3ffc80000000000007bfd8c72a1bf000 */
+ -2.74141662712926256150154726565203091E-32L, /* bf961caf5ac59c7f941f928e324c2cc1 */
+ 1.91406249999999981494101786848611970E-01L, /* 3ffc87fffffffffff55502eeae001000 */
+ 3.68992437075565165346469517256118001E-32L, /* 3f967f2f03f9096793372a27b92ad79d */
+ 1.95312499999999989069921848800501648E-01L, /* 3ffc8ffffffffffff9b3015280394000 */
+ 3.69712249337856518452988332367785220E-32L, /* 3f967fee5fdb5bd501ff93516999faa0 */
+ 1.99218750000000021148042946919300804E-01L, /* 3ffc9800000000000c30e67939095000 */
+ 2.50142536781142175091322844848566649E-32L, /* 3f9603c34ae58e10b300b07137ee618a */
+ 2.03124999999999977732559198825437141E-01L, /* 3ffc9ffffffffffff329e7df079e4000 */
+ -2.41951877287895024779300892731537816E-32L, /* bf95f683aefe6965f080df8f59dd34a1 */
+ 2.07031249999999996744030653771913124E-01L, /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ -1.94346475904454000031592792989765585E-32L, /* bf9593a44f87870a3d100d498501ecc7 */
+ 2.10937500000000000251399259834392298E-01L, /* 3ffcb000000000000025199873310000 */
+ -1.33528748788094249098998693871759411E-33L, /* bf91bbb9b25c813668d6103d08acac35 */
+ 2.14843749999999993936323609611875097E-01L, /* 3ffcb7fffffffffffc8128c866236000 */
+ 1.14839877977014974625242788556545292E-32L, /* 3f94dd06b4655c9b83a1305b240e7a42 */
+ 2.18750000000000015181732784749663837E-01L, /* 3ffcc0000000000008c06da5fff24000 */
+ 1.42689085313142539755499441881408391E-32L, /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+ 2.22656249999999992172647770539596569E-01L, /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ -3.34421462850496887359128610229650547E-32L, /* bf965b487962b5c2d9056ca6ac0c2e5c */
+ 2.26562499999999989595607223847082419E-01L, /* 3ffccffffffffffffa0095277be5c000 */
+ -3.08983588107248752517344356508205569E-32L, /* bf9640dded57157f8eded311213bdbcd */
+ 2.30468749999999979130462438434567117E-01L, /* 3ffcd7fffffffffff3f8332996560000 */
+ -3.01407539802851697849105682795217019E-32L, /* bf9638ffde35dbdfe1a1ffe45185de5d */
+ 2.34375000000000012194252337217891971E-01L, /* 3ffce0000000000007078dd402c86000 */
+ -8.46879710915628592284714319904522657E-33L, /* bf945fc7b29a2ac6c9eff9eb258a510f */
+ 2.38281249999999982991877076137149870E-01L, /* 3ffce7fffffffffff6320b486eece000 */
+ -2.93563878880439245627127095245798544E-32L, /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+ 2.42187499999999981447559841442773990E-01L, /* 3ffceffffffffffff54e24a09a8d5000 */
+ -4.56766746558806021264215486909850481E-32L, /* bf96da556dee11f3113e5a3467b908e6 */
+ 2.46093749999999991067720539980207318E-01L, /* 3ffcf7fffffffffffad9d405dcb5d000 */
+ 2.14033004219908074003010247652128251E-32L, /* 3f95bc8776e8f9ae098884aa664cc3df */
+ 2.50000000000000016613825838126835953E-01L, /* 3ffd00000000000004c9e24c12bb3000 */
+ 2.57617532593749185996714235009382870E-32L, /* 3f960b867cc01178c0ec68226c6cb47d */
+ 2.53906250000000013372004437827044321E-01L, /* 3ffd04000000000003daae05b3168000 */
+ 7.20177123439204414298152646284640101E-32L, /* 3f9775eff59ddad7e7530b83934af87f */
+ 2.57812499999999995765234725413886085E-01L, /* 3ffd07fffffffffffec7878bad9d5000 */
+ 6.51253187532920882777046064603770602E-32L, /* 3f975226659ca241402e71c2011583b0 */
+ 2.61718750000000007647689994011222248E-01L, /* 3ffd0c000000000002344cc793a0f000 */
+ 3.02370610028725823590045201871491395E-32L, /* 3f9639ffe55fa2fa011674448b4e5b96 */
+ 2.65624999999999986893899042596554269E-01L, /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ -2.07683715950724761146070082510569258E-32L, /* bf95af579a92e872fef81abfdf06bae8 */
+ 2.69531249999999979842788204900639327E-01L, /* 3ffd13fffffffffffa30a908d67db000 */
+ 8.71465252506557329027658736641075706E-32L, /* 3f97c47d99e19830447a42b1c0ffac61 */
+ 2.73437500000000006712165837793818271E-01L, /* 3ffd18000000000001ef453a58edb000 */
+ -6.62704045767568912140550474455810301E-32L, /* bf9758187a204dcb06ece46588aeeaba */
+ 2.77343749999999994411329302988535617E-01L, /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ -4.87273466291944117406493607771338767E-32L, /* bf96fa0381b0844a0be46bac2d673f0c */
+ 2.81250000000000012677892447379453135E-01L, /* 3ffd20000000000003a7769e125d6000 */
+ -8.55871796664700790726282049552906783E-32L, /* bf97bc64e01332cf7616b0091b8dff2c */
+ 2.85156249999999998558643013736363981E-01L, /* 3ffd23ffffffffffff95a5894bccf000 */
+ -1.33068334720606220176455289635046875E-32L, /* bf95145f43290ecf5b7adcb24697bc73 */
+ 2.89062500000000008831431235621753924E-01L, /* 3ffd280000000000028ba504fac59000 */
+ -9.34157398616814623985483776710704237E-32L, /* bf97e50ad1115b941fcb5f0c88a428f7 */
+ 2.92968750000000019840235286110877063E-01L, /* 3ffd2c000000000005b7f372d184f000 */
+ 4.99302093775173155906059132992249671E-33L, /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+ 2.96875000000000015867911730971630513E-01L, /* 3ffd3000000000000492d860c79db000 */
+ 7.86107787827057767235127454590866211E-33L, /* 3f944689517ee8f16cdb97d6a6938f32 */
+ 3.00781250000000015814100002286124758E-01L, /* 3ffd340000000000048edfe73a17d000 */
+ -1.65419431293024229981937172317171504E-32L, /* bf9557900e3efca16c89646b57f68dc0 */
+ 3.04687499999999985213157159965287195E-01L, /* 3ffd37fffffffffffbbcec6f99b36000 */
+ 9.68753602893894024018934325652944198E-32L, /* 3f97f70170e5458660c33a7e8d43d049 */
+ 3.08593749999999989969324338045156215E-01L, /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+ 7.10268609610294706092252562643261106E-32L, /* 3f9770cae45cdf615010401a4b37d8d4 */
+ 3.12500000000000002971606591018488854E-01L, /* 3ffd40000000000000db440fbc06b000 */
+ 6.38924218802905979887732294952782964E-32L, /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+ 3.16406250000000006594921047402056305E-01L, /* 3ffd44000000000001e69e8954814000 */
+ 3.96079878754651470094149874444850097E-32L, /* 3f969b5017b9fa7a1e86975258c73d3d */
+ 3.20312500000000006713799366908329147E-01L, /* 3ffd48000000000001ef64159c065000 */
+ -1.86401314975634286055150437995880517E-32L, /* bf958323f0434911794e5fb8bfe136ba */
+ 3.24218749999999987061246567584951210E-01L, /* 3ffd4bfffffffffffc4549db9b928000 */
+ -3.18643523744758601387071062700407431E-32L, /* bf964ae5fa7e26c2c3981bed12e14372 */
+ 3.28124999999999991782776266707412953E-01L, /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ -4.46964199751314296839915534813144652E-32L, /* bf96d0277729ffd74727150df6d15547 */
+ 3.32031250000000000393816557756032682E-01L, /* 3ffd540000000000001d0efc04fad000 */
+ -9.03246333902065439930373230002688649E-33L, /* bf947731a008748cc6dee948839ef7ae */
+ 3.35937499999999983810482995064392173E-01L, /* 3ffd57fffffffffffb556cab8ae61000 */
+ 5.27742727066129518825981597650621794E-32L, /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+ 3.39843750000000004310441349760912471E-01L, /* 3ffd5c0000000000013e0def5ddc4000 */
+ -3.85927263474732591932884416445586106E-32L, /* bf9690c51088ef3db9ca000829c450c2 */
+ 3.43749999999999990248130003997484364E-01L, /* 3ffd5ffffffffffffd3070624a0af000 */
+ 9.62005170171527308106468341512327487E-34L, /* 3f913fae595cea84432eb01430817fca */
+ 3.47656250000000004085726414568625697E-01L, /* 3ffd640000000000012d79309e291000 */
+ -6.59664093705705297250259434519072507E-32L, /* bf97568465eafb0e662e64a5dbfaf35f */
+
+ -1.98364257812501251077851763965418372E-03L, /* bff6040000000001cd90f658cf0b1000 */
+ -3.71984513103117734260309047540278737E-34L, /* bf8fee73c54483194782aac4a6154d11 */
+ -1.95312500000000378520649630233891879E-03L, /* bff60000000000008ba643bb5e2e8000 */
+ -1.12194202736719050440745599339855038E-34L, /* bf8e2a436aeff7bc529873354f47a3f5 */
+ -1.92260742187499397430259771221991482E-03L, /* bff5f7fffffffffe4361cb51170da000 */
+ -2.30068299876822157331268484824540848E-34L, /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ -1.89208984375001137424603270262074989E-03L, /* bff5f0000000000347456ed490c23000 */
+ -1.15012507244426243338260435466985403E-34L, /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ -1.86157226562500172319250342061336738E-03L, /* bff5e800000000007f262fa3617b4000 */
+ -3.12438344643346437509767736937785561E-34L, /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ -1.83105468749999505256246872355430379E-03L, /* bff5dffffffffffe92f18c1c2b6fa000 */
+ -5.91130415288336591179087455220308942E-35L, /* bf8d3a4c80b42dc036bae446c9807f78 */
+ -1.80053710937499445182387245573120522E-03L, /* bff5d7fffffffffe669dea82b4a4c000 */
+ -1.92396289352411531324908916321392100E-34L, /* bf8eff7a2123fb573ba9778550d669bd */
+ -1.77001953125000387737631542516323906E-03L, /* bff5d000000000011e19915c3ddb7000 */
+ 7.91101758977203355387806553469731354E-36L, /* 3f8a507f5a70faaccf469e3461873dea */
+ -1.73950195312500034854670281415554486E-03L, /* bff5c8000000000019b7dc6ef97bd000 */
+ 1.55906551582436824067407021178835755E-34L, /* 3f8e9e7880333e34955aebcde3cfb053 */
+ -1.70898437499998955782591472611429852E-03L, /* bff5bffffffffffcfd80e88aa6b96000 */
+ 8.22951661962611381718215899498500357E-35L, /* 3f8db58e6031a779b59f6ece191de7cc */
+ -1.67846679687500586652037711131708544E-03L, /* bff5b80000000001b0df6fd21c133000 */
+ -8.96642618848426299713145894522897419E-35L, /* bf8ddcbcab46d531801bfae4121f2f8a */
+ -1.64794921875000109499161354039904782E-03L, /* bff5b0000000000050cbce8915575000 */
+ -2.88077905394253859590587789680486639E-34L, /* bf8f7eebd4dd860ef73b674d5e707959 */
+ -1.61743164062501133830507079150388351E-03L, /* bff5a80000000003449e8700c3e82000 */
+ -3.68271725851639066312899986829350273E-34L, /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ -1.58691406249999015546015764131101956E-03L, /* bff59ffffffffffd2999e668cdd28000 */
+ 8.48197657099957029953716507898788812E-35L, /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ -1.55639648437500317366570219290722587E-03L, /* bff5980000000000ea2cd9a40d256000 */
+ -3.45156704719737676412949957712570373E-36L, /* bf8925a079505516c8e317ac1ff53255 */
+ -1.52587890625000568759013197767046039E-03L, /* bff5900000000001a3ab8a3f6b698000 */
+ -1.01902948542497496574967177677556729E-34L, /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ -1.49536132812500945889014955936485340E-03L, /* bff5880000000002b9f1621b57743000 */
+ -3.32264697086631598830366079048117140E-34L, /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ -1.46484374999999931883259902869504725E-03L, /* bff57fffffffffffcdbd1c90e1b4a000 */
+ -1.76487524793892929381101031660811433E-34L, /* bf8ed52f2f724bc1ae870b18356337b4 */
+ -1.43432617187498876325946983333888768E-03L, /* bff577fffffffffcc2dff8faa5570000 */
+ -3.54550084538495708816233114576143814E-34L, /* bf8fd74724576915868c1e8ce9f430f1 */
+ -1.40380859374999215367421282192718062E-03L, /* bff56ffffffffffdbd0b18aac65ed000 */
+ -1.90585907028351204486765167064669639E-34L, /* bf8efaaa0c0e23e50c11b2120348054f */
+ -1.37329101562499692341771212945644892E-03L, /* bff567ffffffffff1cfd00f1b0577000 */
+ -3.59631150411372589637918252836880320E-34L, /* bf8fde08239ac74942a46298ea4fb715 */
+ -1.34277343749999137467356674296739172E-03L, /* bff55ffffffffffd839030b05d53d000 */
+ -1.49571076125940368185068762485268117E-35L, /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ -1.31225585937499247038404301859788734E-03L, /* bff557fffffffffdd469936e691e3000 */
+ 3.10375845385355395586146533282311300E-34L, /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ -1.28173828124999024755581675764821898E-03L, /* bff54ffffffffffd306589b0ab21d000 */
+ -1.98541096105909793397376077900810019E-34L, /* bf8f07e808bbb1e35106c294ffbb9687 */
+ -1.25122070312500340204619591143332523E-03L, /* bff5480000000000fb06d5f16ad2c000 */
+ 3.62884195935761446237911443317457521E-34L, /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ -1.22070312499999591578388993012071279E-03L, /* bff53ffffffffffed2a356c440074000 */
+ -2.96756662615653130862526710937493307E-35L, /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ -1.19018554687498821966212632349422735E-03L, /* bff537fffffffffc9ac3b585dda89000 */
+ 1.44659971891167323357060028901142644E-34L, /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ -1.15966796875000160938908064907298384E-03L, /* bff530000000000076c0800db9639000 */
+ 2.50088010538742402346270685365928513E-34L, /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ -1.12915039062500267151512523291939657E-03L, /* bff5280000000000c51f7e7315137000 */
+ 7.56402096465615210500092443924888831E-35L, /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ -1.09863281249998665006360103291051571E-03L, /* bff51ffffffffffc26f2d4c9ce2ba000 */
+ 1.43982174467233642713619821353592061E-34L, /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ -1.06811523437500522742248711752028025E-03L, /* bff518000000000181b7380f10446000 */
+ 5.41265133745862349181293024531133174E-35L, /* 3f8d1fc9313d018b30e790e06b6be723 */
+ -1.03759765624999980942114138999770552E-03L, /* bff50ffffffffffff1f01130490e1000 */
+ 1.21525139612685854366189534669623436E-34L, /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ -1.00708007812499602697537601515759439E-03L, /* bff507fffffffffedad7afcce7051000 */
+ 1.00020246351201558505328236381833392E-34L, /* 3f8e09e640992512b1300744a7e984ed */
+ -9.76562499999992592487302113340463694E-04L, /* bff4fffffffffffbbad8151f8adf6000 */
+ -1.64984406575162932060422892046851002E-34L, /* bf8eb69a919986e8054b86fc34300f24 */
+ -9.46044921874989085824996924138179594E-04L, /* bff4effffffffff9b55a204fd9792000 */
+ -9.29539174108308550334255350011347171E-35L, /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ -9.15527343750013735214860599791540029E-04L, /* bff4e00000000007eaf5bf103f82d000 */
+ 3.07557018309280519949818825519490586E-35L, /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ -8.85009765625012292294986105781516428E-04L, /* bff4d000000000071605c65403b97000 */
+ 4.77499983783821950338363358545463558E-35L, /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ -8.54492187499986941239470706817188192E-04L, /* bff4bffffffffff878ddf9cab264a000 */
+ -1.60128240346239526958630011447901568E-34L, /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ -8.23974609374996290174598690241743810E-04L, /* bff4affffffffffddc86c249ebe06000 */
+ 1.61677540391961912631535763471935882E-34L, /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ -7.93457031249988696952538334288757473E-04L, /* bff49ffffffffff97bf6f0aa85a5f000 */
+ 1.22318577008381887076634753347515709E-34L, /* 3f8e452db5b5d250878f71040da06d14 */
+ -7.62939453124996723316499040007097041E-04L, /* bff48ffffffffffe1c7265b431108000 */
+ -1.03845161748762410745671891558398468E-34L, /* bf8e14115ad884c96d1a820c73647220 */
+ -7.32421874999998242520117923997325794E-04L, /* bff47ffffffffffefca4498b7aa8a000 */
+ 5.64005211953031009549514026639438083E-35L, /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ -7.01904296874999772890934814265622012E-04L, /* bff46fffffffffffde7c0fe5d8041000 */
+ 5.90245467325173644235991233229525762E-35L, /* 3f8d39d40cc49002189243c194b1db0e */
+ -6.71386718750008699269643939210658742E-04L, /* bff460000000000503c91d798b60c000 */
+ -5.20515801723324452151498579012322191E-35L, /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ -6.40869140625005499535275057463709988E-04L, /* bff45000000000032b969184e9751000 */
+ -6.69469163285461870099846471658294534E-35L, /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ -6.10351562499999293780097329596079841E-04L, /* bff43fffffffffff97c7c433e35ed000 */
+ -1.16941808547394177991845382085515086E-34L, /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ -5.79833984375000068291972326409994795E-04L, /* bff43000000000000a13ff6dcf2bf000 */
+ 1.17885044988246219185041488459766001E-34L, /* 3f8e3964677e001a00412aab52790842 */
+ -5.49316406249990904622170867910987793E-04L, /* bff41ffffffffffac1c25739c716b000 */
+ -3.31875702128137033065075734368960972E-35L, /* bf8c60e928d8982c3c99aef4f885a121 */
+ -5.18798828125011293653756992177727236E-04L, /* bff410000000000682a62cff36775000 */
+ -5.69971237642088463334239430962628187E-35L, /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ -4.88281249999990512232251384917893121E-04L, /* bff3fffffffffff50fb48992320df000 */
+ 1.02144616714408655325510171265051108E-35L, /* 3f8ab279a3626612710b9b3ac71734ac */
+ -4.57763671874997554564967307956493434E-04L, /* bff3dffffffffffd2e3c272e3cca9000 */
+ -8.25484058867957231164162481843653503E-35L, /* bf8db6e71158e7bf93e2e683f07aa841 */
+ -4.27246093749991203999790346349633286E-04L, /* bff3bffffffffff5dbe103cba0eb2000 */
+ -3.51191203319375193921924105905691755E-35L, /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ -3.96728515624986649402960638705483281E-04L, /* bff39ffffffffff09b996882706ec000 */
+ -5.51925962073095883016589497244931171E-36L, /* bf89d586d49f22289cfc860bebb99056 */
+ -3.66210937499999945095511981300980754E-04L, /* bff37fffffffffffefcb88bfc7df6000 */
+ -2.11696465278144529364423332249588595E-35L, /* bf8bc23a84d28e5496c874ef9833be25 */
+ -3.35693359374992480958458008559640163E-04L, /* bff35ffffffffff754c548a8798f2000 */
+ -8.58941791799705081104736787493668352E-35L, /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ -3.05175781250009811036303273640122156E-04L, /* bff340000000000b4fb4f1aad1c76000 */
+ -8.61173897858769926480551302277426632E-35L, /* bf8dc9e0eabb1c0b33051011b64769fa */
+ -2.74658203124987298321920308390303850E-04L, /* bff31ffffffffff15b2056ac252fd000 */
+ 3.35152809454778381053519808988046631E-37L, /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ -2.44140624999999992770514819575735516E-04L, /* bff2fffffffffffffbbb82d6a7636000 */
+ 3.54445837111124472730013879165516908E-35L, /* 3f8c78e955b01378be647b1c92aa9a77 */
+ -2.13623046875012756463165168672749438E-04L, /* bff2c0000000001d6a1635fea6bbf000 */
+ 1.50050816288650121729916777279129473E-35L, /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ -1.83105468749991323078784464300306893E-04L, /* bff27fffffffffebfe0cbd0c82399000 */
+ -9.14919506501448661140572099029756008E-37L, /* bf873754bacaa9d9513b6127e791eb47 */
+ -1.52587890625013337032336300236461546E-04L, /* bff240000000001ec0cb57f2cc995000 */
+ 2.84906084373176180870418394956384516E-35L, /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ -1.22070312499990746786116828458007518E-04L, /* bff1ffffffffffd553bbb49f35a34000 */
+ 6.71618008964968339584520728412444537E-36L, /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ -9.15527343750029275602791047595142231E-05L, /* bff180000000000d8040cd6ecde28000 */
+ -1.95753652091078750312541716951402172E-35L, /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ -6.10351562499913258461494008080572701E-05L, /* bff0ffffffffffaffebbb92d7f6a9000 */
+ 5.69868489273961111703398456218119973E-36L, /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ -3.05175781250092882818419203884960853E-05L, /* bff0000000000055ab55de88fac1d000 */
+ 9.03341100018476837609128961872915953E-36L, /* 3f8a803d229fa3a0e834a63abb06662b */
+#define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+ 3.05175781249814607084128277672749162E-05L, /* 3feffffffffffeaa02abb9102f499000 */
+ 1.00271855391179733380665816525889949E-36L, /* 3f8755351afa042ac3f58114824d4c10 */
+ 6.10351562500179243748093427073421439E-05L, /* 3ff1000000000052a95de07a4c26d000 */
+ 1.67231624299180373502350811501181670E-36L, /* 3f881c87a53691cae9d77f4e40d66616 */
+ 9.15527343749970728685313252158399200E-05L, /* 3ff17ffffffffff28040cc2acde28000 */
+ 2.43665747834893104318707597514407880E-36L, /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+ 1.22070312500027751961838150070880064E-04L, /* 3ff200000000003ffddde6c153b53000 */
+ -1.73322146370624186623546452226755405E-35L, /* bf8b709d8d658ed5dbbe943de56ee84e */
+ 1.52587890624995916105682628143179430E-04L, /* 3ff23ffffffffff6954b56e285d23000 */
+ 1.23580432650945898349135528000443828E-35L, /* 3f8b06d396601dde16de7d7bc27346e6 */
+ 1.83105468750008670314358488289621794E-04L, /* 3ff2800000000013fe0cdc8c823b7000 */
+ 4.30446229148833293310207915930740796E-35L, /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+ 2.13623046875005741337455947623248132E-04L, /* 3ff2c0000000000d3d1662de21a3f000 */
+ -3.96110759869520786681660669615255057E-35L, /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+ 2.44140624999981493573336463433440506E-04L, /* 3ff2ffffffffffd553bbdf48e0534000 */
+ -1.39617373942387888957350179316792928E-35L, /* bf8b28eeedc286015802b63f96b8c5cd */
+ 2.74658203124984920706309918754626834E-04L, /* 3ff31fffffffffee9d60c8439ec1d000 */
+ -3.16168080483901830349738314447356223E-36L, /* bf890cf74f81c77a611abc1243812444 */
+ 3.05175781250008648918265055410966055E-04L, /* 3ff3400000000009f8b5c9a346636000 */
+ 8.54421306185008998867856704677221443E-35L, /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+ 3.35693359374988945462612499316774515E-04L, /* 3ff35ffffffffff34146c540f15b2000 */
+ 7.96443137431639500475160850431097078E-35L, /* 3f8da77638ed3148fc4d99d1c9e13446 */
+ 3.66210937500027690542093987739604535E-04L, /* 3ff380000000001fecce34bea89c4000 */
+ 2.14507323877752361258862577769090367E-35L, /* 3f8bc834e554d38894cf91957b0253d3 */
+ 3.96728515625003928083564943615052121E-04L, /* 3ff3a00000000004875d9a4acf6ab000 */
+ 4.88358523466632050664019922448605508E-35L, /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+ 4.27246093750017799227172345607351585E-04L, /* 3ff3c00000000014856794c3ee850000 */
+ 6.66520494592631402182216588784828935E-35L, /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+ 4.57763671875002108342364320152138181E-04L, /* 3ff3e000000000026e45d855410b9000 */
+ 7.21799615960261390920033272189522298E-35L, /* 3f8d7fc645cff8879462296af975c9fd */
+ 4.88281249999999768797631616370963356E-04L, /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ -5.30564629906905979452258114088325361E-35L, /* bf8d1a18b71929a30d67a217a27ae851 */
+ 5.18798828124997339054881383202487041E-04L, /* 3ff40ffffffffffe775055eea5851000 */
+ -4.03682911253647925867848180522846377E-35L, /* bf8cad44f0f3e5199d8a589d9332acad */
+ 5.49316406249980511907933706754958501E-04L, /* 3ff41ffffffffff4c410b29bb62fb000 */
+ -2.08166843948323917121806956728438051E-35L, /* bf8bbab8cf691403249fe5b699e25143 */
+ 5.79833984374989593561576568548497165E-04L, /* 3ff42ffffffffffa0047df328d817000 */
+ -1.72745033420153042445343706432627539E-34L, /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+ 6.10351562500008540711511259540838154E-04L, /* 3ff4400000000004ec62f54f8c271000 */
+ 7.41889382604319545724663095428976499E-35L, /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+ 6.40869140625020444702875407535884986E-04L, /* 3ff450000000000bc91b09718515d000 */
+ -4.47321009727305792048065440180490107E-35L, /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+ 6.71386718750007531635964622352684074E-04L, /* 3ff460000000000457792973db05c000 */
+ 5.13698959677949336513874456684462092E-35L, /* 3f8d112114436949c5ef38d8049004ab */
+ 7.01904296875006634673332887754430334E-04L, /* 3ff4700000000003d31adf2cb8b1d000 */
+ -8.25665755717729437292989870760751482E-35L, /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+ 7.32421874999998244664170215504673504E-04L, /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ -5.64005234937832153139057628112753364E-35L, /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+ 7.62939453125017456345986752604096408E-04L, /* 3ff490000000000a101a1b093d4a8000 */
+ -1.11084094120417622468550608896588329E-34L, /* bf8e274feabd2d94f6694507a46accb1 */
+ 7.93457031249987558617598988993908016E-04L, /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ -1.22966480225449015129079129940978828E-34L, /* bf8e46e6a65eef8fa9e42eddf3da305e */
+ 8.23974609374997378723747633335135819E-04L, /* 3ff4affffffffffe7d2afbaa55b26000 */
+ -1.62270010016794279091906973366704963E-34L, /* bf8eaf633f057ebdb664a34566401c4e */
+ 8.54492187500023938282350821569920958E-04L, /* 3ff4c0000000000dccaabce399e59000 */
+ -1.39076361712838158775374263169606160E-34L, /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+ 8.85009765624987932362186815286691297E-04L, /* 3ff4cffffffffff90b218886edc2a000 */
+ 4.07328275060905585228261577392403980E-35L, /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+ 9.15527343749975579461305518559161974E-04L, /* 3ff4dffffffffff1ec2a21f25df33000 */
+ 1.16855112459192484947855553716334015E-35L, /* 3f8af10bf319e9f5270cf249eeffbe5c */
+ 9.46044921875016761584725882821122521E-04L, /* 3ff4f00000000009a992c46c16d71000 */
+ 9.51660680007524262741115611071680436E-35L, /* 3f8df9fd56e81f8edf133843910ee831 */
+ 9.76562499999974118878133088548272636E-04L, /* 3ff4fffffffffff1149edc46a6df6000 */
+ -5.65271128977550656964071208289181661E-36L, /* bf89e0e12689dd721aa2314c81eb6429 */
+ 1.00708007812498671732140389760347830E-03L, /* 3ff507fffffffffc2be94b90ed091000 */
+ -1.43355074891483635310132767255371379E-34L, /* bf8e7d1a688c247b16022daab1316d55 */
+ 1.03759765625002637786192745235343007E-03L, /* 3ff51000000000079a57b966bc158000 */
+ 2.95905815240957629366749917020106928E-34L, /* 3f8f895387fc73bb38f8a1b254c01a60 */
+ 1.06811523437500860568717813047520763E-03L, /* 3ff51800000000027afcd5b35f5e6000 */
+ -5.98328495358586628195372356742878314E-35L, /* bf8d3e204130013bf6328f1b70ff8c76 */
+ 1.09863281250001439958487251556220070E-03L, /* 3ff5200000000004268077c6c66bd000 */
+ 2.41371837889426603334113000868144760E-34L, /* 3f8f40d6948edf864054ccf151f9815e */
+ 1.12915039062501298413451613770002366E-03L, /* 3ff5280000000003be0f5dd8fe81b000 */
+ -1.28815268997394164973472617519705703E-34L, /* bf8e567321172ea089dce4bc8354ecb7 */
+ 1.15966796874997272036339054191407232E-03L, /* 3ff52ffffffffff8231e3bcfff1e8000 */
+ 1.02996064554316248496839462594377804E-34L, /* 3f8e11cf7d402789244f68e2d4f985b1 */
+ 1.19018554687502744121802585360546796E-03L, /* 3ff5380000000007e8cdf3f8f6c20000 */
+ -1.43453217726255628994625761307322163E-34L, /* bf8e7d5d3370d85a374f5f4802fc517a */
+ 1.22070312499997743541996266398850614E-03L, /* 3ff53ffffffffff97f0722561f454000 */
+ -1.41086259180534339713692694428211646E-34L, /* bf8e77125519ff76244dfec5fbd58402 */
+ 1.25122070312501024092560690174507039E-03L, /* 3ff5480000000002f3a59d8820691000 */
+ 3.84102646020099293168698506729765213E-34L, /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+ 1.28173828124997986521442660131425390E-03L, /* 3ff54ffffffffffa3250a764439d9000 */
+ 1.44644589735033114377952806106652650E-34L, /* 3f8e808801b80dcf38323cdbfdca2549 */
+ 1.31225585937501665804856968749058137E-03L, /* 3ff5580000000004cd25a414c6d62000 */
+ 1.67474574742200577294563576414361377E-34L, /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+ 1.34277343749997290265837386401818888E-03L, /* 3ff55ffffffffff83091b042cfd59000 */
+ -1.55650565030381326742591837551559103E-34L, /* bf8e9dca490d7fecfadba9625ffb91c5 */
+ 1.37329101562497720784949380297774268E-03L, /* 3ff567fffffffff96e3c7312f5ccf000 */
+ 1.65279335325630026116581677369221748E-34L, /* 3f8eb763496f5bd7404f2298b402074f */
+ 1.40380859374999099958354100336136647E-03L, /* 3ff56ffffffffffd67e2f09f2a381000 */
+ 1.89919944388961890195706641264717076E-34L, /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+ 1.43432617187497484122173130998160625E-03L, /* 3ff577fffffffff8bf9c1d71af8a8000 */
+ 2.57638517142061429772064578590009568E-34L, /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+ 1.46484374999999929342158925502052945E-03L, /* 3ff57fffffffffffcbdd1c7671b46000 */
+ 1.76487201934184070490166772482073801E-34L, /* 3f8ed52ef732458f6e4c5c07504f33cc */
+ 1.49536132812502318451070466256902933E-03L, /* 3ff5880000000006aeb7066c8ad43000 */
+ 2.38068367275295804321313550609246656E-34L, /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+ 1.52587890625000448053340248672949543E-03L, /* 3ff59000000000014a9ae2104b3bc000 */
+ 1.01174455568392813258454590274740959E-34L, /* 3f8e0cf7c434762991bb38e12acee215 */
+ 1.55639648437501113499837053523090913E-03L, /* 3ff5980000000003359e2c204355e000 */
+ -2.82398418808099749023517211651363693E-35L, /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+ 1.58691406249999937955142588308171026E-03L, /* 3ff59fffffffffffd2380ecbc87c2000 */
+ -1.27361695572422741562701199136538047E-34L, /* bf8e5295e0e206dfb0f0266c07225448 */
+ 1.61743164062498000531048954475329309E-03L, /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ -1.22606548862580061633942923016222044E-34L, /* bf8e45f1b17bb61039d21a351bb207b8 */
+ 1.64794921875001835451453858682255576E-03L, /* 3ff5b000000000054a52fa20f6565000 */
+ 1.39132339594152335892305491425264583E-34L, /* 3f8e71e0904c5449b414ee49b191cef2 */
+ 1.67846679687501263995029340691547953E-03L, /* 3ff5b80000000003a4a9e912c910b000 */
+ 6.67245854693585315412242764786197029E-35L, /* 3f8d62c4ccac1e7511a617d469468ccd */
+ 1.70898437500002646861403514115369655E-03L, /* 3ff5c00000000007a109fbaa7e015000 */
+ 6.87367172354719289559624829652240928E-36L, /* 3f8a245fa835eceb42bae8128d9336db */
+ 1.73950195312501174308226096992992128E-03L, /* 3ff5c80000000003627c8d637a005000 */
+ -2.20824271875474985927385878948759352E-34L, /* bf8f25869b1cbefb25e735992f232f57 */
+ 1.77001953124997491747605207736194513E-03L, /* 3ff5cffffffffff8c53c84b6883b8000 */
+ 3.43123048533596296514343180408963705E-34L, /* 3f8fc816b91d173ddadbbf09b1287906 */
+ 1.80053710937497698911127570705069398E-03L, /* 3ff5d7fffffffff95e1899f4a8430000 */
+ 3.99231237340890073475077494556136100E-35L, /* 3f8ca889148f62fa854da5674df41279 */
+ 1.83105468750002267094899598630423914E-03L, /* 3ff5e0000000000688d21e62ba674000 */
+ -3.22274595655810623999007524769365273E-34L, /* bf8fac605cb9ae01eb719675ced25560 */
+ 1.86157226562500499224728040579690330E-03L, /* 3ff5e80000000001705ce28a6d89e000 */
+ 3.07094985075881613489605622068441083E-34L, /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+ 1.89208984374998234666824993196980949E-03L, /* 3ff5effffffffffae969fdc7cd8cf000 */
+ -3.06287628722973914692165056776495733E-34L, /* bf8f9720477d9cfa10e464df7f91020c */
+ 1.92260742187501225343755557292811682E-03L, /* 3ff5f800000000038824e428ed49a000 */
+ 6.30049124729794620592961282769623368E-35L, /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+ 1.95312499999998514894032051116231258E-03L, /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ -6.14610057507500948543216998736262902E-35L, /* bf8d46c862d39255370e7974d48daa7e */
+ 1.98364257812501222021119324146882732E-03L, /* 3ff6040000000001c2d8a1aa5188d000 */
+ 3.71942298418113774118754986159801984E-34L, /* 3f8fee6567d9940495519ffe62cbc9a4 */
+
+ 7.06341639425619532977052017486130353E-01L, /* 3ffe69a59c8245a9ac00000000000000 */
+ 7.09106182437398424589503065362805501E-01L, /* 3ffe6b0ff72deb89d000000000000000 */
+ 7.11881545564596485142772053222870454E-01L, /* 3ffe6c7bbce9a6d93000000000000000 */
+ 7.14667771155948150507697391731198877E-01L, /* 3ffe6de8ef213d71e000000000000000 */
+ 7.17464901725936049503573599395167548E-01L, /* 3ffe6f578f41e1a9e400000000000000 */
+ 7.20272979955439790478166628417966422E-01L, /* 3ffe70c79eba33c06c00000000000000 */
+ 7.23092048692387218133958981525211129E-01L, /* 3ffe72391efa434c7400000000000000 */
+ 7.25922150952408251622927082280511968E-01L, /* 3ffe73ac117390acd800000000000000 */
+ 7.28763329919491220643124052003258839E-01L, /* 3ffe752077990e79d000000000000000 */
+ 7.31615628946641782803794740175362676E-01L, /* 3ffe769652df22f7e000000000000000 */
+ 7.34479091556544505525749855223693885E-01L, /* 3ffe780da4bba98c4800000000000000 */
+ 7.37353761442226890432394270646909717E-01L, /* 3ffe79866ea5f432d400000000000000 */
+ 7.40239682467726090031590047146892175E-01L, /* 3ffe7b00b216ccf53000000000000000 */
+ 7.43136898668758316688354170764796436E-01L, /* 3ffe7c7c70887763c000000000000000 */
+ 7.46045454253390638577059235103661194E-01L, /* 3ffe7df9ab76b20fd000000000000000 */
+ 7.48965393602715662213498148958024103E-01L, /* 3ffe7f78645eb8076400000000000000 */
+ 7.51896761271528629722027403659012634E-01L, /* 3ffe80f89cbf42526400000000000000 */
+ 7.54839601989007347171423134568613023E-01L, /* 3ffe827a561889716000000000000000 */
+ 7.57793960659394638668118204805068672E-01L, /* 3ffe83fd91ec46ddc000000000000000 */
+ 7.60759882362683631518152083117456641E-01L, /* 3ffe858251bdb68b8c00000000000000 */
+ 7.63737412355305483879774897104653064E-01L, /* 3ffe87089711986c9400000000000000 */
+ 7.66726596070820082262642358728044201E-01L, /* 3ffe8890636e31f54400000000000000 */
+ 7.69727479120609181517664865168626420E-01L, /* 3ffe8a19b85b4fa2d800000000000000 */
+ 7.72740107294572486917871856348938309E-01L, /* 3ffe8ba4976246833800000000000000 */
+ 7.75764526561826289752232810315035749E-01L, /* 3ffe8d31020df5be4400000000000000 */
+ 7.78800783071404878477039801509818062E-01L, /* 3ffe8ebef9eac820b000000000000000 */
+ 7.81848923152964780936002853195532225E-01L, /* 3ffe904e8086b5a87800000000000000 */
+ 7.84908993317491698871180005880887620E-01L, /* 3ffe91df97714512d800000000000000 */
+ 7.87981040258010162480317717381694820E-01L, /* 3ffe9372403b8d6bcc00000000000000 */
+ 7.91065110850296016042904057030682452E-01L, /* 3ffe95067c78379f2800000000000000 */
+ 7.94161252153591734614934694036492147E-01L, /* 3ffe969c4dbb800b4800000000000000 */
+ 7.97269511411324433014513601847284008E-01L, /* 3ffe9833b59b38154400000000000000 */
+ 8.00389936051826789142893403550260700E-01L, /* 3ffe99ccb5aec7bec800000000000000 */
+ 8.03522573689060742863077280162542593E-01L, /* 3ffe9b674f8f2f3d7c00000000000000 */
+ 8.06667472123343942680406826184480451E-01L, /* 3ffe9d0384d70893f800000000000000 */
+ 8.09824679342079301047618855591281317E-01L, /* 3ffe9ea15722892c7800000000000000 */
+ 8.12994243520486992160556383169023320E-01L, /* 3ffea040c80f8374f000000000000000 */
+ 8.16176213022339780422953481320291758E-01L, /* 3ffea1e1d93d687d0000000000000000 */
+ 8.19370636400700819157449927843117621E-01L, /* 3ffea3848c4d49954c00000000000000 */
+ 8.22577562398664585696650419777142815E-01L, /* 3ffea528e2e1d9f09800000000000000 */
+ 8.25797039950100647542896581398963463E-01L, /* 3ffea6cede9f70467c00000000000000 */
+ 8.29029118180400342863478613253391813E-01L, /* 3ffea876812c0877bc00000000000000 */
+ 8.32273846407226292054559735333896242E-01L, /* 3ffeaa1fcc2f45343800000000000000 */
+ 8.35531274141265073440720811959181447E-01L, /* 3ffeabcac15271a2a400000000000000 */
+ 8.38801451086982535754188461396552157E-01L, /* 3ffead7762408309bc00000000000000 */
+ 8.42084427143382358016410194068157580E-01L, /* 3ffeaf25b0a61a7b4c00000000000000 */
+ 8.45380252404767357221615498019673396E-01L, /* 3ffeb0d5ae318680c400000000000000 */
+ 8.48688977161503960155997106085123960E-01L, /* 3ffeb2875c92c4c99400000000000000 */
+ 8.52010651900789478530029441571969073E-01L, /* 3ffeb43abd7b83db1c00000000000000 */
+ 8.55345327307422548246407245642330963E-01L, /* 3ffeb5efd29f24c26400000000000000 */
+ 8.58693054264576483003423845730139874E-01L, /* 3ffeb7a69db2bcc77800000000000000 */
+ 8.62053883854575708767242758767679334E-01L, /* 3ffeb95f206d17228000000000000000 */
+ 8.65427867359675251357487013592617586E-01L, /* 3ffebb195c86b6b29000000000000000 */
+ 8.68815056262843166123843730019871145E-01L, /* 3ffebcd553b9d7b62000000000000000 */
+ 8.72215502248546159513864495238522068E-01L, /* 3ffebe9307c271855000000000000000 */
+ 8.75629257203538208242932228131394368E-01L, /* 3ffec0527a5e384ddc00000000000000 */
+ 8.79056373217652342599848225290770642E-01L, /* 3ffec213ad4c9ed0d800000000000000 */
+ 8.82496902584595399599010079327854328E-01L, /* 3ffec3d6a24ed8221800000000000000 */
+ 8.85950897802745995779361010136199184E-01L, /* 3ffec59b5b27d9696800000000000000 */
+ 8.89418411575955636383383762222365476E-01L, /* 3ffec761d99c5ba58800000000000000 */
+ 8.92899496814352794382685374330321793E-01L, /* 3ffec92a1f72dd70d400000000000000 */
+ 8.96394206635150403439382671422208659E-01L, /* 3ffecaf42e73a4c7d800000000000000 */
+ 8.99902594363456265202927397695020773E-01L, /* 3ffeccc00868c0d18800000000000000 */
+ 9.03424713533086704009278378180169966E-01L, /* 3ffece8daf1e0ba94c00000000000000 */
+ 9.06960617887383580004723171441582963E-01L, /* 3ffed05d24612c2af000000000000000 */
+ 9.10510361380034133338412516422977205E-01L, /* 3ffed22e6a0197c02c00000000000000 */
+ 9.14073998175894436579724811053893063E-01L, /* 3ffed40181d094303400000000000000 */
+ 9.17651582651815816982221463149471674E-01L, /* 3ffed5d66da13970f400000000000000 */
+ 9.21243169397474526149949269893113524E-01L, /* 3ffed7ad2f48737a2000000000000000 */
+ 9.24848813216204823639543519675498828E-01L, /* 3ffed985c89d041a3000000000000000 */
+ 9.28468569125835141431224428743007593E-01L, /* 3ffedb603b7784cd1800000000000000 */
+ 9.32102492359527579068867453315760940E-01L, /* 3ffedd3c89b26894e000000000000000 */
+ 9.35750638366620729469147477175283711E-01L, /* 3ffedf1ab529fdd41c00000000000000 */
+ 9.39413062813475779888605643463961314E-01L, /* 3ffee0fabfbc702a3c00000000000000 */
+ 9.43089821584325888048638830696290825E-01L, /* 3ffee2dcab49ca51b400000000000000 */
+ 9.46780970782128888929563004239753354E-01L, /* 3ffee4c079b3f8000400000000000000 */
+ 9.50486566729423443256052905780961737E-01L, /* 3ffee6a62cdec7c7b000000000000000 */
+ 9.54206665969188322362626308859034907E-01L, /* 3ffee88dc6afecfbfc00000000000000 */
+ 9.57941325265705301283958306157728657E-01L, /* 3ffeea77490f0196b000000000000000 */
+ 9.61690601605425299247542625380447134E-01L, /* 3ffeec62b5e5881fb000000000000000 */
+ 9.65454552197837823079851204965962097E-01L, /* 3ffeee500f1eed967000000000000000 */
+ 9.69233234476344074348475032820715569E-01L, /* 3ffef03f56a88b5d7800000000000000 */
+ 9.73026706099133165128733935489435680E-01L, /* 3ffef2308e71a927a800000000000000 */
+ 9.76835024950062025261843245971249416E-01L, /* 3ffef423b86b7ee79000000000000000 */
+ 9.80658249139538557015427500118676107E-01L, /* 3ffef618d68936c09c00000000000000 */
+ 9.84496437005408397968864164795377292E-01L, /* 3ffef80feabfeefa4800000000000000 */
+ 9.88349647113845042323276857132441364E-01L, /* 3ffefa08f706bbf53800000000000000 */
+ 9.92217938260243514925207364285597578E-01L, /* 3ffefc03fd56aa225000000000000000 */
+ 9.96101369470117486981664001177705359E-01L, /* 3ffefe00ffaabffbbc00000000000000 */
+#define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
+ 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ 1.00391388933834757590801700644078664E+00L, /* 3fff0100802ab5577800000000000000 */
+ 1.00784309720644799091004983893071767E+00L, /* 3fff0202015600445c00000000000000 */
+ 1.01178768355933151879000320150225889E+00L, /* 3fff0304848362076c00000000000000 */
+ 1.01574770858668572692806719715008512E+00L, /* 3fff04080ab55de39000000000000000 */
+ 1.01972323271377413034244341361045372E+00L, /* 3fff050c94ef7a206c00000000000000 */
+ 1.02371431660235789884438872832106426E+00L, /* 3fff06122436410dd000000000000000 */
+ 1.02772102115162167201845022646011785E+00L, /* 3fff0718b98f42085000000000000000 */
+ 1.03174340749910264936062276319717057E+00L, /* 3fff08205601127ec800000000000000 */
+ 1.03578153702162378824169763902318664E+00L, /* 3fff0928fa934ef90800000000000000 */
+ 1.03983547133622999947277776300325058E+00L, /* 3fff0a32a84e9c1f5800000000000000 */
+ 1.04390527230112850620713516036630608E+00L, /* 3fff0b3d603ca7c32800000000000000 */
+ 1.04799100201663270004459604933799710E+00L, /* 3fff0c49236829e8bc00000000000000 */
+ 1.05209272282610977189420964350574650E+00L, /* 3fff0d55f2dce5d1e800000000000000 */
+ 1.05621049731693195106174698594259098E+00L, /* 3fff0e63cfa7ab09d000000000000000 */
+ 1.06034438832143151909548350886325352E+00L, /* 3fff0f72bad65671b800000000000000 */
+ 1.06449445891785943185681162503897212E+00L, /* 3fff1082b577d34ed800000000000000 */
+ 1.06866077243134810492719566354935523E+00L, /* 3fff1193c09c1c595c00000000000000 */
+ 1.07284339243487741866189821848820429E+00L, /* 3fff12a5dd543ccc4c00000000000000 */
+ 1.07704238275024494209120007326419000E+00L, /* 3fff13b90cb25176a400000000000000 */
+ 1.08125780744903959851299646288680378E+00L, /* 3fff14cd4fc989cd6400000000000000 */
+ 1.08548973085361949442173568058933597E+00L, /* 3fff15e2a7ae28fecc00000000000000 */
+ 1.08973821753809324563988525369495619E+00L, /* 3fff16f9157587069400000000000000 */
+ 1.09400333232930546678574046381982043E+00L, /* 3fff18109a3611c35000000000000000 */
+ 1.09828514030782586896606289883493446E+00L, /* 3fff192937074e0cd800000000000000 */
+ 1.10258370680894224324930519287590869E+00L, /* 3fff1a42ed01d8cbc800000000000000 */
+ 1.10689909742365749645287564817408565E+00L, /* 3fff1b5dbd3f68122400000000000000 */
+ 1.11123137799969046168868658241990488E+00L, /* 3fff1c79a8dacc350c00000000000000 */
+ 1.11558061464248076122274255794764031E+00L, /* 3fff1d96b0eff0e79400000000000000 */
+ 1.11994687371619722204840741142106708E+00L, /* 3fff1eb4d69bde569c00000000000000 */
+ 1.12433022184475073235176978414529003E+00L, /* 3fff1fd41afcba45e800000000000000 */
+ 1.12873072591281087273529237791080959E+00L, /* 3fff20f47f31c92e4800000000000000 */
+ 1.13314845306682632219974493636982515E+00L, /* 3fff2216045b6f5cd000000000000000 */
+ 1.13758347071604959399593326452304609E+00L, /* 3fff2338ab9b32134800000000000000 */
+ 1.14203584653356560174586320499656722E+00L, /* 3fff245c7613b8a9b000000000000000 */
+ 1.14650564845732405583333957110880874E+00L, /* 3fff258164e8cdb0d800000000000000 */
+ 1.15099294469117646722011727433709893E+00L, /* 3fff26a7793f60164400000000000000 */
+ 1.15549780370591653744227755851170514E+00L, /* 3fff27ceb43d84490400000000000000 */
+ 1.16002029424032515603215642840950750E+00L, /* 3fff28f7170a755fd800000000000000 */
+ 1.16456048530221917269855680387991015E+00L, /* 3fff2a20a2ce96406400000000000000 */
+ 1.16911844616950438835445424956560601E+00L, /* 3fff2b4b58b372c79400000000000000 */
+ 1.17369424639123270948104504896036815E+00L, /* 3fff2c7739e3c0f32c00000000000000 */
+ 1.17828795578866324378353169777255971E+00L, /* 3fff2da4478b620c7400000000000000 */
+ 1.18289964445632783673900689791480545E+00L, /* 3fff2ed282d763d42400000000000000 */
+ 1.18752938276310060494722620205720887E+00L, /* 3fff3001ecf601af7000000000000000 */
+ 1.19217724135327157730657177125976887E+00L, /* 3fff31328716a5d63c00000000000000 */
+ 1.19684329114762477708211463323095813E+00L, /* 3fff32645269ea829000000000000000 */
+ 1.20152760334452030077656559114984702E+00L, /* 3fff339750219b212c00000000000000 */
+ 1.20623024942098072687102217059873510E+00L, /* 3fff34cb8170b5835400000000000000 */
+ 1.21095130113378179892436037334846333E+00L, /* 3fff3600e78b6b11d000000000000000 */
+ 1.21569083052054743854242246925423387E+00L, /* 3fff373783a722012400000000000000 */
+ 1.22044890990084875515009343871497549E+00L, /* 3fff386f56fa7686e800000000000000 */
+ 1.22522561187730755216662714701669756E+00L, /* 3fff39a862bd3c106400000000000000 */
+ 1.23002100933670455162882717559114099E+00L, /* 3fff3ae2a8287e7a8000000000000000 */
+ 1.23483517545109100499445276000187732E+00L, /* 3fff3c1e2876834aa800000000000000 */
+ 1.23966818367890557750499169742397498E+00L, /* 3fff3d5ae4e2cae92c00000000000000 */
+ 1.24452010776609517384017067342938390E+00L, /* 3fff3e98deaa11dcbc00000000000000 */
+ 1.24939102174724003813111039562500082E+00L, /* 3fff3fd8170a52071800000000000000 */
+ 1.25428099994668373895478907797951251E+00L, /* 3fff41188f42c3e32000000000000000 */
+ 1.25919011697966698459794088194030337E+00L, /* 3fff425a4893dfc3f800000000000000 */
+ 1.26411844775346637881341393949696794E+00L, /* 3fff439d443f5f159000000000000000 */
+ 1.26906606746853711786826579555054195E+00L, /* 3fff44e183883d9e4800000000000000 */
+ 1.27403305161966090564007458851847332E+00L, /* 3fff462707b2bac20c00000000000000 */
+ 1.27901947599709753244923149395617656E+00L, /* 3fff476dd2045ac67800000000000000 */
+ 1.28402541668774150540599521264084615E+00L, /* 3fff48b5e3c3e8186800000000000000 */
+ 1.28905095007628295311619126550795045E+00L, /* 3fff49ff3e397492bc00000000000000 */
+ 1.29409615284637330434591717676084954E+00L, /* 3fff4b49e2ae5ac67400000000000000 */
+ 1.29916110198179535206719492634874769E+00L, /* 3fff4c95d26d3f440800000000000000 */
+ 1.30424587476763775839572190307080746E+00L, /* 3fff4de30ec211e60000000000000000 */
+ 1.30935054879147461104338390214252286E+00L, /* 3fff4f3198fa0f1cf800000000000000 */
+ 1.31447520194454914310711046709911898E+00L, /* 3fff50817263c13cd000000000000000 */
+ 1.31961991242296217130558488861424848E+00L, /* 3fff51d29c4f01cb3000000000000000 */
+ 1.32478475872886558573071624778094701E+00L, /* 3fff5325180cfacf7800000000000000 */
+ 1.32996981967165983640200010995613411E+00L, /* 3fff5478e6f02823d000000000000000 */
+ 1.33517517436919680440254865061433520E+00L, /* 3fff55ce0a4c58c7bc00000000000000 */
+ 1.34040090224898678084031189428060316E+00L, /* 3fff57248376b033d800000000000000 */
+ 1.34564708304941055283521222918352578E+00L, /* 3fff587c53c5a7af0400000000000000 */
+ 1.35091379682093615244298234756570309E+00L, /* 3fff59d57c910fa4e000000000000000 */
+ 1.35620112392734021300455538039386738E+00L, /* 3fff5b2fff3210fd9400000000000000 */
+ 1.36150914504693443252136830778908916E+00L, /* 3fff5c8bdd032e770800000000000000 */
+ 1.36683794117379636690046140756749082E+00L, /* 3fff5de9176045ff5400000000000000 */
+ 1.37218759361900544124779344201670028E+00L, /* 3fff5f47afa69210a800000000000000 */
+ 1.37755818401188367960941150158760138E+00L, /* 3fff60a7a734ab0e8800000000000000 */
+ 1.38294979430124120867162673675920814E+00L, /* 3fff6208ff6a88a46000000000000000 */
+ 1.38836250675662681297595213436579797E+00L, /* 3fff636bb9a983258400000000000000 */
+ 1.39379640396958309755959248832368758E+00L, /* 3fff64cfd75454ee7c00000000000000 */
+ 1.39925156885490681313299887733592186E+00L, /* 3fff663559cf1bc7c400000000000000 */
+ 1.40472808465191417726103395580139477E+00L, /* 3fff679c427f5a49f400000000000000 */
+ 1.41022603492571069194738697660795879E+00L, /* 3fff690492cbf9432c00000000000000 */
+ 1.41574550356846662335641440222389065E+00L, /* 3fff6a6e4c1d491e1800000000000000 */
+
+ 9.98018323540573404351050612604012713E-01L, /* 3ffefefc41f8d4bdb000000000000000 */
+ 9.98048781107475468932221929208026268E-01L, /* 3ffeff003ff556aa8800000000000000 */
+ 9.98079239603882895082165305211674422E-01L, /* 3ffeff043df9d4986000000000000000 */
+ 9.98109699029824021243584297735651489E-01L, /* 3ffeff083c064e972c00000000000000 */
+ 9.98140159385327269125909310787392315E-01L, /* 3ffeff0c3a1ac4b6ec00000000000000 */
+ 9.98170620670420977171843901487591211E-01L, /* 3ffeff10383737079400000000000000 */
+ 9.98201082885133511579667242585856002E-01L, /* 3ffeff14365ba5991c00000000000000 */
+ 9.98231546029493238547658506831794512E-01L, /* 3ffeff183488107b7c00000000000000 */
+ 9.98262010103528552029672482603928074E-01L, /* 3ffeff1c32bc77beb000000000000000 */
+ 9.98292475107267818223988342651864514E-01L, /* 3ffeff2030f8db72b000000000000000 */
+ 9.98322941040739375573309644096298143E-01L, /* 3ffeff242f3d3ba77000000000000000 */
+ 9.98353407903971645787066790944663808E-01L, /* 3ffeff282d89986cf000000000000000 */
+ 9.98383875696992967307963340317655820E-01L, /* 3ffeff2c2bddf1d32400000000000000 */
+ 9.98414344419831761845429696222709026E-01L, /* 3ffeff302a3a47ea0c00000000000000 */
+ 9.98444814072516340086593800151604228E-01L, /* 3ffeff34289e9ac19800000000000000 */
+ 9.98475284655075123740886056111776270E-01L, /* 3ffeff38270aea69c800000000000000 */
+ 9.98505756167536479006585636852832977E-01L, /* 3ffeff3c257f36f29400000000000000 */
+ 9.98536228609928799837547330753295682E-01L, /* 3ffeff4023fb806bf800000000000000 */
+ 9.98566701982280452432050310562772211E-01L, /* 3ffeff44227fc6e5ec00000000000000 */
+ 9.98597176284619802988373749030870385E-01L, /* 3ffeff48210c0a706800000000000000 */
+ 9.98627651516975245460372434536111541E-01L, /* 3ffeff4c1fa04b1b6800000000000000 */
+ 9.98658127679375173801901155457017012E-01L, /* 3ffeff501e3c88f6e800000000000000 */
+ 9.98688604771847954211239084543194622E-01L, /* 3ffeff541ce0c412e000000000000000 */
+ 9.98719082794421980642241010173165705E-01L, /* 3ffeff581b8cfc7f4c00000000000000 */
+ 9.98749561747125619293186105096538085E-01L, /* 3ffeff5c1a41324c2400000000000000 */
+ 9.98780041629987291873504773320746608E-01L, /* 3ffeff6018fd65896800000000000000 */
+ 9.98810522443035364581476187595399097E-01L, /* 3ffeff6417c196471000000000000000 */
+ 9.98841004186298203615379520670103375E-01L, /* 3ffeff68168dc4951400000000000000 */
+ 9.98871486859804230684645176552294288E-01L, /* 3ffeff6c1561f0837400000000000000 */
+ 9.98901970463581839743127943620493170E-01L, /* 3ffeff70143e1a222c00000000000000 */
+ 9.98932454997659369233531378995394334E-01L, /* 3ffeff74132241813000000000000000 */
+ 9.98962940462065268620861502313346136E-01L, /* 3ffeff78120e66b08400000000000000 */
+ 9.98993426856827904103397486323956400E-01L, /* 3ffeff7c110289c02000000000000000 */
+ 9.99023914181975669634994119405746460E-01L, /* 3ffeff800ffeaac00000000000000000 */
+ 9.99054402437536959169506189937237650E-01L, /* 3ffeff840f02c9c02000000000000000 */
+ 9.99084891623540138905212870668037795E-01L, /* 3ffeff880e0ee6d07800000000000000 */
+ 9.99115381740013658307120181234495249E-01L, /* 3ffeff8c0d2302010c00000000000000 */
+ 9.99145872786985911329082910015131347E-01L, /* 3ffeff900c3f1b61d800000000000000 */
+ 9.99176364764485236413804614130640402E-01L, /* 3ffeff940b633302d000000000000000 */
+ 9.99206857672540083026291313217370771E-01L, /* 3ffeff980a8f48f3f800000000000000 */
+ 9.99237351511178817364822180024930276E-01L, /* 3ffeff9c09c35d454800000000000000 */
+ 9.99267846280429861138827618560753763E-01L, /* 3ffeffa008ff7006c000000000000000 */
+ 9.99298341980321608302162417203362565E-01L, /* 3ffeffa4084381485c00000000000000 */
+ 9.99328838610882452808681364331278019E-01L, /* 3ffeffa8078f911a1800000000000000 */
+ 9.99359336172140816367814863951934967E-01L, /* 3ffeffac06e39f8bf400000000000000 */
+ 9.99389834664125092933417704443854745E-01L, /* 3ffeffb0063facadec00000000000000 */
+ 9.99420334086863676459344674185558688E-01L, /* 3ffeffb405a3b88ffc00000000000000 */
+ 9.99450834440384988655026177184481639E-01L, /* 3ffeffb8050fc3422400000000000000 */
+ 9.99481335724717395718741386190231424E-01L, /* 3ffeffbc0483ccd45c00000000000000 */
+ 9.99511837939889374871071936468069907E-01L, /* 3ffeffc003ffd556ac00000000000000 */
+ 9.99542341085929264554721385138691403E-01L, /* 3ffeffc40383dcd90800000000000000 */
+ 9.99572845162865514234695751838444266E-01L, /* 3ffeffc8030fe36b7400000000000000 */
+ 9.99603350170726517864849824945849832E-01L, /* 3ffeffcc02a3e91dec00000000000000 */
+ 9.99633856109540669399038392839429434E-01L, /* 3ffeffd0023fee006c00000000000000 */
+ 9.99664362979336418302267475155531429E-01L, /* 3ffeffd401e3f222f800000000000000 */
+ 9.99694870780142130772816244643763639E-01L, /* 3ffeffd8018ff5958800000000000000 */
+ 9.99725379511986284031266336569387931E-01L, /* 3ffeffdc0143f8682400000000000000 */
+ 9.99755889174897216520321308053098619E-01L, /* 3ffeffe000fffaaac000000000000000 */
+ 9.99786399768903377704987178731244057E-01L, /* 3ffeffe400c3fc6d6000000000000000 */
+ 9.99816911294033217050269968240172602E-01L, /* 3ffeffe8008ffdc00800000000000000 */
+ 9.99847423750315072998873233700578567E-01L, /* 3ffeffec0063feb2ac00000000000000 */
+ 9.99877937137777450526954226006637327E-01L, /* 3ffefff0003fff555800000000000000 */
+ 9.99908451456448688077216502279043198E-01L, /* 3ffefff40023ffb80000000000000000 */
+ 9.99938966706357262870241697783058044E-01L, /* 3ffefff8000fffeaac00000000000000 */
+ 9.99969482887531541104308985268289689E-01L, /* 3ffefffc0003fffd5400000000000000 */
+#define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
+ 1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+ 1.00003051804379100575559391472779680E+00L, /* 3fff0002000200015400000000000000 */
+ 1.00006103701893306334724798034585547E+00L, /* 3fff00040008000aac00000000000000 */
+ 1.00009155692545448346209013834595680E+00L, /* 3fff0006001200240000000000000000 */
+ 1.00012207776338379883185325525118969E+00L, /* 3fff0008002000555800000000000000 */
+ 1.00015259953274932014366527255333494E+00L, /* 3fff000a003200a6ac00000000000000 */
+ 1.00018312223357958012925905677548144E+00L, /* 3fff000c004801200400000000000000 */
+ 1.00021364586590294498691378066723701E+00L, /* 3fff000e006201c95c00000000000000 */
+ 1.00024417042974783642605984823603649E+00L, /* 3fff0010008002aab400000000000000 */
+ 1.00027469592514273166727889474714175E+00L, /* 3fff001200a203cc1000000000000000 */
+ 1.00030522235211605242000132420798764E+00L, /* 3fff001400c805357000000000000000 */
+ 1.00033574971069616488250630936818197E+00L, /* 3fff001600f206eed000000000000000 */
+ 1.00036627800091160178652671675081365E+00L, /* 3fff0018012009003800000000000000 */
+ 1.00039680722279067381919048784766346E+00L, /* 3fff001a01520b71a000000000000000 */
+ 1.00042733737636191371223048918182030E+00L, /* 3fff001c01880e4b1000000000000000 */
+ 1.00045786846165368766392589350289200E+00L, /* 3fff001e01c211948400000000000000 */
+ 1.00048840047869447289485833607614040E+00L, /* 3fff0020020015560000000000000000 */
+ 1.00051893342751269111445822090900037E+00L, /* 3fff0022024219978400000000000000 */
+ 1.00054946730813676403215595200890675E+00L, /* 3fff002402881e611000000000000000 */
+ 1.00058000212059516886853316464112140E+00L, /* 3fff002602d223baa800000000000000 */
+ 1.00061053786491632733302026281307917E+00L, /* 3fff0028032029ac4c00000000000000 */
+ 1.00064107454112866113504765053221490E+00L, /* 3fff002a0372303dfc00000000000000 */
+ 1.00067161214926059198404573180596344E+00L, /* 3fff002c03c83777b800000000000000 */
+ 1.00070215068934059710059614189958666E+00L, /* 3fff002e04223f618400000000000000 */
+ 1.00073269016139709819412928482051939E+00L, /* 3fff0030048048036000000000000000 */
+ 1.00076323056545857248522679583402351E+00L, /* 3fff003204e251655000000000000000 */
+ 1.00079377190155338617216784768970683E+00L, /* 3fff003405485b8f5000000000000000 */
+ 1.00082431416971007198668530691065826E+00L, /* 3fff003605b266896800000000000000 */
+ 1.00085485736995705163820957750431262E+00L, /* 3fff00380620725b9800000000000000 */
+ 1.00088540150232269132501983222027775E+00L, /* 3fff003a06927f0ddc00000000000000 */
+ 1.00091594656683552377884893758164253E+00L, /* 3fff003c07088ca83c00000000000000 */
+ 1.00094649256352402622027852885366883E+00L, /* 3fff003e07829b32bc00000000000000 */
+ 1.00097703949241650933643654752813745E+00L, /* 3fff00400800aab55400000000000000 */
+ 1.00100758735354156137020709138596430E+00L, /* 3fff00420882bb381000000000000000 */
+ 1.00103813614692760403102056443458423E+00L, /* 3fff00440908ccc2f000000000000000 */
+ 1.00106868587260300351715613942360505E+00L, /* 3fff00460992df5df000000000000000 */
+ 1.00109923653059629256034668287611566E+00L, /* 3fff00480a20f3111800000000000000 */
+ 1.00112978812093589287002259879955091E+00L, /* 3fff004a0ab307e46800000000000000 */
+ 1.00116034064365022615561429120134562E+00L, /* 3fff004c0b491ddfe000000000000000 */
+ 1.00119089409876788066000585786241572E+00L, /* 3fff004e0be3350b8c00000000000000 */
+ 1.00122144848631711155917400901671499E+00L, /* 3fff00500c814d6f6000000000000000 */
+ 1.00125200380632656260715407370298635E+00L, /* 3fff00520d2367136c00000000000000 */
+ 1.00128256005882454449107399341301061E+00L, /* 3fff00540dc981ffa800000000000000 */
+ 1.00131311724383964545381786592770368E+00L, /* 3fff00560e739e3c2000000000000000 */
+ 1.00134367536140017618251363273884635E+00L, /* 3fff00580f21bbd0cc00000000000000 */
+ 1.00137423441153472492004539162735455E+00L, /* 3fff005a0fd3dac5b800000000000000 */
+ 1.00140479439427171337584354660066310E+00L, /* 3fff005c1089fb22e400000000000000 */
+ 1.00143535530963956325933850166620687E+00L, /* 3fff005e11441cf05000000000000000 */
+ 1.00146591715766680730226312334707472E+00L, /* 3fff0060120240360400000000000000 */
+ 1.00149647993838186721404781565070152E+00L, /* 3fff006212c464fc0000000000000000 */
+ 1.00152704365181316470412298258452211E+00L, /* 3fff0064138a8b4a4400000000000000 */
+ 1.00155760829798923250422149067162536E+00L, /* 3fff00661454b328d800000000000000 */
+ 1.00158817387693849232377374391944613E+00L, /* 3fff00681522dc9fbc00000000000000 */
+ 1.00161874038868942138336137759324629E+00L, /* 3fff006a15f507b6f400000000000000 */
+ 1.00164930783327055241471725821611471E+00L, /* 3fff006c16cb34768800000000000000 */
+ 1.00167987621071025161612055853765924E+00L, /* 3fff006e17a562e67400000000000000 */
+ 1.00171044552103705171930414508096874E+00L, /* 3fff00701883930ec000000000000000 */
+ 1.00174101576427937443369842185347807E+00L, /* 3fff00721965c4f76c00000000000000 */
+ 1.00177158694046569697988502412044909E+00L, /* 3fff00741a4bf8a87c00000000000000 */
+ 1.00180215904962455208959681840497069E+00L, /* 3fff00761b362e29f800000000000000 */
+ 1.00183273209178441698341543997230474E+00L, /* 3fff00781c246583e400000000000000 */
+ 1.00186330606697365785962006157205906E+00L, /* 3fff007a1d169ebe3c00000000000000 */
+ 1.00189388097522080744994354972732253E+00L, /* 3fff007c1e0cd9e10800000000000000 */
+ 1.00192445681655439848611877096118405E+00L, /* 3fff007e1f0716f45000000000000000 */
+ 1.00195503359100279716642489802325144E+00L, /* 3fff0080200556001000000000000000 */
+ 1.00198561129859459173374602869444061E+00L, /* 3fff00822107970c5400000000000000 */
+};
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
index 737c7c73fa..daeba17942 100644
--- a/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/t_sincosl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
new file mode 100644
index 0000000000..a2571649ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c
@@ -0,0 +1,230 @@
+/* Test iscanonical and canonicalizel for ldbl-128ibm.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo;
+ bool canonical;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 0.0, true },
+ { __builtin_nan (""), DBL_MAX, true },
+ { __builtin_nan (""), __builtin_inf (), true },
+ { __builtin_nan (""), __builtin_nan (""), true },
+ { __builtin_nan (""), __builtin_nans (""), true },
+ { __builtin_nans (""), 0.0, true },
+ { __builtin_nans (""), DBL_MAX, true },
+ { __builtin_nans (""), __builtin_inf (), true },
+ { __builtin_nans (""), __builtin_nan (""), true },
+ { __builtin_nans (""), __builtin_nans (""), true },
+ { __builtin_inf (), 0.0, true },
+ { __builtin_inf (), -0.0, true },
+ { -__builtin_inf (), 0.0, true },
+ { -__builtin_inf (), -0.0, true },
+ { __builtin_inf (), DBL_TRUE_MIN, false },
+ { __builtin_inf (), -DBL_TRUE_MIN, false },
+ { -__builtin_inf (), DBL_TRUE_MIN, false },
+ { -__builtin_inf (), -DBL_TRUE_MIN, false },
+ { __builtin_inf (), DBL_MIN, false },
+ { __builtin_inf (), -DBL_MIN, false },
+ { -__builtin_inf (), DBL_MIN, false },
+ { -__builtin_inf (), -DBL_MIN, false },
+ { __builtin_inf (), __builtin_inf (), false },
+ { __builtin_inf (), -__builtin_inf (), false },
+ { -__builtin_inf (), __builtin_inf (), false },
+ { -__builtin_inf (), -__builtin_inf (), false },
+ { __builtin_inf (), __builtin_nan (""), false },
+ { __builtin_inf (), -__builtin_nan (""), false },
+ { -__builtin_inf (), __builtin_nan (""), false },
+ { -__builtin_inf (), -__builtin_nan (""), false },
+ { 0.0, 0.0, true },
+ { 0.0, -0.0, true },
+ { -0.0, 0.0, true },
+ { -0.0, -0.0, true },
+ { 0.0, DBL_TRUE_MIN, false },
+ { 0.0, -DBL_TRUE_MIN, false },
+ { -0.0, DBL_TRUE_MIN, false },
+ { -0.0, -DBL_TRUE_MIN, false },
+ { 0.0, DBL_MAX, false },
+ { 0.0, -DBL_MAX, false },
+ { -0.0, DBL_MAX, false },
+ { -0.0, -DBL_MAX, false },
+ { 0.0, __builtin_inf (), false },
+ { 0.0, -__builtin_inf (), false },
+ { -0.0, __builtin_inf (), false },
+ { -0.0, -__builtin_inf (), false },
+ { 0.0, __builtin_nan (""), false },
+ { 0.0, -__builtin_nan (""), false },
+ { -0.0, __builtin_nan (""), false },
+ { -0.0, -__builtin_nan (""), false },
+ { 1.0, 0.0, true },
+ { 1.0, -0.0, true },
+ { -1.0, 0.0, true },
+ { -1.0, -0.0, true },
+ { 1.0, DBL_TRUE_MIN, true },
+ { 1.0, -DBL_TRUE_MIN, true },
+ { -1.0, DBL_TRUE_MIN, true },
+ { -1.0, -DBL_TRUE_MIN, true },
+ { 1.0, DBL_MAX, false },
+ { 1.0, -DBL_MAX, false },
+ { -1.0, DBL_MAX, false },
+ { -1.0, -DBL_MAX, false },
+ { 1.0, __builtin_inf (), false },
+ { 1.0, -__builtin_inf (), false },
+ { -1.0, __builtin_inf (), false },
+ { -1.0, -__builtin_inf (), false },
+ { 1.0, __builtin_nan (""), false },
+ { 1.0, -__builtin_nan (""), false },
+ { -1.0, __builtin_nan (""), false },
+ { -1.0, -__builtin_nan (""), false },
+ { 0x1p1023, 0x1.1p969, true },
+ { 0x1p1023, -0x1.1p969, true },
+ { -0x1p1023, 0x1.1p969, true },
+ { -0x1p1023, -0x1.1p969, true },
+ { 0x1p1023, 0x1.1p970, false },
+ { 0x1p1023, -0x1.1p970, false },
+ { -0x1p1023, 0x1.1p970, false },
+ { -0x1p1023, -0x1.1p970, false },
+ { 0x1p1023, 0x1p970, true },
+ { 0x1p1023, -0x1p970, true },
+ { -0x1p1023, 0x1p970, true },
+ { -0x1p1023, -0x1p970, true },
+ { 0x1.0000000000001p1023, 0x1p970, false },
+ { 0x1.0000000000001p1023, -0x1p970, false },
+ { -0x1.0000000000001p1023, 0x1p970, false },
+ { -0x1.0000000000001p1023, -0x1p970, false },
+ { 0x1p-969, 0x1.1p-1023, true },
+ { 0x1p-969, -0x1.1p-1023, true },
+ { -0x1p-969, 0x1.1p-1023, true },
+ { -0x1p-969, -0x1.1p-1023, true },
+ { 0x1p-969, 0x1.1p-1022, false },
+ { 0x1p-969, -0x1.1p-1022, false },
+ { -0x1p-969, 0x1.1p-1022, false },
+ { -0x1p-969, -0x1.1p-1022, false },
+ { 0x1p-969, 0x1p-1022, true },
+ { 0x1p-969, -0x1p-1022, true },
+ { -0x1p-969, 0x1p-1022, true },
+ { -0x1p-969, -0x1p-1022, true },
+ { 0x1.0000000000001p-969, 0x1p-1022, false },
+ { 0x1.0000000000001p-969, -0x1p-1022, false },
+ { -0x1.0000000000001p-969, 0x1p-1022, false },
+ { -0x1.0000000000001p-969, -0x1p-1022, false },
+ { 0x1p-970, 0x1.1p-1024, true },
+ { 0x1p-970, -0x1.1p-1024, true },
+ { -0x1p-970, 0x1.1p-1024, true },
+ { -0x1p-970, -0x1.1p-1024, true },
+ { 0x1p-970, 0x1.1p-1023, false },
+ { 0x1p-970, -0x1.1p-1023, false },
+ { -0x1p-970, 0x1.1p-1023, false },
+ { -0x1p-970, -0x1.1p-1023, false },
+ { 0x1p-970, 0x1p-1023, true },
+ { 0x1p-970, -0x1p-1023, true },
+ { -0x1p-970, 0x1p-1023, true },
+ { -0x1p-970, -0x1p-1023, true },
+ { 0x1.0000000000001p-970, 0x1p-1023, false },
+ { 0x1.0000000000001p-970, -0x1p-1023, false },
+ { -0x1.0000000000001p-970, 0x1p-1023, false },
+ { -0x1.0000000000001p-970, -0x1p-1023, false },
+ { 0x1p-1000, 0x1.1p-1054, true },
+ { 0x1p-1000, -0x1.1p-1054, true },
+ { -0x1p-1000, 0x1.1p-1054, true },
+ { -0x1p-1000, -0x1.1p-1054, true },
+ { 0x1p-1000, 0x1.1p-1053, false },
+ { 0x1p-1000, -0x1.1p-1053, false },
+ { -0x1p-1000, 0x1.1p-1053, false },
+ { -0x1p-1000, -0x1.1p-1053, false },
+ { 0x1p-1000, 0x1p-1053, true },
+ { 0x1p-1000, -0x1p-1053, true },
+ { -0x1p-1000, 0x1p-1053, true },
+ { -0x1p-1000, -0x1p-1053, true },
+ { 0x1.0000000000001p-1000, 0x1p-1053, false },
+ { 0x1.0000000000001p-1000, -0x1p-1053, false },
+ { -0x1.0000000000001p-1000, 0x1p-1053, false },
+ { -0x1.0000000000001p-1000, -0x1p-1053, false },
+ { 0x1p-1021, 0x1p-1074, true },
+ { 0x1p-1021, -0x1p-1074, true },
+ { -0x1p-1021, 0x1p-1074, true },
+ { -0x1p-1021, -0x1p-1074, true },
+ { 0x1.0000000000001p-1021, 0x1p-1074, false },
+ { 0x1.0000000000001p-1021, -0x1p-1074, false },
+ { -0x1.0000000000001p-1021, 0x1p-1074, false },
+ { -0x1.0000000000001p-1021, -0x1p-1074, false },
+ { 0x1p-1022, 0x1p-1074, false },
+ { 0x1p-1022, -0x1p-1074, false },
+ { -0x1p-1022, 0x1p-1074, false },
+ { -0x1p-1022, -0x1p-1074, false },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ld = ldbl_pack (tests[i].hi, tests[i].lo);
+ bool canonical = iscanonical (ld);
+ if (canonical == tests[i].canonical)
+ {
+ printf ("PASS: iscanonical test %zu\n", i);
+ long double ldc = 12345.0L;
+ bool canonicalize_ret = canonicalizel (&ldc, &ld);
+ if (canonicalize_ret == !canonical)
+ {
+ printf ("PASS: canonicalizel test %zu\n", i);
+ bool canon_ok;
+ if (!canonical)
+ canon_ok = ldc == 12345.0L;
+ else if (isnan (ld))
+ canon_ok = isnan (ldc) && !issignaling (ldc);
+ else
+ canon_ok = ldc == ld;
+ if (canon_ok)
+ printf ("PASS: canonicalized value test %zu\n", i);
+ else
+ {
+ printf ("FAIL: canonicalized value test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: canonicalizel test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: iscanonical test %zu\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
new file mode 100644
index 0000000000..c717616e3c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodl-ldbl-128ibm.c
@@ -0,0 +1,21 @@
+/* Test for ldbl-128ibm fmodl handling of equal values (bug 19602).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC fmodl
+#define SETUP
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
new file mode 100644
index 0000000000..ce959faf90
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-fmodrem-ldbl-128ibm.c
@@ -0,0 +1,84 @@
+/* Test for ldbl-128ibm fmodl etc. handling of equal values.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <fenv.h>
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+/* FUNC is defined to be the name of the function to test. */
+#define STRX(x) #x
+#define STR(x) STRX (x)
+#define SFUNC STR (FUNC)
+
+union u
+{
+ long double ld;
+ double d[2];
+};
+
+volatile union u p1 = { .d = { DBL_MIN, 0.0 } };
+volatile union u p2 = { .d = { DBL_MIN, -0.0 } };
+volatile union u m1 = { .d = { -DBL_MIN, 0.0 } };
+volatile union u m2 = { .d = { -DBL_MIN, -0.0 } };
+
+static int
+test_func (const char *s, long double x, long double y, long double expected)
+{
+ volatile long double r;
+ r = FUNC (x, y);
+ if (r != expected || copysignl (1.0, r) != copysignl (1.0, expected))
+ {
+ printf ("FAIL: " SFUNC " (%s)\n", s);
+ return 1;
+ }
+ else
+ {
+ printf ("PASS: " SFUNC " (%s)\n", s);
+ return 0;
+ }
+}
+
+#define TEST_FUNC(a, b, e) test_func (#a ", " #b, a, b, e)
+
+static int
+do_test (void)
+{
+ int result = 0;
+ SETUP;
+ result |= TEST_FUNC (p1.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p1.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, p2.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m1.ld, 0.0L);
+ result |= TEST_FUNC (p2.ld, m2.ld, 0.0L);
+ result |= TEST_FUNC (m1.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m1.ld, m2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, p2.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m1.ld, -0.0L);
+ result |= TEST_FUNC (m2.ld, m2.ld, -0.0L);
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../../../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..829cf48c89
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remainderl-ldbl-128ibm.c
@@ -0,0 +1,21 @@
+/* Test for ldbl-128ibm remainderl handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define FUNC remainderl
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
new file mode 100644
index 0000000000..446e84146d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-remquol-ldbl-128ibm.c
@@ -0,0 +1,30 @@
+/* Test for ldbl-128ibm remquol handling of equal values (bug 19677).
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+
+static long double
+wrap_remquol (long double x, long double y)
+{
+ int quo;
+ return remquol (x, y, &quo);
+}
+
+#define FUNC wrap_remquol
+#define SETUP fesetround (FE_DOWNWARD)
+#include "test-fmodrem-ldbl-128ibm.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
new file mode 100644
index 0000000000..6412e1781d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
@@ -0,0 +1,73 @@
+/* Test totalorderl and totalordermagl for ldbl-128ibm.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+struct test
+{
+ double hi, lo1, lo2;
+};
+
+static const struct test tests[] =
+ {
+ { __builtin_nan (""), 1, __builtin_nans ("") },
+ { -__builtin_nan (""), 1, __builtin_nans ("") },
+ { __builtin_nans (""), 1, __builtin_nan ("") },
+ { -__builtin_nans (""), 1, __builtin_nan ("") },
+ { __builtin_inf (), 0.0, -0.0 },
+ { -__builtin_inf (), 0.0, -0.0 },
+ { 1.5, 0.0, -0.0 },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ldx = ldbl_pack (tests[i].hi, tests[i].lo1);
+ long double ldy = ldbl_pack (tests[i].hi, tests[i].lo2);
+ bool to1 = totalorderl (ldx, ldy);
+ bool to2 = totalorderl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu\n", i);
+ else
+ {
+ printf ("FAIL: test %zu\n", i);
+ result = 1;
+ }
+ to1 = totalordermagl (ldx, ldy);
+ to2 = totalordermagl (ldy, ldx);
+ if (to1 && to2)
+ printf ("PASS: test %zu (totalordermagl)\n", i);
+ else
+ {
+ printf ("FAIL: test %zu (totalordermagl)\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
index 14dc683619..1893c04dda 100644
--- a/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
+++ b/sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c
@@ -1,5 +1,5 @@
/* Test for ldbl-128ibm strtold overflow to infinity (bug 14551).
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-128ibm/w_expl.c b/sysdeps/ieee754/ldbl-128ibm/w_expl.c
deleted file mode 100644
index c9d44b61dd..0000000000
--- a/sysdeps/ieee754/ldbl-128ibm/w_expl.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <math.h>
-#include <math_private.h>
-#include <math_ldbl_opt.h>
-
-long double __expl(long double x) /* wrapper exp */
-{
- long double z;
- z = __ieee754_expl(x);
- if (_LIB_VERSION == _IEEE_)
- return z;
- if (isfinite(x))
- {
- if (!isfinite (z))
- return __kernel_standard_l(x,x,206); /* exp overflow */
- else if (z == 0.0L)
- return __kernel_standard_l(x,x,207); /* exp underflow */
- }
- return z;
-}
-hidden_def (__expl)
-long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
index da2e929175..e299c48748 100644
--- a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_split.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (double *hi, double *lo, double x, double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (double *hi, double *lo, double x, double y)
-{
-#ifdef __FP_FAST_FMA
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fma (x, y, -*hi);
-#elif defined FP_FAST_FMA
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fma (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1 << (DBL_MANT_DIG + 1) / 2) + 1)
- double x1 = x * C;
- double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- double x2 = x - x1;
- double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
diff --git a/sysdeps/ieee754/ldbl-64-128/e_ilogbl.c b/sysdeps/ieee754/ldbl-64-128/e_ilogbl.c
deleted file mode 100644
index 75a38e13ce..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/e_ilogbl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/ldbl-128/e_ilogbl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c b/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
deleted file mode 100644
index 4e8a541263..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_asinhl.c>
-long_double_symbol (libm, __asinhl, asinhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_atanl.c b/sysdeps/ieee754/ldbl-64-128/s_atanl.c
deleted file mode 100644
index c23d14aade..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_atanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_atanl.c>
-long_double_symbol (libm, __atanl, atanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
deleted file mode 100644
index ace5645277..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
-long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_ceill.c b/sysdeps/ieee754/ldbl-64-128/s_ceill.c
deleted file mode 100644
index a646494f14..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_ceill.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_ceill.c>
-long_double_symbol (libm, __ceill, ceill);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
index 211e7240ac..11b42d04ba 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __copysignl, copysignl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __copysignl, copysignl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cosl.c b/sysdeps/ieee754/ldbl-64-128/s_cosl.c
deleted file mode 100644
index 6a7e2e3162..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cosl.c>
-long_double_symbol (libm, __cosl, cosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_erfl.c b/sysdeps/ieee754/ldbl-64-128/s_erfl.c
deleted file mode 100644
index c5f9bb3ac4..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_erfl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_erfl.c>
-long_double_symbol (libm, __erfl, erfl);
-long_double_symbol (libm, __erfcl, erfcl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c b/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
deleted file mode 100644
index 4fb186127f..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_expm1l.c>
-long_double_symbol (libm, __expm1l, expm1l);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c b/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
deleted file mode 100644
index 93d81d98bc..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fabsl.c>
-long_double_symbol (libm, __fabsl, fabsl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_finitel.c b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
index c0862a7485..5a16e6a277 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_finitel.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_floorl.c b/sysdeps/ieee754/ldbl-64-128/s_floorl.c
deleted file mode 100644
index 953043035e..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_floorl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_floorl.c>
-long_double_symbol (libm, __floorl, floorl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fmal.c b/sysdeps/ieee754/ldbl-64-128/s_fmal.c
deleted file mode 100644
index 218aa52b35..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c b/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
index a10b6c3a1a..a14cea4001 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_fpclassifyl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
index c7b6aaaaee..73ac41e40c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __frexpl, frexpl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __frexpl, frexpl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
index 6dab0e9223..94d0b06277 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isinfl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#if !IS_IN (libm)
# undef weak_alias
diff --git a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
index ad5ecc5281..9a7a29770c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_isnanl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#if !IS_IN (libm)
# undef weak_alias
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c b/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
deleted file mode 100644
index 1515f3abd7..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llrintl.c>
-long_double_symbol (libm, __llrintl, llrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c b/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
deleted file mode 100644
index ca35dae491..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llroundl.c>
-long_double_symbol (libm, __llroundl, llroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_log1pl.c b/sysdeps/ieee754/ldbl-64-128/s_log1pl.c
deleted file mode 100644
index 11d56bfe9f..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_log1pl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/ldbl-128/s_log1pl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_logbl.c b/sysdeps/ieee754/ldbl-64-128/s_logbl.c
deleted file mode 100644
index 8ba8179feb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_logbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_logbl.c>
-long_double_symbol (libm, __logbl, logbl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c b/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
deleted file mode 100644
index 56e69c94f9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lrintl.c>
-long_double_symbol (libm, __lrintl, lrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c b/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
deleted file mode 100644
index d5429e2384..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lroundl.c>
-long_double_symbol (libm, __lroundl, lroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_modfl.c b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
index fa4d3ad82a..7d7aeae111 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
@@ -1,9 +1,10 @@
#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
#include <sysdeps/ieee754/ldbl-128/s_modfl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __modfl, modfl);
-#else
+#if IS_IN (libc)
long_double_symbol (libc, __modfl, modfl);
#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
deleted file mode 100644
index a6d0a313fd..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_nearbyintl.c>
-long_double_symbol (libm, __nearbyintl, nearbyintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
index 64c663eda3..5218abea5e 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_nextafterl.c
@@ -4,3 +4,6 @@
#include <sysdeps/ieee754/ldbl-128/s_nextafterl.c>
long_double_symbol (libm, __nextafterl, nextafterl);
long_double_symbol (libm, __nexttowardl, nexttowardl);
+#undef weak_alias
+#define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+libm_alias_ldouble_other (__nextafter, nextafter)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_remquol.c b/sysdeps/ieee754/ldbl-64-128/s_remquol.c
deleted file mode 100644
index 16f0eb16a4..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_remquol.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_remquol.c>
-long_double_symbol (libm, __remquol, remquol);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_rintl.c b/sysdeps/ieee754/ldbl-64-128/s_rintl.c
deleted file mode 100644
index 19af9bbdcb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_rintl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_rintl.c>
-long_double_symbol (libm, __rintl, rintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_roundl.c b/sysdeps/ieee754/ldbl-64-128/s_roundl.c
deleted file mode 100644
index 3fa99d6f2a..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_roundl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_roundl.c>
-long_double_symbol (libm, __roundl, roundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c b/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c
deleted file mode 100644
index 97181d29b9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_scalblnl.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_scalblnl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c b/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
deleted file mode 100644
index 15af1b2849..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_scalbnl.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_scalbnl.c>
diff --git a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
index 850db7386a..39e0c34b6c 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_signbitl.c
@@ -1,3 +1,5 @@
+#include <math.h>
+#include <math_private.h>
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c b/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
deleted file mode 100644
index ce0d4e2887..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sincosl.c>
-long_double_symbol (libm, __sincosl, sincosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sinl.c b/sysdeps/ieee754/ldbl-64-128/s_sinl.c
deleted file mode 100644
index ebc20affdb..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sinl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sinl.c>
-long_double_symbol (libm, __sinl, sinl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c b/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
deleted file mode 100644
index ede93930cd..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanhl.c>
-long_double_symbol (libm, __tanhl, tanhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanl.c b/sysdeps/ieee754/ldbl-64-128/s_tanl.c
deleted file mode 100644
index 6e635dfdc9..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanl.c>
-long_double_symbol (libm, __tanl, tanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_truncl.c b/sysdeps/ieee754/ldbl-64-128/s_truncl.c
deleted file mode 100644
index 6311479d01..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/s_truncl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_truncl.c>
-long_double_symbol (libm, __truncl, truncl);
diff --git a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-128/strtold_l.c
index a8181740a8..448c26bbd0 100644
--- a/sysdeps/ieee754/ldbl-64-128/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-64-128/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,10 +15,21 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define strtof128_l __hide_strtof128_l
+# define wcstof128_l __hide_wcstof128_l
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <math.h>
#include <stdlib.h>
#include <wchar.h>
-#include <xlocale.h>
/* The actual implementation for all floating point sizes is in strtod.c.
These macros tell it to produce the `long double' version, `strtold'. */
@@ -26,13 +37,13 @@
#define FLOAT long double
#define FLT LDBL
#ifdef USE_WIDE_CHAR
-extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, __locale_t);
+extern long double ____new_wcstold_l (const wchar_t *, wchar_t **, locale_t);
# define STRTOF __new_wcstold_l
# define __STRTOF ____new_wcstold_l
# define ____STRTOF_INTERNAL ____wcstold_l_internal
# define STRTOF_NAN __wcstold_nan
#else
-extern long double ____new_strtold_l (const char *, char **, __locale_t);
+extern long double ____new_strtold_l (const char *, char **, locale_t);
# define STRTOF __new_strtold_l
# define __STRTOF ____new_strtold_l
# define ____STRTOF_INTERNAL ____strtold_l_internal
@@ -58,3 +69,23 @@ long_double_symbol (libc, ___new_strtold_l, strtold_l);
long_double_symbol (libc, ____new_strtold_l, __strtold_l);
# endif
#endif
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# undef strtof128_l
+# undef wcstof128_l
+# ifdef USE_WIDE_CHAR
+weak_alias (____new_wcstold_l, wcstof128_l)
+# else
+weak_alias (____new_strtold_l, strtof128_l)
+# endif
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (____new_wcstold_l, wcstof64x_l)
+# else
+weak_alias (____new_strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-64-128/w_expl.c b/sysdeps/ieee754/ldbl-64-128/w_expl.c
deleted file mode 100644
index 2a402b04c0..0000000000
--- a/sysdeps/ieee754/ldbl-64-128/w_expl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/w_expl.c>
-long_double_symbol (libm, __expl, expl);
diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
new file mode 100644
index 0000000000..790f670e44
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/Makefile
@@ -0,0 +1,21 @@
+# Makefile for sysdeps/ieee754/ldbl-96.
+# Copyright (C) 2016-2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),math)
+tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96
+endif
diff --git a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
new file mode 100644
index 0000000000..e1ee1356b7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
@@ -0,0 +1,54 @@
+/* Define iscanonical macro. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
+#endif
+
+extern int __iscanonicall (long double __x)
+ __THROW __attribute__ ((__const__));
+#define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
+#define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+#if __HAVE_DISTINCT_FLOAT128
+# define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+#endif
+
+/* Return nonzero value if X is canonical. In IEEE interchange binary
+ formats, all values are canonical, but the argument must still be
+ converted to its semantic type for any exceptions arising from the
+ conversion, before being discarded; in extended precision, there
+ are encodings that are not consistently handled as corresponding to
+ any particular value of the type, and we return 0 for those. */
+#ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+#else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile)). */
+extern "C++" {
+inline int iscanonical (float __val) { return __iscanonicalf (__val); }
+inline int iscanonical (double __val) { return __iscanonical (__val); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+#endif /* __cplusplus */
diff --git a/sysdeps/ieee754/ldbl-96/bits/long-double.h b/sysdeps/ieee754/ldbl-96/bits/long-double.h
new file mode 100644
index 0000000000..28488e0b05
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/bits/long-double.h
@@ -0,0 +1,20 @@
+/* Properties of long double type. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* long double is distinct from double, so there is nothing to
+ define here. */
diff --git a/sysdeps/ieee754/ldbl-96/e_acoshl.c b/sysdeps/ieee754/ldbl-96/e_acoshl.c
index cf9a6db0ef..56b04d4cc4 100644
--- a/sysdeps/ieee754/ldbl-96/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-96/e_acoshl.c
@@ -39,7 +39,7 @@ long double
__ieee754_acoshl(long double x)
{
long double t;
- u_int32_t se,i0,i1;
+ uint32_t se,i0,i1;
GET_LDOUBLE_WORDS(se,i0,i1,x);
if(se<0x3fff || se & 0x8000) { /* x < 1 */
return (x-x)/(x-x);
@@ -52,10 +52,10 @@ __ieee754_acoshl(long double x)
return 0.0; /* acosh(1) = 0 */
} else if (se > 0x4000) { /* 2**28 > x > 2 */
t=x*x;
- return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
+ return __ieee754_logl(2.0*x-one/(x+sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
diff --git a/sysdeps/ieee754/ldbl-96/e_asinl.c b/sysdeps/ieee754/ldbl-96/e_asinl.c
index f52b931459..806906a58a 100644
--- a/sysdeps/ieee754/ldbl-96/e_asinl.c
+++ b/sysdeps/ieee754/ldbl-96/e_asinl.c
@@ -61,6 +61,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
one = 1.0L,
@@ -96,7 +97,7 @@ __ieee754_asinl (long double x)
{
long double t, w, p, q, c, r, s;
int32_t ix;
- u_int32_t se, i0, i1, k;
+ uint32_t se, i0, i1, k;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -132,7 +133,7 @@ __ieee754_asinl (long double x)
t = w * 0.5;
p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
q = qS0 + t * (qS1 + t * (qS2 + t * (qS3 + t * (qS4 + t))));
- s = __ieee754_sqrtl (t);
+ s = sqrtl (t);
if (ix >= 0x3ffef999)
{ /* if |x| > 0.975 */
w = p / q;
diff --git a/sysdeps/ieee754/ldbl-96/e_atanhl.c b/sysdeps/ieee754/ldbl-96/e_atanhl.c
index b99a83c6ee..7312f84329 100644
--- a/sysdeps/ieee754/ldbl-96/e_atanhl.c
+++ b/sysdeps/ieee754/ldbl-96/e_atanhl.c
@@ -34,7 +34,9 @@
#include <float.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, huge = 1e4900L;
@@ -45,7 +47,7 @@ __ieee754_atanhl(long double x)
{
long double t;
int32_t ix;
- u_int32_t se,i0,i1;
+ uint32_t se,i0,i1;
GET_LDOUBLE_WORDS(se,i0,i1,x);
ix = se&0x7fff;
if ((ix+((((i0&0x7fffffff)|i1)|(-((i0&0x7fffffff)|i1)))>>31))>0x3fff)
diff --git a/sysdeps/ieee754/ldbl-96/e_coshl.c b/sysdeps/ieee754/ldbl-96/e_coshl.c
index dd22cae363..1edf2c1542 100644
--- a/sysdeps/ieee754/ldbl-96/e_coshl.c
+++ b/sysdeps/ieee754/ldbl-96/e_coshl.c
@@ -44,7 +44,7 @@ __ieee754_coshl (long double x)
{
long double t,w;
int32_t ex;
- u_int32_t mx,lx;
+ uint32_t mx,lx;
/* High word of |x|. */
GET_LDOUBLE_WORDS(ex,mx,lx,x);
diff --git a/sysdeps/ieee754/ldbl-96/e_gammal_r.c b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
index 8dd7a03918..fc7a5c55dc 100644
--- a/sysdeps/ieee754/ldbl-96/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,6 +19,7 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
#include <float.h>
/* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's
@@ -100,7 +101,7 @@ gammal_positive (long double x, int *exp2_adj)
long double ret = (__ieee754_powl (x_adj_mant, x_adj)
* __ieee754_exp2l (x_adj_log2 * x_adj_frac)
* __ieee754_expl (-x_adj)
- * __ieee754_sqrtl (2 * M_PIl / x_adj)
+ * sqrtl (2 * M_PIl / x_adj)
/ prod);
exp_adj += x_eps * __ieee754_logl (x_adj);
long double bsum = gamma_coeff[NCOEFF - 1];
@@ -115,7 +116,7 @@ gammal_positive (long double x, int *exp2_adj)
long double
__ieee754_gammal_r (long double x, int *signgamp)
{
- u_int32_t es, hx, lx;
+ uint32_t es, hx, lx;
long double ret;
GET_LDOUBLE_WORDS (es, hx, lx, x);
diff --git a/sysdeps/ieee754/ldbl-96/e_hypotl.c b/sysdeps/ieee754/ldbl-96/e_hypotl.c
index ee3a07055b..f664e30c98 100644
--- a/sysdeps/ieee754/ldbl-96/e_hypotl.c
+++ b/sysdeps/ieee754/ldbl-96/e_hypotl.c
@@ -48,11 +48,12 @@
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
long double __ieee754_hypotl(long double x, long double y)
{
long double a,b,t1,t2,y1,y2,w;
- u_int32_t j,k,ea,eb;
+ uint32_t j,k,ea,eb;
GET_LDOUBLE_EXP(ea,x);
ea &= 0x7fff;
@@ -65,9 +66,11 @@ long double __ieee754_hypotl(long double x, long double y)
k=0;
if(__builtin_expect(ea > 0x5f3f,0)) { /* a>2**8000 */
if(ea == 0x7fff) { /* Inf or NaN */
- u_int32_t exp __attribute__ ((unused));
- u_int32_t high,low;
+ uint32_t exp __attribute__ ((unused));
+ uint32_t high,low;
w = a+b; /* for sNaN */
+ if (issignaling (a) || issignaling (b))
+ return w;
GET_LDOUBLE_WORDS(exp,high,low,a);
if(((high&0x7fffffff)|low)==0) w = a;
GET_LDOUBLE_WORDS(exp,high,low,b);
@@ -81,8 +84,8 @@ long double __ieee754_hypotl(long double x, long double y)
}
if(__builtin_expect(eb < 0x20bf, 0)) { /* b < 2**-8000 */
if(eb == 0) { /* subnormal b or 0 */
- u_int32_t exp __attribute__ ((unused));
- u_int32_t high,low;
+ uint32_t exp __attribute__ ((unused));
+ uint32_t high,low;
GET_LDOUBLE_WORDS(exp,high,low,b);
if((high|low)==0) return a;
SET_LDOUBLE_WORDS(t1, 0x7ffd, 0x80000000, 0); /* t1=2^16382 */
@@ -111,13 +114,13 @@ long double __ieee754_hypotl(long double x, long double y)
/* medium size a and b */
w = a-b;
if (w>b) {
- u_int32_t high;
+ uint32_t high;
GET_LDOUBLE_MSW(high,a);
SET_LDOUBLE_WORDS(t1,ea,high,0);
t2 = a-t1;
- w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
+ w = sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
} else {
- u_int32_t high;
+ uint32_t high;
GET_LDOUBLE_MSW(high,b);
a = a+a;
SET_LDOUBLE_WORDS(y1,eb,high,0);
@@ -125,10 +128,10 @@ long double __ieee754_hypotl(long double x, long double y)
GET_LDOUBLE_MSW(high,a);
SET_LDOUBLE_WORDS(t1,ea+1,high,0);
t2 = a - t1;
- w = __ieee754_sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+ w = sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int32_t exp;
+ uint32_t exp;
t1 = 1.0;
GET_LDOUBLE_EXP(exp,t1);
SET_LDOUBLE_EXP(t1,exp+k);
diff --git a/sysdeps/ieee754/ldbl-96/e_j0l.c b/sysdeps/ieee754/ldbl-96/e_j0l.c
index a536054cde..e720ae9558 100644
--- a/sysdeps/ieee754/ldbl-96/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j0l.c
@@ -72,6 +72,7 @@
*/
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
static long double pzero (long double), qzero (long double);
@@ -108,7 +109,7 @@ __ieee754_j0l (long double x)
{
long double z, s, c, ss, cc, r, u, v;
int32_t ix;
- u_int32_t se;
+ uint32_t se;
GET_LDOUBLE_EXP (se, x);
ix = se & 0x7fff;
@@ -133,12 +134,12 @@ __ieee754_j0l (long double x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if (__glibc_unlikely (ix > 0x4080)) /* 2^129 */
- z = (invsqrtpi * cc) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * cc) / sqrtl (x);
else
{
u = pzero (x);
v = qzero (x);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * cc - v * ss) / sqrtl (x);
}
return z;
}
@@ -194,7 +195,7 @@ __ieee754_y0l (long double x)
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -235,12 +236,12 @@ __ieee754_y0l (long double x)
ss = z / cc;
}
if (__glibc_unlikely (ix > 0x4080)) /* 1e39 */
- z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * ss) / sqrtl (x);
else
{
u = pzero (x);
v = qzero (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrtl (x);
}
return z;
}
@@ -352,7 +353,7 @@ pzero (long double x)
const long double *p, *q;
long double z, r, s;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -490,7 +491,7 @@ qzero (long double x)
const long double *p, *q;
long double s, r, z;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c
index e8a7349cf4..581615d563 100644
--- a/sysdeps/ieee754/ldbl-96/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j1l.c
@@ -75,6 +75,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static long double pone (long double), qone (long double);
@@ -112,7 +113,7 @@ __ieee754_j1l (long double x)
{
long double z, c, r, s, ss, cc, u, v, y;
int32_t ix;
- u_int32_t se;
+ uint32_t se;
GET_LDOUBLE_EXP (se, x);
ix = se & 0x7fff;
@@ -137,12 +138,12 @@ __ieee754_j1l (long double x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if (__glibc_unlikely (ix > 0x4080))
- z = (invsqrtpi * cc) / __ieee754_sqrtl (y);
+ z = (invsqrtpi * cc) / sqrtl (y);
else
{
u = pone (y);
v = qone (y);
- z = invsqrtpi * (u * cc - v * ss) / __ieee754_sqrtl (y);
+ z = invsqrtpi * (u * cc - v * ss) / sqrtl (y);
}
if (se & 0x8000)
return -z;
@@ -195,7 +196,7 @@ __ieee754_y1l (long double x)
{
long double z, s, c, ss, cc, u, v;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -231,12 +232,12 @@ __ieee754_y1l (long double x)
* to compute the worse one.
*/
if (__glibc_unlikely (ix > 0x4080))
- z = (invsqrtpi * ss) / __ieee754_sqrtl (x);
+ z = (invsqrtpi * ss) / sqrtl (x);
else
{
u = pone (x);
v = qone (x);
- z = invsqrtpi * (u * ss + v * cc) / __ieee754_sqrtl (x);
+ z = invsqrtpi * (u * ss + v * cc) / sqrtl (x);
}
return z;
}
@@ -362,7 +363,7 @@ pone (long double x)
const long double *p, *q;
long double z, r, s;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -507,9 +508,9 @@ static long double
qone (long double x)
{
const long double *p, *q;
- static long double s, r, z;
+ long double s, r, z;
int32_t ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
diff --git a/sysdeps/ieee754/ldbl-96/e_jnl.c b/sysdeps/ieee754/ldbl-96/e_jnl.c
index 92f96921a7..394921f564 100644
--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
+++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
@@ -60,6 +60,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double
invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
@@ -69,7 +70,7 @@ static const long double zero = 0.0L;
long double
__ieee754_jnl (int n, long double x)
{
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
int32_t i, ix, sgn;
long double a, b, temp, di, ret;
long double z, w;
@@ -142,7 +143,7 @@ __ieee754_jnl (int n, long double x)
temp = c - s;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
@@ -302,7 +303,7 @@ strong_alias (__ieee754_jnl, __jnl_finite)
long double
__ieee754_ynl (int n, long double x)
{
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
int32_t i, ix;
int32_t sign;
long double a, b, temp, ret;
@@ -371,7 +372,7 @@ __ieee754_ynl (int n, long double x)
temp = s + c;
break;
}
- b = invsqrtpi * temp / __ieee754_sqrtl (x);
+ b = invsqrtpi * temp / sqrtl (x);
}
else
{
diff --git a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
index 9862fe8d5c..200421f5cc 100644
--- a/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_lgammal_r.c
@@ -91,9 +91,9 @@
*
*/
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <libc-diag.h>
static const long double
half = 0.5L,
@@ -208,7 +208,7 @@ sin_pi (long double x)
{
long double y, z;
int n, ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -275,7 +275,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
{
long double t, y, z, nadj, p, p1, p2, q, r, w;
int i, ix;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
*signgamp = 1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
diff --git a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
index 0d8e64675c..f67805f2d3 100644
--- a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
+++ b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point argument reduction.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision code by Jakub Jelinek <jj@ultra.linux.cz>
@@ -186,7 +186,7 @@ __ieee754_rem_pio2l (long double x, long double *y)
{
double tx[3], ty[3];
int32_t se, j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
int sx;
int n, exp;
diff --git a/sysdeps/ieee754/ldbl-96/e_sinhl.c b/sysdeps/ieee754/ldbl-96/e_sinhl.c
index 095b142621..a4b39783bc 100644
--- a/sysdeps/ieee754/ldbl-96/e_sinhl.c
+++ b/sysdeps/ieee754/ldbl-96/e_sinhl.c
@@ -39,6 +39,7 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
static const long double one = 1.0, shuge = 1.0e4931L;
@@ -46,7 +47,7 @@ long double
__ieee754_sinhl(long double x)
{
long double t,w,h;
- u_int32_t jx,ix,i0,i1;
+ uint32_t jx,ix,i0,i1;
/* Words of |x|. */
GET_LDOUBLE_WORDS(jx,i0,i1,x);
diff --git a/sysdeps/ieee754/ldbl-96/gamma_product.c b/sysdeps/ieee754/ldbl-96/gamma_product.c
index 419d11598f..f1b65e12e2 100644
--- a/sysdeps/ieee754/ldbl-96/gamma_product.c
+++ b/sysdeps/ieee754/ldbl-96/gamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math-narrow-eval.h>
#include <math_private.h>
#include <float.h>
diff --git a/sysdeps/ieee754/ldbl-96/gamma_productl.c b/sysdeps/ieee754/ldbl-96/gamma_productl.c
index 849b57d95d..ed0c166d78 100644
--- a/sysdeps/ieee754/ldbl-96/gamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/gamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of X, X+1, ..., with an error estimate.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of X + X_EPS, X + X_EPS + 1, ..., X + X_EPS + N
- 1, in the form R * (1 + *EPS) where the return value R is an
@@ -68,7 +38,7 @@ __gamma_productl (long double x, long double x_eps, int n, long double *eps)
{
*eps += x_eps / (x + i);
long double lo;
- mul_split (&ret, &lo, ret, x + i);
+ mul_splitl (&ret, &lo, ret, x + i);
*eps += lo / ret;
}
return ret;
diff --git a/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h b/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h
new file mode 100644
index 0000000000..bee080bd29
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h
@@ -0,0 +1,5 @@
+#include_next <bits/iscanonical.h>
+
+#ifndef _ISOMAC
+libm_hidden_proto (__iscanonicall)
+#endif
diff --git a/sysdeps/ieee754/ldbl-96/k_cosl.c b/sysdeps/ieee754/ldbl-96/k_cosl.c
index 08b11b3733..da20385210 100644
--- a/sysdeps/ieee754/ldbl-96/k_cosl.c
+++ b/sysdeps/ieee754/ldbl-96/k_cosl.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point cosine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision cosine by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/ieee754/ldbl-96/k_sinl.c b/sysdeps/ieee754/ldbl-96/k_sinl.c
index 6ba7ceddc0..2549f71d19 100644
--- a/sysdeps/ieee754/ldbl-96/k_sinl.c
+++ b/sysdeps/ieee754/ldbl-96/k_sinl.c
@@ -1,5 +1,5 @@
/* Quad-precision floating point sine on <-pi/4,pi/4>.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision sine by Jakub Jelinek <jj@ultra.linux.cz>
@@ -23,6 +23,7 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
/* The polynomials have not been optimized for extended-precision and
may contain more terms than needed. */
diff --git a/sysdeps/ieee754/ldbl-96/k_tanl.c b/sysdeps/ieee754/ldbl-96/k_tanl.c
index 0c050c112f..9b5151baa2 100644
--- a/sysdeps/ieee754/ldbl-96/k_tanl.c
+++ b/sysdeps/ieee754/ldbl-96/k_tanl.c
@@ -57,9 +57,11 @@
*/
#include <float.h>
-#include <libc-internal.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libc-diag.h>
+
static const long double
one = 1.0L,
pio4hi = 0xc.90fdaa22168c235p-4L,
diff --git a/sysdeps/ieee754/ldbl-96/ldbl2mpn.c b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
index fe7002f640..0805051723 100644
--- a/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
+++ b/sysdeps/ieee754/ldbl-96/ldbl2mpn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_negl.c b/sysdeps/ieee754/ldbl-96/lgamma_negl.c
index 99ecf7e85f..6d2e0b7165 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_negl.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_negl.c
@@ -1,5 +1,5 @@
/* lgammal expanding around zeros.
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_product.c b/sysdeps/ieee754/ldbl-96/lgamma_product.c
index e3ba72d8e4..1eb99c40a5 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_product.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_product.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/lgamma_productl.c b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
index de67cbe665..9141a3177a 100644
--- a/sysdeps/ieee754/ldbl-96/lgamma_productl.c
+++ b/sysdeps/ieee754/ldbl-96/lgamma_productl.c
@@ -1,5 +1,5 @@
/* Compute a product of 1 + (T/X), 1 + (T/(X+1)), ....
- Copyright (C) 2015-2016 Free Software Foundation, Inc.
+ Copyright (C) 2015-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,37 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
-
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
+#include <mul_splitl.h>
/* Compute the product of 1 + (T / (X + X_EPS)), 1 + (T / (X + X_EPS +
1)), ..., 1 + (T / (X + X_EPS + N - 1)), minus 1. X is such that
@@ -65,11 +35,11 @@ __lgamma_productl (long double t, long double x, long double x_eps, int n)
long double xi = x + i;
long double quot = t / xi;
long double mhi, mlo;
- mul_split (&mhi, &mlo, quot, xi);
+ mul_splitl (&mhi, &mlo, quot, xi);
long double quot_lo = (t - mhi - mlo) / xi - t * x_eps / (xi * xi);
/* We want (1 + RET + RET_EPS) * (1 + QUOT + QUOT_LO) - 1. */
long double rhi, rlo;
- mul_split (&rhi, &rlo, ret, quot);
+ mul_splitl (&rhi, &rlo, ret, quot);
long double rpq = ret + quot;
long double rpq_eps = (ret - rpq) + quot;
long double nret = rpq + rhi;
diff --git a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h b/sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h
index 2694b5ee34..ab2542c097 100644
--- a/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h
+++ b/sysdeps/ieee754/ldbl-96/math-nan-payload-ldouble.h
@@ -1,5 +1,5 @@
-/* Convert string for NaN payload to corresponding NaN. For ldbl-96.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* NaN payload handling for ldbl-96.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,8 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FLOAT long double
-#define SET_MANTISSA(flt, mant) \
+#define SET_NAN_PAYLOAD(flt, mant) \
do \
{ \
union ieee854_long_double u; \
diff --git a/sysdeps/ieee754/ldbl-96/math_ldbl.h b/sysdeps/ieee754/ldbl-96/math_ldbl.h
index cca30657ce..99428f6eeb 100644
--- a/sysdeps/ieee754/ldbl-96/math_ldbl.h
+++ b/sysdeps/ieee754/ldbl-96/math_ldbl.h
@@ -1,11 +1,31 @@
-#ifndef _MATH_PRIVATE_H_
-#error "Never use <math_ldbl.h> directly; include <math_private.h> instead."
-#endif
+/* Manipulation of the bit representation of 'long double' quantities.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_LDBL_H_
+#define _MATH_LDBL_H_ 1
+
+#include <stdint.h>
+#include <endian.h>
/* A union which permits us to convert between a long double and
three 32 bit ints. */
-#if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
typedef union
{
@@ -14,22 +34,22 @@ typedef union
{
int sign_exponent:16;
unsigned int empty:16;
- u_int32_t msw;
- u_int32_t lsw;
+ uint32_t msw;
+ uint32_t lsw;
} parts;
} ieee_long_double_shape_type;
#endif
-#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
+#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
typedef union
{
long double value;
struct
{
- u_int32_t lsw;
- u_int32_t msw;
+ uint32_t lsw;
+ uint32_t msw;
int sign_exponent:16;
unsigned int empty:16;
} parts;
@@ -96,3 +116,5 @@ do { \
se_u.parts.sign_exponent = (exp); \
(d) = se_u.value; \
} while (0)
+
+#endif /* math_ldbl.h */
diff --git a/sysdeps/ieee754/ldbl-96/mpn2ldbl.c b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
index 6159d7dabf..8cbf28256b 100644
--- a/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-96/mpn2ldbl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/printf_fphex.c b/sysdeps/ieee754/ldbl-96/printf_fphex.c
index 65bf538590..45d97447a7 100644
--- a/sysdeps/ieee754/ldbl-96/printf_fphex.c
+++ b/sysdeps/ieee754/ldbl-96/printf_fphex.c
@@ -1,5 +1,5 @@
/* Print floating point number in hexadecimal notation according to ISO C99.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/s_asinhl.c b/sysdeps/ieee754/ldbl-96/s_asinhl.c
index da49ea5988..2b9ae1f677 100644
--- a/sysdeps/ieee754/ldbl-96/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-96/s_asinhl.c
@@ -32,6 +32,8 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double
one = 1.000000000000000000000e+00L, /* 0x3FFF, 0x00000000, 0x00000000 */
@@ -54,12 +56,12 @@ long double __asinhl(long double x)
} else {
long double xa = fabsl(x);
if (ix>0x4000) { /* 2**34 > |x| > 2.0 */
- w = __ieee754_logl(2.0*xa+one/(__ieee754_sqrtl(xa*xa+one)+xa));
+ w = __ieee754_logl(2.0*xa+one/(sqrtl(xa*xa+one)+xa));
} else { /* 2.0 > |x| > 2**-28 */
t = xa*xa;
- w =__log1pl(xa+t/(one+__ieee754_sqrtl(one+t)));
+ w =__log1pl(xa+t/(one+sqrtl(one+t)));
}
}
return __copysignl(w, x);
}
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/ieee754/ldbl-96/s_cbrtl.c b/sysdeps/ieee754/ldbl-96/s_cbrtl.c
index 42849ab517..67cf86dd7a 100644
--- a/sysdeps/ieee754/ldbl-96/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-96/s_cbrtl.c
@@ -1,5 +1,5 @@
/* Compute cubic root of double value.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Dirk Alboth <dirka@uni-paderborn.de> and
Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#define CBRT2 1.2599210498948731648 /* 2^(1/3) */
@@ -67,4 +68,4 @@ __cbrtl (long double x)
u -= (u - (x / (u * u))) * third;
return u;
}
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/ldbl-96/s_copysignl.c b/sysdeps/ieee754/ldbl-96/s_copysignl.c
index b1c442452f..3c16d54783 100644
--- a/sysdeps/ieee754/ldbl-96/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-96/s_copysignl.c
@@ -26,13 +26,14 @@ static char rcsid[] = "$NetBSD: $";
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __copysignl(long double x, long double y)
{
- u_int32_t es1,es2;
+ uint32_t es1,es2;
GET_LDOUBLE_EXP(es1,x);
GET_LDOUBLE_EXP(es2,y);
SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
return x;
}
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ieee754/ldbl-96/s_cosl.c b/sysdeps/ieee754/ldbl-96/s_cosl.c
index 8b0b7d3cc2..324e5b9663 100644
--- a/sysdeps/ieee754/ldbl-96/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-96/s_cosl.c
@@ -52,6 +52,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __cosl(long double x)
{
@@ -85,4 +86,4 @@ long double __cosl(long double x)
}
}
}
-weak_alias (__cosl, cosl)
+libm_alias_ldouble (__cos, cos)
diff --git a/sysdeps/ieee754/ldbl-96/s_daddl.c b/sysdeps/ieee754/ldbl-96/s_daddl.c
new file mode 100644
index 0000000000..d1e3c17bc7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_daddl.c
@@ -0,0 +1,33 @@
+/* Add long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xaddf64x __hide_f32xaddf64x
+#define f64addf64x __hide_f64addf64x
+#include <math.h>
+#undef f32xaddf64x
+#undef f64addf64x
+
+#include <math-narrow.h>
+
+double
+__daddl (long double x, long double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-96/s_ddivl.c b/sysdeps/ieee754/ldbl-96/s_ddivl.c
new file mode 100644
index 0000000000..9c266d1ff3
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ddivl.c
@@ -0,0 +1,33 @@
+/* Divide long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xdivf64x __hide_f32xdivf64x
+#define f64divf64x __hide_f64divf64x
+#include <math.h>
+#undef f32xdivf64x
+#undef f64divf64x
+
+#include <math-narrow.h>
+
+double
+__ddivl (long double x, long double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-96/s_dmull.c b/sysdeps/ieee754/ldbl-96/s_dmull.c
new file mode 100644
index 0000000000..a717b0aa07
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_dmull.c
@@ -0,0 +1,33 @@
+/* Multiply long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xmulf64x __hide_f32xmulf64x
+#define f64mulf64x __hide_f64mulf64x
+#include <math.h>
+#undef f32xmulf64x
+#undef f64mulf64x
+
+#include <math-narrow.h>
+
+double
+__dmull (long double x, long double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-96/s_dsubl.c b/sysdeps/ieee754/ldbl-96/s_dsubl.c
new file mode 100644
index 0000000000..5a855790f6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_dsubl.c
@@ -0,0 +1,33 @@
+/* Subtract long double (ldbl-96) values, narrowing the result to double.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xsubf64x __hide_f32xsubf64x
+#define f64subf64x __hide_f64subf64x
+#include <math.h>
+#undef f32xsubf64x
+#undef f64subf64x
+
+#include <math-narrow.h>
+
+double
+__dsubl (long double x, long double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, double, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-96/s_erfl.c b/sysdeps/ieee754/ldbl-96/s_erfl.c
index d00adb1000..1e42df70a7 100644
--- a/sysdeps/ieee754/ldbl-96/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_erfl.c
@@ -108,6 +108,8 @@
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double
tiny = 1e-4931L,
@@ -254,7 +256,7 @@ __erfl (long double x)
{
long double R, S, P, Q, s, y, z, r;
int32_t ix, i;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -335,13 +337,13 @@ __erfl (long double x)
return r / x - one;
}
-weak_alias (__erfl, erfl)
+libm_alias_ldouble (__erf, erf)
long double
__erfcl (long double x)
{
int32_t hx, ix;
long double R, S, P, Q, s, y, z, r;
- u_int32_t se, i0, i1;
+ uint32_t se, i0, i1;
GET_LDOUBLE_WORDS (se, i0, i1, x);
ix = se & 0x7fff;
@@ -448,4 +450,4 @@ __erfcl (long double x)
}
}
-weak_alias (__erfcl, erfcl)
+libm_alias_ldouble (__erfc, erfc)
diff --git a/sysdeps/ieee754/ldbl-96/s_faddl.c b/sysdeps/ieee754/ldbl-96/s_faddl.c
new file mode 100644
index 0000000000..4164774cd4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_faddl.c
@@ -0,0 +1,31 @@
+/* Add long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32addf64x __hide_f32addf64x
+#include <math.h>
+#undef f32addf64x
+
+#include <math-narrow.h>
+
+float
+__faddl (long double x, long double y)
+{
+ NARROW_ADD_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/ldbl-96/s_fdivl.c b/sysdeps/ieee754/ldbl-96/s_fdivl.c
new file mode 100644
index 0000000000..ccb87ccd15
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fdivl.c
@@ -0,0 +1,31 @@
+/* Divide long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32divf64x __hide_f32divf64x
+#include <math.h>
+#undef f32divf64x
+
+#include <math-narrow.h>
+
+float
+__fdivl (long double x, long double y)
+{
+ NARROW_DIV_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/ldbl-96/s_fma.c b/sysdeps/ieee754/ldbl-96/s_fma.c
index ab45bcfce2..986879cda5 100644
--- a/sysdeps/ieee754/ldbl-96/s_fma.c
+++ b/sysdeps/ieee754/ldbl-96/s_fma.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-double.h>
/* This implementation uses rounding to odd to avoid problems with
double rounding. See a paper by Boldo and Melquiond:
@@ -30,14 +32,12 @@
double
__fma (double x, double y, double z)
{
- if (__glibc_unlikely (isinf (z)))
- {
- /* If z is Inf, but x and y are finite, the result should be
- z rather than NaN. */
- if (isfinite (x) && isfinite (y))
- return (z + x) + y;
- return (x * y) + z;
- }
+ if (__glibc_unlikely (!isfinite (x) || !isfinite (y)))
+ return x * y + z;
+ else if (__glibc_unlikely (!isfinite (z)))
+ /* If z is Inf, but x and y are finite, the result should be z
+ rather than NaN. */
+ return (z + x) + y;
/* Ensure correct sign of exact 0 + 0. */
if (__glibc_unlikely ((x == 0 || y == 0) && z == 0))
@@ -97,5 +97,5 @@ __fma (double x, double y, double z)
return u.d;
}
#ifndef __fma
-weak_alias (__fma, fma)
+libm_alias_double (__fma, fma)
#endif
diff --git a/sysdeps/ieee754/ldbl-96/s_fmal.c b/sysdeps/ieee754/ldbl-96/s_fmal.c
index f1467fda3d..0b261fd17a 100644
--- a/sysdeps/ieee754/ldbl-96/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-96/s_fmal.c
@@ -1,5 +1,5 @@
/* Compute x * y + z as ternary operation.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ Copyright (C) 2010-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2010.
@@ -21,7 +21,9 @@
#include <math.h>
#include <fenv.h>
#include <ieee754.h>
+#include <math-barriers.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
#include <tininess.h>
/* This implementation uses rounding to odd to avoid problems with
@@ -293,4 +295,4 @@ __fmal (long double x, long double y, long double z)
return v.d * 0x1p-130L;
}
}
-weak_alias (__fmal, fmal)
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/ldbl-96/s_fmull.c b/sysdeps/ieee754/ldbl-96/s_fmull.c
new file mode 100644
index 0000000000..b7582526a6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fmull.c
@@ -0,0 +1,31 @@
+/* Multiply long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32mulf64x __hide_f32mulf64x
+#include <math.h>
+#undef f32mulf64x
+
+#include <math-narrow.h>
+
+float
+__fmull (long double x, long double y)
+{
+ NARROW_MUL_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/ldbl-96/s_frexpl.c b/sysdeps/ieee754/ldbl-96/s_frexpl.c
index ab217a659b..7c31ed9936 100644
--- a/sysdeps/ieee754/ldbl-96/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-96/s_frexpl.c
@@ -31,6 +31,7 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double
#if LDBL_MANT_DIG == 64
@@ -42,11 +43,11 @@ two65 = 3.68934881474191032320e+19L; /* 0x4040, 0x80000000, 0x00000000 */
long double __frexpl(long double x, int *eptr)
{
- u_int32_t se, hx, ix, lx;
+ uint32_t se, hx, ix, lx;
GET_LDOUBLE_WORDS(se,hx,lx,x);
ix = 0x7fff&se;
*eptr = 0;
- if(ix==0x7fff||((ix|hx|lx)==0)) return x; /* 0,inf,nan */
+ if(ix==0x7fff||((ix|hx|lx)==0)) return x + x; /* 0,inf,nan */
if (ix==0x0000) { /* subnormal */
x *= two65;
GET_LDOUBLE_EXP(se,x);
@@ -58,4 +59,4 @@ long double __frexpl(long double x, int *eptr)
SET_LDOUBLE_EXP(x,se);
return x;
}
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpl.c b/sysdeps/ieee754/ldbl-96/s_fromfpl.c
new file mode 100644
index 0000000000..bcedceea8e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC __fromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c
new file mode 100644
index 0000000000..6f24ccf488
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpl_main.c
@@ -0,0 +1,85 @@
+/* Round to integer type. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fenv.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 64
+
+#if UNSIGNED
+# define RET_TYPE uintmax_t
+#else
+# define RET_TYPE intmax_t
+#endif
+
+#include <fromfp.h>
+
+RET_TYPE
+FUNC (long double x, int round, unsigned int width)
+{
+ if (width > INTMAX_WIDTH)
+ width = INTMAX_WIDTH;
+ uint16_t se;
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, x);
+ bool negative = (se & 0x8000) != 0;
+ if (width == 0)
+ return fromfp_domain_error (negative, width);
+ if ((hx | lx) == 0)
+ return 0;
+ int exponent = se & 0x7fff;
+ exponent -= BIAS;
+ int max_exponent = fromfp_max_exponent (negative, width);
+ if (exponent > max_exponent)
+ return fromfp_domain_error (negative, width);
+
+ uint64_t ix = (((uint64_t) hx) << 32) | lx;
+ uintmax_t uret;
+ bool half_bit, more_bits;
+ if (exponent >= MANT_DIG - 1)
+ {
+ uret = ix;
+ /* Exponent 63; no shifting required. */
+ half_bit = false;
+ more_bits = false;
+ }
+ else if (exponent >= -1)
+ {
+ uint64_t h = 1ULL << (MANT_DIG - 2 - exponent);
+ half_bit = (ix & h) != 0;
+ more_bits = (ix & (h - 1)) != 0;
+ if (exponent == -1)
+ uret = 0;
+ else
+ uret = ix >> (MANT_DIG - 1 - exponent);
+ }
+ else
+ {
+ uret = 0;
+ half_bit = false;
+ more_bits = true;
+ }
+ return fromfp_round_and_return (negative, uret, half_bit, more_bits, round,
+ exponent, max_exponent, width);
+}
diff --git a/sysdeps/ieee754/ldbl-96/s_fromfpxl.c b/sysdeps/ieee754/ldbl-96/s_fromfpxl.c
new file mode 100644
index 0000000000..0a342a22d1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC __fromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/ldbl-96/s_fsubl.c b/sysdeps/ieee754/ldbl-96/s_fsubl.c
new file mode 100644
index 0000000000..54aaf68b74
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_fsubl.c
@@ -0,0 +1,31 @@
+/* Subtract long double (ldbl-96) values, narrowing the result to float.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32subf64x __hide_f32subf64x
+#include <math.h>
+#undef f32subf64x
+
+#include <math-narrow.h>
+
+float
+__fsubl (long double x, long double y)
+{
+ NARROW_SUB_ROUND_TO_ODD (x, y, float, union ieee854_long_double, l,
+ mantissa1);
+}
+libm_alias_float_ldouble (sub)
diff --git a/sysdeps/ieee754/ldbl-96/w_expl.c b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
index 5c7a1812bc..4b7b734f3d 100644
--- a/sysdeps/ieee754/ldbl-96/w_expl.c
+++ b/sysdeps/ieee754/ldbl-96/s_getpayloadl.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Get NaN payload. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,17 +18,17 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdint.h>
-/* wrapper expl */
long double
-__expl (long double x)
+__getpayloadl (const long double *x)
{
- long double z = __ieee754_expl (x);
- if (__builtin_expect (!isfinite (z) || z == 0, 0)
- && isfinite (x) && _LIB_VERSION != _IEEE_)
- return __kernel_standard_l (x, x, 206 + !!signbit (x));
-
- return z;
+ uint16_t se __attribute__ ((unused));
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, *x);
+ hx &= 0x3fffffff;
+ uint64_t ix = ((uint64_t) hx << 32) | lx;
+ return (long double) ix;
}
-hidden_def (__expl)
-weak_alias (__expl, expl)
+libm_alias_ldouble (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/ldbl-96/s_iscanonicall.c b/sysdeps/ieee754/ldbl-96/s_iscanonicall.c
new file mode 100644
index 0000000000..413c6bd42c
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_iscanonicall.c
@@ -0,0 +1,44 @@
+/* Test whether long double value is canonical. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+int
+__iscanonicall (long double x)
+{
+ uint32_t se, i0, i1 __attribute__ ((unused));
+
+ GET_LDOUBLE_WORDS (se, i0, i1, x);
+ int32_t ix = se & 0x7fff;
+ bool mant_high = (i0 & 0x80000000) != 0;
+
+ if (LDBL_MIN_EXP == -16381)
+ /* Intel variant: the high mantissa bit should have a value
+ determined by the exponent. */
+ return ix > 0 ? mant_high : !mant_high;
+ else
+ /* M68K variant: both values of the high bit are valid for the
+ greatest and smallest exponents, while other exponents require
+ the high bit to be set. */
+ return ix == 0 || ix == 0x7fff || mant_high;
+}
+libm_hidden_def (__iscanonicall)
diff --git a/sysdeps/ieee754/ldbl-96/s_issignalingl.c b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
index 73646cac0c..b1dd41ecfd 100644
--- a/sysdeps/ieee754/ldbl-96/s_issignalingl.c
+++ b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
@@ -1,5 +1,5 @@
/* Test for signaling NaN.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,13 +18,14 @@
#include <math.h>
#include <math_private.h>
+#include <nan-high-order-bit.h>
int
__issignalingl (long double x)
{
- u_int32_t exi, hxi, lxi;
+ uint32_t exi, hxi, lxi;
GET_LDOUBLE_WORDS (exi, hxi, lxi, x);
-#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
# error not implemented
#else
/* To keep the following comparison simple, toggle the quiet/signaling bit,
diff --git a/sysdeps/ieee754/ldbl-96/s_llrintl.c b/sysdeps/ieee754/ldbl-96/s_llrintl.c
index 592d51c607..d45a69a1f7 100644
--- a/sysdeps/ieee754/ldbl-96/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double two63[2] =
{
@@ -35,7 +36,7 @@ long long int
__llrintl (long double x)
{
int32_t se,j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
long long int result;
long double w;
long double t;
@@ -88,4 +89,4 @@ __llrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/ieee754/ldbl-96/s_llroundl.c b/sysdeps/ieee754/ldbl-96/s_llroundl.c
index 483199d442..601fd0e644 100644
--- a/sysdeps/ieee754/ldbl-96/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,13 +22,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long long int
__llroundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
long long int result;
int sign;
@@ -42,7 +43,7 @@ __llroundl (long double x)
return j0 < -1 ? 0 : sign;
else
{
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
{
j >>= 1;
@@ -59,7 +60,7 @@ __llroundl (long double x)
result = (((long long int) i0 << 32) | i1) << (j0 - 63);
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 31));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 31));
result = (long long int) i0;
if (j < i1)
@@ -86,4 +87,4 @@ __llroundl (long double x)
return sign * result;
}
-weak_alias (__llroundl, llroundl)
+libm_alias_ldouble (__llround, llround)
diff --git a/sysdeps/ieee754/ldbl-96/s_lrintl.c b/sysdeps/ieee754/ldbl-96/s_lrintl.c
index bd902deb47..df3222c7f2 100644
--- a/sysdeps/ieee754/ldbl-96/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_lrintl.c
@@ -1,6 +1,6 @@
/* Round argument to nearest integral value according to current rounding
direction.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,6 +23,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double two63[2] =
{
@@ -35,7 +36,7 @@ long int
__lrintl (long double x)
{
int32_t se,j0;
- u_int32_t i0, i1;
+ uint32_t i0, i1;
long int result;
long double w;
long double t;
@@ -123,4 +124,4 @@ __lrintl (long double x)
return sx ? -result : result;
}
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/ieee754/ldbl-96/s_lroundl.c b/sysdeps/ieee754/ldbl-96/s_lroundl.c
index 3b43d77e72..0cc9f9c5d6 100644
--- a/sysdeps/ieee754/ldbl-96/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_lroundl.c
@@ -1,5 +1,5 @@
/* Round long double value to long int.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,13 +22,14 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long int
__lroundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
long int result;
int sign;
@@ -42,7 +43,7 @@ __lroundl (long double x)
return j0 < -1 ? 0 : sign;
else
{
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
{
j >>= 1;
@@ -66,7 +67,7 @@ __lroundl (long double x)
result = ((long int) i0 << (j0 - 31)) | (i1 << (j0 - 63));
else
{
- u_int32_t j = i1 + (0x80000000 >> (j0 - 31));
+ uint32_t j = i1 + (0x80000000 >> (j0 - 31));
unsigned long int ures = i0;
if (j < i1)
@@ -108,4 +109,4 @@ __lroundl (long double x)
return sign * result;
}
-weak_alias (__lroundl, lroundl)
+libm_alias_ldouble (__lround, lround)
diff --git a/sysdeps/ieee754/ldbl-96/s_modfl.c b/sysdeps/ieee754/ldbl-96/s_modfl.c
index e9401d0f5d..380b6f0389 100644
--- a/sysdeps/ieee754/ldbl-96/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-96/s_modfl.c
@@ -26,6 +26,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double one = 1.0;
@@ -33,7 +34,7 @@ long double
__modfl(long double x, long double *iptr)
{
int32_t i0,i1,j0;
- u_int32_t i,se;
+ uint32_t i,se;
GET_LDOUBLE_WORDS(se,i0,i1,x);
j0 = (se&0x7fff)-0x3fff; /* exponent of x */
if(j0<32) { /* integer part in high x */
@@ -59,7 +60,7 @@ __modfl(long double x, long double *iptr)
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
return x;
} else { /* fraction part in low x */
- i = ((u_int32_t)(0x7fffffff))>>(j0-32);
+ i = ((uint32_t)(0x7fffffff))>>(j0-32);
if((i1&i)==0) { /* x is integral */
*iptr = x;
SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
@@ -70,4 +71,4 @@ __modfl(long double x, long double *iptr)
}
}
}
-weak_alias (__modfl, modfl)
+libm_alias_ldouble (__modf, modf)
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttoward.c b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
index 3d0382eac9..1d8d9c7f91 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttoward.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttoward.c
@@ -27,13 +27,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
double __nexttoward(double x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t lx,hy,ly,esy;
+ uint32_t lx,hy,ly,esy;
EXTRACT_WORDS(hx,lx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
index ae7538942f..9a08e1c8ff 100644
--- a/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
+++ b/sysdeps/ieee754/ldbl-96/s_nexttowardf.c
@@ -19,13 +19,14 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <float.h>
float __nexttowardf(float x, long double y)
{
int32_t hx,ix,iy;
- u_int32_t hy,ly,esy;
+ uint32_t hy,ly,esy;
GET_FLOAT_WORD(hx,x);
GET_LDOUBLE_WORDS(esy,hy,ly,y);
diff --git a/sysdeps/ieee754/ldbl-96/s_nextupl.c b/sysdeps/ieee754/ldbl-96/s_nextupl.c
new file mode 100644
index 0000000000..5dff32ce73
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_nextupl.c
@@ -0,0 +1,86 @@
+/* Return the least floating-point number greater than X.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+
+/* Return the least floating-point number greater than X. */
+long double
+__nextupl (long double x)
+{
+ uint32_t hx, ix;
+ uint32_t lx;
+ int32_t esx;
+
+ GET_LDOUBLE_WORDS (esx, hx, lx, x);
+ ix = esx & 0x7fff;
+
+ if (((ix == 0x7fff) && (((hx & 0x7fffffff) | lx) != 0))) /* x is nan. */
+ return x + x;
+ if ((ix | hx | lx) == 0)
+ return LDBL_TRUE_MIN;
+ if (esx >= 0)
+ { /* x > 0. */
+ if (isinf (x))
+ return x;
+ lx += 1;
+ if (lx == 0)
+ {
+ hx += 1;
+#if LDBL_MIN_EXP == -16381
+ if (hx == 0 || (esx == 0 && hx == 0x80000000))
+#else
+ if (hx == 0)
+#endif
+ {
+ esx += 1;
+ hx |= 0x80000000;
+ }
+ }
+ }
+ else
+ { /* x < 0. */
+ if (lx == 0)
+ {
+#if LDBL_MIN_EXP == -16381
+ if (hx <= 0x80000000 && esx != 0xffff8000)
+ {
+ esx -= 1;
+ hx = hx - 1;
+ if ((esx & 0x7fff) > 0)
+ hx |= 0x80000000;
+ }
+ else
+ hx -= 1;
+#else
+ if (ix != 0 && hx == 0x80000000)
+ hx = 0;
+ if (hx == 0)
+ esx -= 1;
+ hx -= 1;
+#endif
+ }
+ lx -= 1;
+ }
+ SET_LDOUBLE_WORDS (x, esx, hx, lx);
+ return x;
+}
+
+libm_alias_ldouble (__nextup, nextup)
diff --git a/sysdeps/ieee754/ldbl-96/s_remquol.c b/sysdeps/ieee754/ldbl-96/s_remquol.c
index 89b2630d46..88c5ea2084 100644
--- a/sysdeps/ieee754/ldbl-96/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-96/s_remquol.c
@@ -1,5 +1,5 @@
/* Compute remainder and a congruent to the quotient.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,6 +20,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
static const long double zero = 0.0;
@@ -29,7 +30,7 @@ long double
__remquol (long double x, long double p, int *quo)
{
int32_t ex,ep,hx,hp;
- u_int32_t sx,lx,lp;
+ uint32_t sx,lx,lp;
int cquo,qs;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
@@ -108,4 +109,4 @@ __remquol (long double x, long double p, int *quo)
x = -x;
return x;
}
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/ieee754/ldbl-96/s_roundevenl.c b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
new file mode 100644
index 0000000000..be2e4fa49e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
@@ -0,0 +1,126 @@
+/* Round to nearest integer value, rounding halfway cases to even.
+ ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <stdint.h>
+
+#define BIAS 0x3fff
+#define MANT_DIG 64
+#define MAX_EXP (2 * BIAS + 1)
+
+long double
+__roundevenl (long double x)
+{
+ uint16_t se;
+ uint32_t hx, lx;
+ GET_LDOUBLE_WORDS (se, hx, lx, x);
+ int exponent = se & 0x7fff;
+ if (exponent >= BIAS + MANT_DIG - 1)
+ {
+ /* Integer, infinity or NaN. */
+ if (exponent == MAX_EXP)
+ /* Infinity or NaN; quiet signaling NaNs. */
+ return x + x;
+ else
+ return x;
+ }
+ else if (exponent >= BIAS + MANT_DIG - 32)
+ {
+ /* Not necessarily an integer; integer bit is in low word.
+ Locate the bits with exponents 0 and -1. */
+ int int_pos = (BIAS + MANT_DIG - 1) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if ((lx & (int_bit | (half_bit - 1))) != 0)
+ {
+ /* No need to test whether HALF_BIT is set. */
+ lx += half_bit;
+ if (lx < half_bit)
+ {
+ hx++;
+ if (hx == 0)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ }
+ lx &= ~(int_bit - 1);
+ }
+ else if (exponent == BIAS + MANT_DIG - 33)
+ {
+ /* Not necessarily an integer; integer bit is bottom of high
+ word, half bit is top of low word. */
+ if (((hx & 1) | (lx & 0x7fffffff)) != 0)
+ {
+ lx += 0x80000000;
+ if (lx < 0x80000000)
+ {
+ hx++;
+ if (hx == 0)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ }
+ lx = 0;
+ }
+ else if (exponent >= BIAS)
+ {
+ /* At least 1; not necessarily an integer, integer bit and half
+ bit are in the high word. Locate the bits with exponents 0
+ and -1. */
+ int int_pos = (BIAS + MANT_DIG - 33) - exponent;
+ int half_pos = int_pos - 1;
+ uint32_t half_bit = 1U << half_pos;
+ uint32_t int_bit = 1U << int_pos;
+ if (((hx & (int_bit | (half_bit - 1))) | lx) != 0)
+ {
+ hx += half_bit;
+ if (hx < half_bit)
+ {
+ hx = 0x80000000;
+ se++;
+ }
+ }
+ hx &= ~(int_bit - 1);
+ lx = 0;
+ }
+ else if (exponent == BIAS - 1 && (hx > 0x80000000 || lx != 0))
+ {
+ /* Interval (0.5, 1). */
+ se = (se & 0x8000) | 0x3fff;
+ hx = 0x80000000;
+ lx = 0;
+ }
+ else
+ {
+ /* Rounds to 0. */
+ se &= 0x8000;
+ hx = 0;
+ lx = 0;
+ }
+ SET_LDOUBLE_WORDS (x, se, hx, lx);
+ return x;
+}
+libm_alias_ldouble (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/ldbl-96/s_roundl.c b/sysdeps/ieee754/ldbl-96/s_roundl.c
index 4f35c4847b..c5c304cb2e 100644
--- a/sysdeps/ieee754/ldbl-96/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-96/s_roundl.c
@@ -1,5 +1,5 @@
/* Round long double to integer away from zero.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,16 +20,14 @@
#include <math.h>
#include <math_private.h>
-
-
-static const long double huge = 1.0e4930L;
+#include <libm-alias-ldouble.h>
long double
__roundl (long double x)
{
int32_t j0;
- u_int32_t se, i1, i0;
+ uint32_t se, i1, i0;
GET_LDOUBLE_WORDS (se, i0, i1, x);
j0 = (se & 0x7fff) - 0x3fff;
@@ -37,7 +35,6 @@ __roundl (long double x)
{
if (j0 < 0)
{
- math_force_eval (huge + x);
se &= 0x8000;
i0 = i1 = 0;
if (j0 == -1)
@@ -48,14 +45,12 @@ __roundl (long double x)
}
else
{
- u_int32_t i = 0x7fffffff >> j0;
+ uint32_t i = 0x7fffffff >> j0;
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- /* Raise inexact if x != 0. */
- math_force_eval (huge + x);
- u_int32_t j = i0 + (0x40000000 >> j0);
+ uint32_t j = i0 + (0x40000000 >> j0);
if (j < i0)
se += 1;
i0 = (j & ~i) | 0x80000000;
@@ -72,17 +67,15 @@ __roundl (long double x)
}
else
{
- u_int32_t i = 0xffffffff >> (j0 - 31);
+ uint32_t i = 0xffffffff >> (j0 - 31);
if ((i1 & i) == 0)
/* X is integral. */
return x;
- math_force_eval (huge + x);
- /* Raise inexact if x != 0. */
- u_int32_t j = i1 + (1 << (62 - j0));
+ uint32_t j = i1 + (1 << (62 - j0));
if (j < i1)
{
- u_int32_t k = i0 + 1;
+ uint32_t k = i0 + 1;
if (k < i0)
{
se += 1;
@@ -97,4 +90,4 @@ __roundl (long double x)
SET_LDOUBLE_WORDS (x, se, i0, i1);
return x;
}
-weak_alias (__roundl, roundl)
+libm_alias_ldouble (__round, round)
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadl.c b/sysdeps/ieee754/ldbl-96/s_setpayloadl.c
new file mode 100644
index 0000000000..9f43c259ec
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadl.c
@@ -0,0 +1,4 @@
+#define SIG 0
+#define FUNC __setpayloadl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c
new file mode 100644
index 0000000000..6b85bdf1a9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c
@@ -0,0 +1,69 @@
+/* Set NaN payload. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+#define SET_HIGH_BIT (HIGH_ORDER_BIT_IS_SET_FOR_SNAN ? SIG : !SIG)
+#define BIAS 0x3fff
+#define PAYLOAD_DIG 62
+#define EXPLICIT_MANT_DIG 63
+
+int
+FUNC (long double *x, long double payload)
+{
+ uint32_t hx, lx;
+ uint16_t exponent;
+ GET_LDOUBLE_WORDS (exponent, hx, lx, payload);
+ /* Test if argument is (a) negative or too large; (b) too small,
+ except for 0 when allowed; (c) not an integer. */
+ if (exponent >= BIAS + PAYLOAD_DIG
+ || (exponent < BIAS && !(SET_HIGH_BIT
+ && exponent == 0 && hx == 0 && lx == 0)))
+ {
+ SET_LDOUBLE_WORDS (*x, 0, 0, 0);
+ return 1;
+ }
+ int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
+ if (shift < 32
+ ? (lx & ((1U << shift) - 1)) != 0
+ : (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0))
+ {
+ SET_LDOUBLE_WORDS (*x, 0, 0, 0);
+ return 1;
+ }
+ if (exponent != 0)
+ {
+ if (shift >= 32)
+ {
+ lx = hx >> (shift - 32);
+ hx = 0;
+ }
+ else if (shift != 0)
+ {
+ lx = (lx >> shift) | (hx << (32 - shift));
+ hx >>= shift;
+ }
+ }
+ hx |= 0x80000000 | (SET_HIGH_BIT ? 0x40000000 : 0);
+ SET_LDOUBLE_WORDS (*x, 0x7fff, hx, lx);
+ return 0;
+}
diff --git a/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c
new file mode 100644
index 0000000000..cd82f295aa
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_setpayloadsigl.c
@@ -0,0 +1,4 @@
+#define SIG 1
+#define FUNC __setpayloadsigl
+#include <s_setpayloadl_main.c>
+libm_alias_ldouble (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/ldbl-96/s_signbitl.c b/sysdeps/ieee754/ldbl-96/s_signbitl.c
index ee5d77e27a..19953c180a 100644
--- a/sysdeps/ieee754/ldbl-96/s_signbitl.c
+++ b/sysdeps/ieee754/ldbl-96/s_signbitl.c
@@ -1,5 +1,5 @@
/* Return nonzero value if number is negative.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/ieee754/ldbl-96/s_sincosl.c b/sysdeps/ieee754/ldbl-96/s_sincosl.c
index ab32b73e7d..355c25dba9 100644
--- a/sysdeps/ieee754/ldbl-96/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-96/s_sincosl.c
@@ -1,5 +1,5 @@
/* Compute sine and cosine of argument.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,6 +21,7 @@
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
void
@@ -73,4 +74,4 @@ __sincosl (long double x, long double *sinx, long double *cosx)
}
}
}
-weak_alias (__sincosl, sincosl)
+libm_alias_ldouble (__sincos, sincos)
diff --git a/sysdeps/ieee754/ldbl-96/s_sinl.c b/sysdeps/ieee754/ldbl-96/s_sinl.c
index 11e1899822..cfbe9bf153 100644
--- a/sysdeps/ieee754/ldbl-96/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-96/s_sinl.c
@@ -52,6 +52,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __sinl(long double x)
{
@@ -85,4 +86,4 @@ long double __sinl(long double x)
}
}
}
-weak_alias (__sinl, sinl)
+libm_alias_ldouble (__sin, sin)
diff --git a/sysdeps/ieee754/ldbl-96/s_tanhl.c b/sysdeps/ieee754/ldbl-96/s_tanhl.c
index 38edf9f75e..b1b3e0637b 100644
--- a/sysdeps/ieee754/ldbl-96/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-96/s_tanhl.c
@@ -45,6 +45,8 @@ static char rcsid[] = "$NetBSD: $";
#include <float.h>
#include <math.h>
#include <math_private.h>
+#include <math-underflow.h>
+#include <libm-alias-ldouble.h>
static const long double one=1.0, two=2.0, tiny = 1.0e-4900L;
@@ -52,7 +54,7 @@ long double __tanhl(long double x)
{
long double t,z;
int32_t se;
- u_int32_t j0,j1,ix;
+ uint32_t j0,j1,ix;
/* High word of |x|. */
GET_LDOUBLE_WORDS(se,j0,j1,x);
@@ -87,4 +89,4 @@ long double __tanhl(long double x)
}
return (se&0x8000)? -z: z;
}
-weak_alias (__tanhl, tanhl)
+libm_alias_ldouble (__tanh, tanh)
diff --git a/sysdeps/ieee754/ldbl-96/s_tanl.c b/sysdeps/ieee754/ldbl-96/s_tanl.c
index 3fbe4a8f6b..b4163792c5 100644
--- a/sysdeps/ieee754/ldbl-96/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-96/s_tanl.c
@@ -51,6 +51,7 @@ static char rcsid[] = "$NetBSD: $";
#include <errno.h>
#include <math.h>
#include <math_private.h>
+#include <libm-alias-ldouble.h>
long double __tanl(long double x)
{
@@ -78,4 +79,4 @@ long double __tanl(long double x)
-1 -- n odd */
}
}
-weak_alias (__tanl, tanl)
+libm_alias_ldouble (__tan, tan)
diff --git a/sysdeps/ieee754/ldbl-96/s_totalorderl.c b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
new file mode 100644
index 0000000000..f5be9bf28e
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalorderl.c
@@ -0,0 +1,59 @@
+/* Total order operation. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalorderl (long double x, long double y)
+{
+ int16_t expx, expy;
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ GET_LDOUBLE_WORDS (expx, hx, lx, x);
+ GET_LDOUBLE_WORDS (expy, hy, ly, y);
+ if (LDBL_MIN_EXP == -16382)
+ {
+ /* M68K variant: for the greatest exponent, the high mantissa
+ bit is not significant and both values of it are valid, so
+ set it before comparing. For the Intel variant, only one
+ value of the high mantissa bit is valid for each exponent, so
+ this is not necessary. */
+ if ((expx & 0x7fff) == 0x7fff)
+ hx |= 0x80000000;
+ if ((expy & 0x7fff) == 0x7fff)
+ hy |= 0x80000000;
+ }
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ uint32_t x_sign = expx >> 15;
+ uint32_t y_sign = expy >> 15;
+ expx ^= x_sign >> 17;
+ hx ^= x_sign;
+ lx ^= x_sign;
+ expy ^= y_sign >> 17;
+ hy ^= y_sign;
+ ly ^= y_sign;
+ return expx < expy || (expx == expy && (hx < hy || (hx == hy && lx <= ly)));
+}
+libm_alias_ldouble (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/ldbl-96/s_totalordermagl.c b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
new file mode 100644
index 0000000000..18efefaee1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_totalordermagl.c
@@ -0,0 +1,53 @@
+/* Total order operation on absolute values. ldbl-96 version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_private.h>
+#include <libm-alias-ldouble.h>
+#include <nan-high-order-bit.h>
+#include <stdint.h>
+
+int
+__totalordermagl (long double x, long double y)
+{
+ uint16_t expx, expy;
+ uint32_t hx, hy;
+ uint32_t lx, ly;
+ GET_LDOUBLE_WORDS (expx, hx, lx, x);
+ GET_LDOUBLE_WORDS (expy, hy, ly, y);
+ expx &= 0x7fff;
+ expy &= 0x7fff;
+ if (LDBL_MIN_EXP == -16382)
+ {
+ /* M68K variant: for the greatest exponent, the high mantissa
+ bit is not significant and both values of it are valid, so
+ set it before comparing. For the Intel variant, only one
+ value of the high mantissa bit is valid for each exponent, so
+ this is not necessary. */
+ if (expx == 0x7fff)
+ hx |= 0x80000000;
+ if (expy == 0x7fff)
+ hy |= 0x80000000;
+ }
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+# error not implemented
+#endif
+ return expx < expy || (expx == expy && (hx < hy || (hx == hy && lx <= ly)));
+}
+libm_alias_ldouble (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/ldbl-96/s_ufromfpl.c b/sysdeps/ieee754/ldbl-96/s_ufromfpl.c
new file mode 100644
index 0000000000..22935e6ef7
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ufromfpl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC __ufromfpl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c
new file mode 100644
index 0000000000..77a5423de8
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/s_ufromfpxl.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC __ufromfpxl
+#include <s_fromfpl_main.c>
+libm_alias_ldouble (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strtold_l.c
index b51560e18a..145e64f766 100644
--- a/sysdeps/ieee754/ldbl-96/strtold_l.c
+++ b/sysdeps/ieee754/ldbl-96/strtold_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,4 +34,19 @@
#define MPN2FLOAT __mpn_construct_long_double
#define FLOAT_HUGE_VAL HUGE_VALL
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
#include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-96/t_sincosl.c b/sysdeps/ieee754/ldbl-96/t_sincosl.c
index f00a182061..5d3531f677 100644
--- a/sysdeps/ieee754/ldbl-96/t_sincosl.c
+++ b/sysdeps/ieee754/ldbl-96/t_sincosl.c
@@ -1,5 +1,5 @@
/* Extended-precision floating point sine and cosine tables.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Based on quad-precision tables by Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c b/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c
new file mode 100644
index 0000000000..cd63e01140
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c
@@ -0,0 +1,141 @@
+/* Test iscanonical and canonicalizel for ldbl-96.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+struct test
+{
+ bool sign;
+ uint16_t exponent;
+ bool high;
+ uint64_t mantissa;
+ bool canonical;
+};
+
+#define M68K_VARIANT (LDBL_MIN_EXP == -16382)
+
+static const struct test tests[] =
+ {
+ { false, 0, true, 0, M68K_VARIANT },
+ { true, 0, true, 0, M68K_VARIANT },
+ { false, 0, true, 1, M68K_VARIANT },
+ { true, 0, true, 1, M68K_VARIANT },
+ { false, 0, true, 0x100000000ULL, M68K_VARIANT },
+ { true, 0, true, 0x100000000ULL, M68K_VARIANT },
+ { false, 0, false, 0, true },
+ { true, 0, false, 0, true },
+ { false, 0, false, 1, true },
+ { true, 0, false, 1, true },
+ { false, 0, false, 0x100000000ULL, true },
+ { true, 0, false, 0x100000000ULL, true },
+ { false, 1, true, 0, true },
+ { true, 1, true, 0, true },
+ { false, 1, true, 1, true },
+ { true, 1, true, 1, true },
+ { false, 1, true, 0x100000000ULL, true },
+ { true, 1, true, 0x100000000ULL, true },
+ { false, 1, false, 0, false },
+ { true, 1, false, 0, false },
+ { false, 1, false, 1, false },
+ { true, 1, false, 1, false },
+ { false, 1, false, 0x100000000ULL, false },
+ { true, 1, false, 0x100000000ULL, false },
+ { false, 0x7ffe, true, 0, true },
+ { true, 0x7ffe, true, 0, true },
+ { false, 0x7ffe, true, 1, true },
+ { true, 0x7ffe, true, 1, true },
+ { false, 0x7ffe, true, 0x100000000ULL, true },
+ { true, 0x7ffe, true, 0x100000000ULL, true },
+ { false, 0x7ffe, false, 0, false },
+ { true, 0x7ffe, false, 0, false },
+ { false, 0x7ffe, false, 1, false },
+ { true, 0x7ffe, false, 1, false },
+ { false, 0x7ffe, false, 0x100000000ULL, false },
+ { true, 0x7ffe, false, 0x100000000ULL, false },
+ { false, 0x7fff, true, 0, true },
+ { true, 0x7fff, true, 0, true },
+ { false, 0x7fff, true, 1, true },
+ { true, 0x7fff, true, 1, true },
+ { false, 0x7fff, true, 0x100000000ULL, true },
+ { true, 0x7fff, true, 0x100000000ULL, true },
+ { false, 0x7fff, false, 0, M68K_VARIANT },
+ { true, 0x7fff, false, 0, M68K_VARIANT },
+ { false, 0x7fff, false, 1, M68K_VARIANT },
+ { true, 0x7fff, false, 1, M68K_VARIANT },
+ { false, 0x7fff, false, 0x100000000ULL, M68K_VARIANT },
+ { true, 0x7fff, false, 0x100000000ULL, M68K_VARIANT },
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ld;
+ SET_LDOUBLE_WORDS (ld, tests[i].exponent | (tests[i].sign << 15),
+ (tests[i].mantissa >> 32) | (tests[i].high << 31),
+ tests[i].mantissa & 0xffffffffULL);
+ bool canonical = iscanonical (ld);
+ if (canonical == tests[i].canonical)
+ {
+ printf ("PASS: iscanonical test %zu\n", i);
+ long double ldc = 12345.0L;
+ bool canonicalize_ret = canonicalizel (&ldc, &ld);
+ if (canonicalize_ret == !canonical)
+ {
+ printf ("PASS: canonicalizel test %zu\n", i);
+ bool canon_ok;
+ if (!canonical)
+ canon_ok = ldc == 12345.0L;
+ else if (isnan (ld))
+ canon_ok = isnan (ldc) && !issignaling (ldc);
+ else
+ canon_ok = ldc == ld;
+ if (canon_ok)
+ printf ("PASS: canonicalized value test %zu\n", i);
+ else
+ {
+ printf ("FAIL: canonicalized value test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: canonicalizel test %zu\n", i);
+ result = 1;
+ }
+ }
+ else
+ {
+ printf ("FAIL: iscanonical test %zu\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
new file mode 100644
index 0000000000..552a97783a
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c
@@ -0,0 +1,82 @@
+/* Test totalorderl and totalordermagl for ldbl-96.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <float.h>
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+static const uint64_t tests[] =
+ {
+ 0, 1, 0x4000000000000000ULL, 0x4000000000000001ULL,
+ 0x7fffffffffffffffULL
+ };
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ if (LDBL_MIN_EXP == -16382)
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
+ {
+ long double ldx, ldy, ldnx, ldny;
+ /* Verify that the high bit of the mantissa is ignored for
+ infinities and NaNs for the M68K variant of this
+ format. */
+ SET_LDOUBLE_WORDS (ldx, 0x7fff,
+ tests[i] >> 32, tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldy, 0x7fff,
+ (tests[i] >> 32) | 0x80000000,
+ tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldnx, 0xffff,
+ tests[i] >> 32, tests[i] & 0xffffffffULL);
+ SET_LDOUBLE_WORDS (ldny, 0xffff,
+ (tests[i] >> 32) | 0x80000000,
+ tests[i] & 0xffffffffULL);
+ bool to1 = totalorderl (ldx, ldy);
+ bool to2 = totalorderl (ldy, ldx);
+ bool to3 = totalorderl (ldnx, ldny);
+ bool to4 = totalorderl (ldny, ldnx);
+ if (to1 && to2 && to3 && to4)
+ printf ("PASS: test %zu\n", i);
+ else
+ {
+ printf ("FAIL: test %zu\n", i);
+ result = 1;
+ }
+ to1 = totalordermagl (ldx, ldy);
+ to2 = totalordermagl (ldy, ldx);
+ to3 = totalordermagl (ldnx, ldny);
+ to4 = totalordermagl (ldny, ldnx);
+ if (to1 && to2 && to3 && to4)
+ printf ("PASS: test %zu (totalordermagl)\n", i);
+ else
+ {
+ printf ("FAIL: test %zu (totalordermagl)\n", i);
+ result = 1;
+ }
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sysdeps/ieee754/ldbl-96/x2y2m1.c b/sysdeps/ieee754/ldbl-96/x2y2m1.c
index 4119f42acc..afe7ab161b 100644
--- a/sysdeps/ieee754/ldbl-96/x2y2m1.c
+++ b/sysdeps/ieee754/ldbl-96/x2y2m1.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sysdeps/ieee754/ldbl-96/x2y2m1l.c b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
index 733742da04..392830c1b0 100644
--- a/sysdeps/ieee754/ldbl-96/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-96/x2y2m1l.c
@@ -1,5 +1,5 @@
/* Compute x^2 + y^2 - 1, without large cancellation error.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
#include <math.h>
#include <math_private.h>
-#include <float.h>
+#include <mul_splitl.h>
#include <stdlib.h>
/* Calculate X + Y exactly and store the result in *HI + *LO. It is
@@ -33,36 +33,6 @@ add_split (long double *hi, long double *lo, long double x, long double y)
*lo = (x - *hi) + y;
}
-/* Calculate X * Y exactly and store the result in *HI + *LO. It is
- given that the values are small enough that no overflow occurs and
- large enough (or zero) that no underflow occurs. */
-
-static inline void
-mul_split (long double *hi, long double *lo, long double x, long double y)
-{
-#ifdef __FP_FAST_FMAL
- /* Fast built-in fused multiply-add. */
- *hi = x * y;
- *lo = __builtin_fmal (x, y, -*hi);
-#elif defined FP_FAST_FMAL
- /* Fast library fused multiply-add, compiler before GCC 4.6. */
- *hi = x * y;
- *lo = __fmal (x, y, -*hi);
-#else
- /* Apply Dekker's algorithm. */
- *hi = x * y;
-# define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1)
- long double x1 = x * C;
- long double y1 = y * C;
-# undef C
- x1 = (x - x1) + x1;
- y1 = (y - y1) + y1;
- long double x2 = x - x1;
- long double y2 = y - y1;
- *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
-#endif
-}
-
/* Compare absolute values of floating-point values pointed to by P
and Q for qsort. */
@@ -88,8 +58,8 @@ __x2y2m1l (long double x, long double y)
{
long double vals[5];
SET_RESTORE_ROUNDL (FE_TONEAREST);
- mul_split (&vals[1], &vals[0], x, x);
- mul_split (&vals[3], &vals[2], y, y);
+ mul_splitl (&vals[1], &vals[0], x, x);
+ mul_splitl (&vals[3], &vals[2], y, y);
vals[4] = -1.0L;
qsort (vals, 5, sizeof (long double), compare);
/* Add up the values so that each element of VALS has absolute value
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index 53091e410c..ef790adc77 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -24,11 +24,12 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
vdprintf_chk obstack_printf_chk obstack_vprintf_chk \
syslog syslog_chk vsyslog vsyslog_chk \
strfmon strfmon_l \
+ strfroml \
strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \
qecvt qfcvt qgcvt qecvt_r qfcvt_r \
isinf isnan finite signbit scalb log2 lgamma_r ceil \
significand acos asin atan atan2 cos sin tan cosh sinh \
- tanh acosh asinh atanh exp log log10 exp10 pow10 expm1 \
+ tanh acosh asinh atanh exp log log10 exp10 expm1 \
log1p logb exp2 sqrt cbrt fabs floor j0 j1 y0 y1 erf erfc \
lgamma tgamma gamma rint nearbyint round trunc \
copysign fdim fmax fmin nextafter pow hypot fmod \
@@ -40,7 +41,11 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
isoc99_scanf isoc99_fscanf isoc99_sscanf \
isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
- isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf
+ isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
+ nextup nextdown totalorder totalordermag getpayload \
+ canonicalize setpayload setpayloadsig llogb fmaxmag fminmag \
+ roundeven fromfp ufromfp fromfpx ufromfpx fadd dadd \
+ fdiv ddiv fmul dmul fsub dsub
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
@@ -56,6 +61,7 @@ CFLAGS-nldbl-atanh.c = -fno-builtin-atanhl
CFLAGS-nldbl-cabs.c = -fno-builtin-cabsl
CFLAGS-nldbl-cacos.c = -fno-builtin-cacosl
CFLAGS-nldbl-cacosh.c = -fno-builtin-cacoshl
+CFLAGS-nldbl-canonicalize.c = -fno-builtin-canonicalizel
CFLAGS-nldbl-carg.c = -fno-builtin-cargl
CFLAGS-nldbl-casin.c = -fno-builtin-casinl
CFLAGS-nldbl-casinh.c = -fno-builtin-casinhl
@@ -81,6 +87,10 @@ CFLAGS-nldbl-csinh.c = -fno-builtin-csinhl
CFLAGS-nldbl-csqrt.c = -fno-builtin-csqrtl
CFLAGS-nldbl-ctan.c = -fno-builtin-ctanl
CFLAGS-nldbl-ctanh.c = -fno-builtin-ctanhl
+CFLAGS-nldbl-dadd.c = -fno-builtin-daddl
+CFLAGS-nldbl-ddiv.c = -fno-builtin-ddivl
+CFLAGS-nldbl-dmul.c = -fno-builtin-dmull
+CFLAGS-nldbl-dsub.c = -fno-builtin-dsubl
CFLAGS-nldbl-erf.c = -fno-builtin-erfl
CFLAGS-nldbl-erfc.c = -fno-builtin-erfcl
CFLAGS-nldbl-exp.c = -fno-builtin-expl
@@ -88,15 +98,24 @@ CFLAGS-nldbl-exp10.c = -fno-builtin-exp10l
CFLAGS-nldbl-exp2.c = -fno-builtin-exp2l
CFLAGS-nldbl-expm1.c = -fno-builtin-expm1l
CFLAGS-nldbl-fabs.c = -fno-builtin-fabsl
+CFLAGS-nldbl-fadd.c = -fno-builtin-faddl
CFLAGS-nldbl-fdim.c = -fno-builtin-fdiml
+CFLAGS-nldbl-fdiv.c = -fno-builtin-fdivl
CFLAGS-nldbl-finite.c = -fno-builtin-finitel
CFLAGS-nldbl-floor.c = -fno-builtin-floorl
CFLAGS-nldbl-fma.c = -fno-builtin-fmal
CFLAGS-nldbl-fmax.c = -fno-builtin-fmaxl
+CFLAGS-nldbl-fmaxmag.c = -fno-builtin-fmaxmagl
CFLAGS-nldbl-fmin.c = -fno-builtin-fminl
+CFLAGS-nldbl-fminmag.c = -fno-builtin-fminmagl
CFLAGS-nldbl-fmod.c = -fno-builtin-fmodl
+CFLAGS-nldbl-fmul.c = -fno-builtin-fmull
CFLAGS-nldbl-frexp.c = -fno-builtin-frexpl
+CFLAGS-nldbl-fromfp.c = -fno-builtin-fromfpl
+CFLAGS-nldbl-fromfpx.c = -fno-builtin-fromfpxl
+CFLAGS-nldbl-fsub.c = -fno-builtin-fsubl
CFLAGS-nldbl-gamma.c = -fno-builtin-gammal
+CFLAGS-nldbl-getpayload.c = -fno-builtin-getpayloadl
CFLAGS-nldbl-hypot.c = -fno-builtin-hypotl
CFLAGS-nldbl-ilogb.c = -fno-builtin-ilogbl
CFLAGS-nldbl-isinf.c = -fno-builtin-isinfl
@@ -107,6 +126,7 @@ CFLAGS-nldbl-jn.c = -fno-builtin-jnl
CFLAGS-nldbl-ldexp.c = -fno-builtin-ldexpl
CFLAGS-nldbl-lgamma.c = -fno-builtin-lgammal
CFLAGS-nldbl-lgamma_r.c = -fno-builtin-lgammal_r
+CFLAGS-nldbl-llogb.c = -fno-builtin-llogbl
CFLAGS-nldbl-llrint.c = -fno-builtin-llrintl
CFLAGS-nldbl-llround.c = -fno-builtin-llroundl
CFLAGS-nldbl-log.c = -fno-builtin-logl
@@ -120,17 +140,21 @@ CFLAGS-nldbl-modf.c = -fno-builtin-modfl
CFLAGS-nldbl-nan.c = -fno-builtin-nanl
CFLAGS-nldbl-nearbyint.c = -fno-builtin-nearbyintl
CFLAGS-nldbl-nextafter.c = -fno-builtin-nextafterl
+CFLAGS-nldbl-nextdown.c = -fno-builtin-nextdownl
CFLAGS-nldbl-nexttoward.c = -fno-builtin-nexttoward -fno-builtin-nexttowardl
CFLAGS-nldbl-nexttowardf.c = -fno-builtin-nexttowardf
+CFLAGS-nldbl-nextup.c = -fno-builtin-nextupl
CFLAGS-nldbl-pow.c = -fno-builtin-powl
-CFLAGS-nldbl-pow10.c = -fno-builtin-pow10l
CFLAGS-nldbl-remainder.c = -fno-builtin-remainderl -fno-builtin-dreml
CFLAGS-nldbl-remquo.c = -fno-builtin-remquol
CFLAGS-nldbl-rint.c = -fno-builtin-rintl
CFLAGS-nldbl-round.c = -fno-builtin-roundl
+CFLAGS-nldbl-roundeven.c = -fno-builtin-roundevenl
CFLAGS-nldbl-scalb.c = -fno-builtin-scalbl
CFLAGS-nldbl-scalbln.c = -fno-builtin-scalblnl
CFLAGS-nldbl-scalbn.c = -fno-builtin-scalbnl
+CFLAGS-nldbl-setpayload.c = -fno-builtin-setpayloadl
+CFLAGS-nldbl-setpayloadsig.c = -fno-builtin-setpayloadsigl
CFLAGS-nldbl-significand.c = -fno-builtin-significandl
CFLAGS-nldbl-sin.c = -fno-builtin-sinl
CFLAGS-nldbl-sincos.c = -fno-builtin-sincosl
@@ -139,9 +163,16 @@ CFLAGS-nldbl-sqrt.c = -fno-builtin-sqrtl
CFLAGS-nldbl-tan.c = -fno-builtin-tanl
CFLAGS-nldbl-tanh.c = -fno-builtin-tanhl
CFLAGS-nldbl-tgamma.c = -fno-builtin-tgammal
+CFLAGS-nldbl-totalorder.c = -fno-builtin-totalorderl
+CFLAGS-nldbl-totalordermag.c = -fno-builtin-totalordermagl
CFLAGS-nldbl-trunc.c = -fno-builtin-truncl
+CFLAGS-nldbl-ufromfp.c = -fno-builtin-ufromfpl
+CFLAGS-nldbl-ufromfpx.c = -fno-builtin-ufromfpxl
CFLAGS-nldbl-y0.c = -fno-builtin-y0l
CFLAGS-nldbl-y1.c = -fno-builtin-y1l
CFLAGS-nldbl-yn.c = -fno-builtin-ynl
+tests += test-narrow-macros-ldbl-64
+CFLAGS-test-narrow-macros-ldbl-64.c += -mlong-double-64
+
endif
diff --git a/sysdeps/ieee754/ldbl-opt/Versions b/sysdeps/ieee754/ldbl-opt/Versions
index d3f0beaef2..af0c4a098c 100644
--- a/sysdeps/ieee754/ldbl-opt/Versions
+++ b/sysdeps/ieee754/ldbl-opt/Versions
@@ -97,4 +97,10 @@ libm {
sincosl; tanl; tanhl; truncl; expl; __finitel; __signbitl;
__fpclassifyl; nexttowardf; nexttoward; __nldbl_nexttowardf;
}
+ GLIBC_2.28 {
+ # Functions taking long double = double argument and rounding
+ # result to double (same as f32x*f64 functions, but those names
+ # are not reserved in TS 18661-1).
+ __nldbl_daddl; __nldbl_ddivl; __nldbl_dmull; __nldbl_dsubl;
+ }
}
diff --git a/sysdeps/ieee754/ldbl-opt/bits/long-double.h b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
new file mode 100644
index 0000000000..69b33890ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
@@ -0,0 +1,24 @@
+/* Properties of long double type. ldbl-opt version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __LONG_DOUBLE_MATH_OPTIONAL 1
+# ifndef __LONG_DOUBLE_128__
+# define __NO_LONG_DOUBLE_MATH 1
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cabs.c b/sysdeps/ieee754/ldbl-opt/cabs.c
deleted file mode 100644
index a181de2fa8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cabs, cabsl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cabsl.c b/sysdeps/ieee754/ldbl-opt/cabsl.c
deleted file mode 100644
index b861633544..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabsl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cabsl.c>
-long_double_symbol (libm, __cabsl, cabsl);
diff --git a/sysdeps/ieee754/ldbl-opt/carg.c b/sysdeps/ieee754/ldbl-opt/carg.c
deleted file mode 100644
index 2ed358113c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/carg.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/carg.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __carg, cargl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cargl.c b/sysdeps/ieee754/ldbl-opt/cargl.c
deleted file mode 100644
index 952dc60664..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cargl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cargl.c>
-long_double_symbol (libm, __cargl, cargl);
diff --git a/sysdeps/ieee754/ldbl-opt/cimag.c b/sysdeps/ieee754/ldbl-opt/cimag.c
deleted file mode 100644
index f8052581b3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimag.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cimag.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cimag, cimagl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cimagl.c b/sysdeps/ieee754/ldbl-opt/cimagl.c
deleted file mode 100644
index 112365e3ae..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimagl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cimagl.c>
-long_double_symbol (libm, __cimagl, cimagl);
diff --git a/sysdeps/ieee754/ldbl-opt/conj.c b/sysdeps/ieee754/ldbl-opt/conj.c
deleted file mode 100644
index e4edade05e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/conj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __conj, conjl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/conjl.c b/sysdeps/ieee754/ldbl-opt/conjl.c
deleted file mode 100644
index c98e0ed1c3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conjl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/conjl.c>
-long_double_symbol (libm, __conjl, conjl);
diff --git a/sysdeps/ieee754/ldbl-opt/creal.c b/sysdeps/ieee754/ldbl-opt/creal.c
deleted file mode 100644
index 0d1c93e640..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creal.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/creal.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __creal, creall, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/creall.c b/sysdeps/ieee754/ldbl-opt/creall.c
deleted file mode 100644
index 68fedd4ccd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creall.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/creall.c>
-long_double_symbol (libm, __creall, creall);
diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-double.h b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
new file mode 100644
index 0000000000..95f810f4eb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
@@ -0,0 +1,72 @@
+/* Define aliases for libm double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBM_ALIAS_DOUBLE_H
+#define _LIBM_ALIAS_DOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <first-versions.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define libm_alias_double_other_r_f64(from, to, r) \
+ weak_alias (from ## r, to ## f64 ## r)
+#else
+# define libm_alias_double_other_r_f64(from, to, r)
+#endif
+
+#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define libm_alias_double_other_r_f32x(from, to, r) \
+ weak_alias (from ## r, to ## f32x ## r)
+#else
+# define libm_alias_double_other_r_f32x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a double libm function that
+ has internal name FROM ## R and public names TO ## suffix ## R for
+ each suffix of a supported _FloatN / _FloatNx floating-point type
+ with the same format as double. */
+#define libm_alias_double_other_r(from, to, r) \
+ libm_alias_double_other_r_f64 (from, to, r); \
+ libm_alias_double_other_r_f32x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double_other(from, to) \
+ libm_alias_double_other_r (from, to, )
+
+/* Define aliases for a double libm function that has internal name
+ FROM ## R and public names TO ## suffix ## R for each suffix of a
+ supported floating-point type with the same format as double. This
+ should only be used for functions where such public names exist for
+ _FloatN types, not for implementation-namespace exported names
+ (where there is one name per format, not per type) or for
+ obsolescent functions not provided for _FloatN types. */
+#define libm_alias_double_r(from, to, r) \
+ weak_alias (from ## r, to ## r); \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (compat_symbol (libm, \
+ from ## r, \
+ to ## l ## r, \
+ FIRST_VERSION_libm_ ## to ## l ## r), ); \
+ libm_alias_double_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double(from, to) libm_alias_double_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
new file mode 100644
index 0000000000..df9172b333
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
@@ -0,0 +1,69 @@
+/* Define aliases for libm long double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBM_ALIAS_LDOUBLE_H
+#define _LIBM_ALIAS_LDOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define libm_alias_ldouble_other_r_f128(from, to, r) \
+ weak_alias (from ## l ## r, to ## f128 ## r)
+#else
+# define libm_alias_ldouble_other_r_f128(from, to, r)
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_ldouble_other_r_f64x(from, to, r) \
+ weak_alias (from ## l ## r, to ## f64x ## r)
+#else
+# define libm_alias_ldouble_other_r_f64x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a long double libm function
+ that has internal name FROM ## l ## R and public names TO ## suffix
+ ## R for each suffix of a supported _FloatN / _FloatNx
+ floating-point type with the same format as long double. */
+#define libm_alias_ldouble_other_r(from, to, r) \
+ libm_alias_ldouble_other_r_f128 (from, to, r); \
+ libm_alias_ldouble_other_r_f64x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble_other(from, to) \
+ libm_alias_ldouble_other_r (from, to, )
+
+/* Define aliases for a long double libm function that has internal
+ name FROM ## l ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ long double. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_ldouble_r(from, to, r) \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (long_double_symbol (libm, from ## l ## r, to ## l ## r), \
+ weak_alias (from ## l ## r, to ## l ## r)); \
+ libm_alias_ldouble_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
index af861c11ea..61ba784f86 100644
--- a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
+++ b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
@@ -36,9 +36,6 @@
#endif
#ifndef __ASSEMBLER__
-# include <math.h>
-# include <math_private.h>
-
/* Set temporarily to non-zero if long double should be considered
the same as double. */
extern __thread int __no_long_double attribute_tls_model_ie attribute_hidden;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
new file mode 100644
index 0000000000..a65d87458d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for canonicalize.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+canonicalizel (double *cx, double *x)
+{
+ return canonicalize (cx, x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index 35b7a69945..ffb5fabebe 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -1,5 +1,5 @@
/* *printf* family compatibility routines for IEEE double as long double
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
+#include <math.h>
#include <wchar.h>
#include <printf.h>
#include <monetary.h>
@@ -333,8 +334,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
int
attribute_compat_text_section
-__nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
- int *errp)
+__nldbl__IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
int res;
set_no_long_double ();
@@ -790,7 +790,7 @@ __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
ssize_t
attribute_compat_text_section
-__nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___strfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, ...)
{
va_list ap;
@@ -818,7 +818,7 @@ libc_hidden_def (__nldbl___vstrfmon)
ssize_t
attribute_compat_text_section
-__nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___vstrfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, va_list ap)
{
ssize_t res;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
index 0c3c5ad24d..888f561cac 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
@@ -1,5 +1,5 @@
/* Prototypes for compatibility double == long double entry points.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -24,6 +24,7 @@
#define __NO_LONG_DOUBLE_MATH 1
#include <stdarg.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#include <wchar.h>
@@ -81,23 +82,30 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
/* These don't use __typeof because they were not declared by the headers,
since we don't compile with _FORTIFY_SOURCE. */
extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
- const char *__restrict, _G_va_list);
+ const char *__restrict, __gnuc_va_list);
extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
const wchar_t *__restrict, __gnuc_va_list);
extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,
- const char *__restrict, _G_va_list) __THROW;
+ const char *__restrict, __gnuc_va_list)
+ __THROW;
extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,
- const char *__restrict, _G_va_list)
+ const char *__restrict, __gnuc_va_list)
__THROW;
extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
const wchar_t *__restrict, __gnuc_va_list)
__THROW;
-extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)
+extern int __nldbl___vasprintf_chk (char **, int, const char *, __gnuc_va_list)
__THROW;
-extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __nldbl___vdprintf_chk (int, int, const char *, __gnuc_va_list);
extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);
+/* The original declarations of these were hidden by the including
+ file. */
+extern double __nldbl_daddl (double, double) __THROW;
+extern double __nldbl_ddivl (double, double) __THROW;
+extern double __nldbl_dmull (double, double) __THROW;
+extern double __nldbl_dsubl (double, double) __THROW;
#endif /* __NLDBL_COMPAT_H */
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
new file mode 100644
index 0000000000..acbcb3ff75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dadd.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define daddl __hide_daddl
+#include "nldbl-compat.h"
+#undef daddl
+
+double
+attribute_hidden
+daddl (double x, double y)
+{
+ return __nldbl_daddl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
new file mode 100644
index 0000000000..5cb4606b7d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for ddiv.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define ddivl __hide_ddivl
+#include "nldbl-compat.h"
+#undef ddivl
+
+double
+attribute_hidden
+ddivl (double x, double y)
+{
+ return __nldbl_ddivl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
new file mode 100644
index 0000000000..9c9b94e067
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dmul.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dmull __hide_dmull
+#include "nldbl-compat.h"
+#undef dmull
+
+double
+attribute_hidden
+dmull (double x, double y)
+{
+ return __nldbl_dmull (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
new file mode 100644
index 0000000000..1d31a75f13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dsub.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dsubl __hide_dsubl
+#include "nldbl-compat.h"
+#undef dsubl
+
+double
+attribute_hidden
+dsubl (double x, double y)
+{
+ return __nldbl_dsubl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
new file mode 100644
index 0000000000..c31a6db475
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fadd.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define faddl __hide_faddl
+#include "nldbl-compat.h"
+#undef faddl
+
+float
+attribute_hidden
+faddl (double x, double y)
+{
+ return fadd (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
new file mode 100644
index 0000000000..2d043fc721
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fdiv.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fdivl __hide_fdivl
+#include "nldbl-compat.h"
+#undef fdivl
+
+float
+attribute_hidden
+fdivl (double x, double y)
+{
+ return fdiv (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
new file mode 100644
index 0000000000..774ed88a63
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fmaxmag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+fmaxmagl (double x, double y)
+{
+ return fmaxmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
new file mode 100644
index 0000000000..66dff4f3ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fminmag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+fminmagl (double x, double y)
+{
+ return fminmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
new file mode 100644
index 0000000000..2520d1b014
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fmul.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fmull __hide_fmull
+#include "nldbl-compat.h"
+#undef fmull
+
+float
+attribute_hidden
+fmull (double x, double y)
+{
+ return fmul (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
new file mode 100644
index 0000000000..59db6a9819
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfp.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+intmax_t
+attribute_hidden
+fromfpl (double x, int round, unsigned int width)
+{
+ return fromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
new file mode 100644
index 0000000000..f8df721ff9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfpx.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+intmax_t
+attribute_hidden
+fromfpxl (double x, int round, unsigned int width)
+{
+ return fromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
new file mode 100644
index 0000000000..36dfe11a75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fsub.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fsubl __hide_fsubl
+#include "nldbl-compat.h"
+#undef fsubl
+
+float
+attribute_hidden
+fsubl (double x, double y)
+{
+ return fsub (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
new file mode 100644
index 0000000000..425afebc52
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for getpayload.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+getpayloadl (const double *x)
+{
+ return getpayload (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
index 05581c0354..442c11c203 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
@@ -2,7 +2,7 @@
int
attribute_hidden
-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)
+_IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
return __nldbl__IO_vfscanf (s, fmt, ap, errp);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
new file mode 100644
index 0000000000..d0dcf35f2d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for llogb.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+long int
+attribute_hidden
+llogbl (double x)
+{
+ return llogb (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
new file mode 100644
index 0000000000..30f7f253f3
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextdown.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+/* Return the greatest floating-point number less than X. */
+double
+attribute_hidden
+nextdownl (double x)
+{
+ return nextdown (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
new file mode 100644
index 0000000000..1f04fedbdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextup.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+/* Return the least floating-point number greater than X. */
+double
+attribute_hidden
+nextupl (double x)
+{
+ return nextup (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c b/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
deleted file mode 100644
index 20ebf8d1bb..0000000000
--- a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "nldbl-compat.h"
-
-double
-attribute_hidden
-pow10l (double x)
-{
- return pow10 (x);
-}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
new file mode 100644
index 0000000000..ccafa45af1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for roundeven.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+roundevenl (double x)
+{
+ return roundeven (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
new file mode 100644
index 0000000000..810e329454
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayload.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+setpayloadl (double *x, double payload)
+{
+ return setpayload (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
new file mode 100644
index 0000000000..c510f3ea0b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayloadsig.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+setpayloadsigl (double *x, double payload)
+{
+ return setpayloadsig (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
index 0db0e8c42f..9281e17a37 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
@@ -2,7 +2,7 @@
ssize_t
attribute_hidden
-__strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
+__strfmon_l (char *s, size_t maxsize, locale_t loc, const char *format, ...)
{
va_list ap;
ssize_t res;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
new file mode 100644
index 0000000000..d6df69e418
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
@@ -0,0 +1,8 @@
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+strfroml (char *dest, size_t size, const char *format, long double f)
+{
+ return strfromd (dest, size, format, f);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
index 33ff1ca5b5..29ad60c8a5 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
@@ -8,11 +8,11 @@
extern double
__strtod_l (const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc);
+ locale_t __loc);
double
attribute_hidden
-__strtold_l (const char *nptr, char **endptr, __locale_t loc)
+__strtold_l (const char *nptr, char **endptr, locale_t loc)
{
return __strtod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
new file mode 100644
index 0000000000..52aaa4618b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalorder.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalorderl (double x, double y)
+{
+ return totalorder (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
new file mode 100644
index 0000000000..0a8860b53f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalordermag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalordermagl (double x, double y)
+{
+ return totalordermag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
new file mode 100644
index 0000000000..a7b6835ce6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfp.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+uintmax_t
+attribute_hidden
+ufromfpl (double x, int round, unsigned int width)
+{
+ return ufromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
new file mode 100644
index 0000000000..61eea00996
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfpx.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+uintmax_t
+attribute_hidden
+ufromfpxl (double x, int round, unsigned int width)
+{
+ return ufromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
index e32d13a94b..7004ae79f4 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
@@ -6,7 +6,7 @@
double
attribute_hidden
-__wcstold_l (const wchar_t *nptr, wchar_t **endptr, __locale_t loc)
+__wcstold_l (const wchar_t *nptr, wchar_t **endptr, locale_t loc)
{
return __wcstod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/s_asinh.c b/sysdeps/ieee754/ldbl-opt/s_asinh.c
deleted file mode 100644
index e9bcfaea62..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_asinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_asinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asinh, asinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_atan.c b/sysdeps/ieee754/ldbl-opt/s_atan.c
deleted file mode 100644
index 5fbd5e62d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_atan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_atan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, atan, atanl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacos.c b/sysdeps/ieee754/ldbl-opt/s_cacos.c
deleted file mode 100644
index db90a9ef18..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacos, cacosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosh.c b/sysdeps/ieee754/ldbl-opt/s_cacosh.c
deleted file mode 100644
index e68049d46d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacosh, cacoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c b/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
deleted file mode 100644
index ed4a299845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacoshl.c>
-long_double_symbol (libm, __cacoshl, cacoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosl.c b/sysdeps/ieee754/ldbl-opt/s_cacosl.c
deleted file mode 100644
index 9b840054e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacosl.c>
-long_double_symbol (libm, __cacosl, cacosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_casin.c b/sysdeps/ieee754/ldbl-opt/s_casin.c
deleted file mode 100644
index 04c47ca602..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casin, casinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinh.c b/sysdeps/ieee754/ldbl-opt/s_casinh.c
deleted file mode 100644
index 19c4fa30f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casinh, casinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinhl.c b/sysdeps/ieee754/ldbl-opt/s_casinhl.c
deleted file mode 100644
index 976fa8e5b0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinhl.c>
-long_double_symbol (libm, __casinhl, casinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinl.c b/sysdeps/ieee754/ldbl-opt/s_casinl.c
deleted file mode 100644
index 7afb77cd4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinl.c>
-long_double_symbol (libm, __casinl, casinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catan.c b/sysdeps/ieee754/ldbl-opt/s_catan.c
deleted file mode 100644
index 19f61736d2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catan, catanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanh.c b/sysdeps/ieee754/ldbl-opt/s_catanh.c
deleted file mode 100644
index cff7861444..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catanh, catanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanhl.c b/sysdeps/ieee754/ldbl-opt/s_catanhl.c
deleted file mode 100644
index e9562825e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanhl.c>
-long_double_symbol (libm, __catanhl, catanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanl.c b/sysdeps/ieee754/ldbl-opt/s_catanl.c
deleted file mode 100644
index ee2fdf5d6c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanl.c>
-long_double_symbol (libm, __catanl, catanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cbrt.c b/sysdeps/ieee754/ldbl-opt/s_cbrt.c
deleted file mode 100644
index cdc635771e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cbrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_cbrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cbrt, cbrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccos.c b/sysdeps/ieee754/ldbl-opt/s_ccos.c
deleted file mode 100644
index 2c43c7f392..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccos, ccosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosh.c b/sysdeps/ieee754/ldbl-opt/s_ccosh.c
deleted file mode 100644
index 3753cd56bc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccosh, ccoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c b/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
deleted file mode 100644
index 9f0c1e1a32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccoshl.c>
-long_double_symbol (libm, __ccoshl, ccoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosl.c b/sysdeps/ieee754/ldbl-opt/s_ccosl.c
deleted file mode 100644
index e93e80538e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccosl.c>
-long_double_symbol (libm, __ccosl, ccosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ceil.c b/sysdeps/ieee754/ldbl-opt/s_ceil.c
deleted file mode 100644
index 6e4b70795d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ceil.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_ceil.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexp.c b/sysdeps/ieee754/ldbl-opt/s_cexp.c
deleted file mode 100644
index d983c96b7b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cexp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cexp, cexpl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexpl.c b/sysdeps/ieee754/ldbl-opt/s_cexpl.c
deleted file mode 100644
index d5ae1fc0d0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexpl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cexpl.c>
-long_double_symbol (libm, __cexpl, cexpl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog.c b/sysdeps/ieee754/ldbl-opt/s_clog.c
deleted file mode 100644
index 3e0e90cf89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clog.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_clog.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog, clogl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10.c b/sysdeps/ieee754/ldbl-opt/s_clog10.c
index ac3f4a3a71..1ce017392c 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10.c
@@ -1,7 +1,28 @@
-#include <complex.h>
+/* Define __clog10l compat symbol for clog10 for ldbl-opt.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
#include <math_ldbl_opt.h>
-#include <math/s_clog10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog10, __clog10l, GLIBC_2_1);
-compat_symbol (libm, clog10, clog10l, GLIBC_2_1);
+#include <first-versions.h>
+#include <math-type-macros-double.h>
+
+#include <s_clog10_template.c>
+
+#if LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm___clog10l)
+strong_alias (__clog10, __clog10l_alias)
+compat_symbol (libm, __clog10l_alias, __clog10l, FIRST_VERSION_libm___clog10l);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10l.c b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
index 954f68095a..77e1dc3812 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10l.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
@@ -1,10 +1,32 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#define __clog10l __clog10l_internal
-#include <math/s_clog10l.c>
-#undef __clog10l
-strong_alias (__clog10l_internal, __clog10l__internal)
+/* clog10l alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define M_DECL_FUNC(x) __clog10l_internal
+#include <math-type-macros-ldouble.h>
+
+#undef declare_mgen_alias
+#define declare_mgen_alias(from, to)
+
+#include <s_clog10_template.c>
+
+/* __clog10l is also a public symbol. */
+strong_alias (__clog10l_internal, __clog10_internal_l)
long_double_symbol (libm, __clog10l_internal, __clog10l);
-long_double_symbol (libm, __clog10l__internal, clog10l);
+long_double_symbol (libm, __clog10_internal_l, clog10l);
+libm_alias_ldouble_other (__clog10_internal_, clog10)
diff --git a/sysdeps/ieee754/ldbl-opt/s_clogl.c b/sysdeps/ieee754/ldbl-opt/s_clogl.c
deleted file mode 100644
index 75126c8b89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clogl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_clogl.c>
-long_double_symbol (libm, __clogl, clogl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_copysign.c b/sysdeps/ieee754/ldbl-opt/s_copysign.c
index f4303f5768..8d42a181df 100644
--- a/sysdeps/ieee754/ldbl-opt/s_copysign.c
+++ b/sysdeps/ieee754/ldbl-opt/s_copysign.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_copysign.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpow.c b/sysdeps/ieee754/ldbl-opt/s_cpow.c
deleted file mode 100644
index 4801d7cdf9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpow.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cpow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cpow, cpowl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpowl.c b/sysdeps/ieee754/ldbl-opt/s_cpowl.c
deleted file mode 100644
index 61840e3381..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpowl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cpowl.c>
-long_double_symbol (libm, __cpowl, cpowl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cproj.c b/sysdeps/ieee754/ldbl-opt/s_cproj.c
deleted file mode 100644
index f298c3795a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cproj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cproj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cproj, cprojl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cprojl.c b/sysdeps/ieee754/ldbl-opt/s_cprojl.c
deleted file mode 100644
index 1cc058007e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cprojl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cprojl.c>
-long_double_symbol (libm, __cprojl, cprojl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csin.c b/sysdeps/ieee754/ldbl-opt/s_csin.c
deleted file mode 100644
index 7017c95450..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csin, csinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinh.c b/sysdeps/ieee754/ldbl-opt/s_csinh.c
deleted file mode 100644
index a1fa6671db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csinh, csinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinhl.c b/sysdeps/ieee754/ldbl-opt/s_csinhl.c
deleted file mode 100644
index 484d466ce8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinhl.c>
-long_double_symbol (libm, __csinhl, csinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinl.c b/sysdeps/ieee754/ldbl-opt/s_csinl.c
deleted file mode 100644
index f71642e886..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinl.c>
-long_double_symbol (libm, __csinl, csinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrt.c b/sysdeps/ieee754/ldbl-opt/s_csqrt.c
deleted file mode 100644
index 2b6dcfe010..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrt.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csqrt, csqrtl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c b/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
deleted file mode 100644
index 045ff93e43..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csqrtl.c>
-long_double_symbol (libm, __csqrtl, csqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctan.c b/sysdeps/ieee754/ldbl-opt/s_ctan.c
deleted file mode 100644
index a6a21f9f23..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctan, ctanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanh.c b/sysdeps/ieee754/ldbl-opt/s_ctanh.c
deleted file mode 100644
index fd4be129f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctanh, ctanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c b/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
deleted file mode 100644
index f159373b39..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanhl.c>
-long_double_symbol (libm, __ctanhl, ctanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanl.c b/sysdeps/ieee754/ldbl-opt/s_ctanl.c
deleted file mode 100644
index 0c2d94cf49..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanl.c>
-long_double_symbol (libm, __ctanl, ctanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_erf.c b/sysdeps/ieee754/ldbl-opt/s_erf.c
deleted file mode 100644
index 76f1baa5ca..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_erf.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_erf.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __erf, erfl, GLIBC_2_0);
-compat_symbol (libm, __erfc, erfcl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_expm1.c b/sysdeps/ieee754/ldbl-opt/s_expm1.c
deleted file mode 100644
index ef9b5956db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_expm1.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_expm1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __expm1, expm1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fabs.c b/sysdeps/ieee754/ldbl-opt/s_fabs.c
deleted file mode 100644
index e7c92187e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fabs.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdim.c b/sysdeps/ieee754/ldbl-opt/s_fdim.c
deleted file mode 100644
index 02c95bfa81..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdiml.c b/sysdeps/ieee754/ldbl-opt/s_fdiml.c
deleted file mode 100644
index 06b760b7b4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdiml.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fdiml.c>
-long_double_symbol (libm, __fdiml, fdiml);
diff --git a/sysdeps/ieee754/ldbl-opt/s_floor.c b/sysdeps/ieee754/ldbl-opt/s_floor.c
deleted file mode 100644
index 7797944e9e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_floor.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_floor.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fma.c b/sysdeps/ieee754/ldbl-opt/s_fma.c
deleted file mode 100644
index 1723c5c306..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmal.c b/sysdeps/ieee754/ldbl-opt/s_fmal.c
deleted file mode 100644
index bd12dabcbe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmax.c b/sysdeps/ieee754/ldbl-opt/s_fmax.c
deleted file mode 100644
index 11e759121f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmax.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmax.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c b/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
deleted file mode 100644
index 98221b2cdc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmaxl.c>
-long_double_symbol (libm, __fmaxl, fmaxl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmin.c b/sysdeps/ieee754/ldbl-opt/s_fmin.c
deleted file mode 100644
index c3fe44d9d9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fminl.c b/sysdeps/ieee754/ldbl-opt/s_fminl.c
deleted file mode 100644
index 9bfdc7ad79..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fminl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fminl.c>
-long_double_symbol (libm, __fminl, fminl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_frexp.c b/sysdeps/ieee754/ldbl-opt/s_frexp.c
index 0e3a5e0830..b0bfde3093 100644
--- a/sysdeps/ieee754/ldbl-opt/s_frexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_frexp.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_frexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __frexp, frexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __frexp, frexpl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index 20e107be7e..94417193f5 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,9 +1,26 @@
-#include <math_ldbl_opt.h>
-#include <math/s_ldexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+/* ldexp alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math-type-macros-double.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __ldexp, ldexpl, GLIBC_2_0);
+compat_symbol (libc, __wrap_scalbn, scalbnl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index ed87a92b96..8a60b03987 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -1,12 +1,29 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ldexpl.c>
-strong_alias (__ldexpl, __ldexpl_2)
-#if IS_IN (libm)
-long_double_symbol (libm, __ldexpl, ldexpl);
-long_double_symbol (libm, __ldexpl_2, scalbnl);
-#else
+/* ldexpl alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#if IS_IN (libc)
+# define declare_mgen_alias(f,t)
+#endif
+#include <math-type-macros-ldouble.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc)
long_double_symbol (libc, __ldexpl, ldexpl);
-long_double_symbol (libc, __ldexpl_2, scalbnl);
+long_double_symbol (libc, __wrap_scalbnl, scalbnl);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llrint.c b/sysdeps/ieee754/ldbl-opt/s_llrint.c
deleted file mode 100644
index e6311972e1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llround.c b/sysdeps/ieee754/ldbl-opt/s_llround.c
deleted file mode 100644
index 36c7e6edac..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_log1p.c b/sysdeps/ieee754/ldbl-opt/s_log1p.c
deleted file mode 100644
index 495fa32e35..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_log1p.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_log1p.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log1p, log1pl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_logb.c b/sysdeps/ieee754/ldbl-opt/s_logb.c
deleted file mode 100644
index 4d7a6db275..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_logb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_logb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __logb, logbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lrint.c b/sysdeps/ieee754/ldbl-opt/s_lrint.c
deleted file mode 100644
index b7af812846..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lround.c b/sysdeps/ieee754/ldbl-opt/s_lround.c
deleted file mode 100644
index f3a27fa9c9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c
index 93acb43ae6..268a728e9b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_modf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_modf.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_modf.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nan.c b/sysdeps/ieee754/ldbl-opt/s_nan.c
deleted file mode 100644
index 418aad2076..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_nan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nan, nanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nanl.c b/sysdeps/ieee754/ldbl-opt/s_nanl.c
deleted file mode 100644
index 9496e0b5ce..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_nanl.c>
-long_double_symbol (libm, __nanl, nanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_nearbyint.c b/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
deleted file mode 100644
index a8b7973acd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_nearbyint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nextafter.c b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
index 78e2c0ff37..e36ade8202 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nextafter.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
@@ -1,8 +1,5 @@
#include <math_ldbl_opt.h>
#include <math/s_nextafter.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __nextafter, nextafterl, GLIBC_2_0);
-#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
strong_alias (__nextafter, __nexttowardd)
strong_alias (__nextafter, __nexttowardld)
diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
index 07e9375b78..d1cdd54c44 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -31,7 +32,7 @@ float __nldbl_nexttowardf(float x, double y);
float __nldbl_nexttowardf(float x, double y)
{
int32_t hx,hy,ix,iy;
- u_int32_t ly;
+ uint32_t ly;
GET_FLOAT_WORD(hx,x);
EXTRACT_WORDS(hy,ly,y);
@@ -44,7 +45,7 @@ float __nldbl_nexttowardf(float x, double y)
if((double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)(hy&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-opt/s_remquo.c b/sysdeps/ieee754/ldbl-opt/s_remquo.c
deleted file mode 100644
index 9f3d7ba368..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_remquo.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_remquo.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __remquo, remquol, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_rint.c b/sysdeps/ieee754/ldbl-opt/s_rint.c
deleted file mode 100644
index d9b156ea27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_rint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_rint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_round.c b/sysdeps/ieee754/ldbl-opt/s_round.c
deleted file mode 100644
index edff2f017b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_round.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_round.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbln.c b/sysdeps/ieee754/ldbl-opt/s_scalbln.c
deleted file mode 100644
index 391142b769..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbln.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbln.c>
-#if IS_IN (libm)
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1);
-#endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
-compat_symbol (libc, __scalbln, scalblnl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbn.c b/sysdeps/ieee754/ldbl-opt/s_scalbn.c
deleted file mode 100644
index 1ad81b199e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbn.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbn.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __scalbn, scalbnl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significand.c b/sysdeps/ieee754/ldbl-opt/s_significand.c
deleted file mode 100644
index 5287c09066..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significand.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_significand.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __significand, significandl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significandl.c b/sysdeps/ieee754/ldbl-opt/s_significandl.c
deleted file mode 100644
index 9339b4780d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significandl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_significandl.c>
-long_double_symbol (libm, __significandl, significandl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_sin.c b/sysdeps/ieee754/ldbl-opt/s_sin.c
deleted file mode 100644
index 04e60e2731..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sin.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* dbl-64/s_sin.c uses NAN and sincos identifiers internally. */
-#define sincos sincos_disable
-/* These definitions needed for proper unfolding of __MATHDECL_VEC. */
-#define __DECL_SIMD_sincos_disable
-#define __DECL_SIMD_sincos_disablef
-#define __DECL_SIMD_sincos_disablel
-#include <math_ldbl_opt.h>
-#undef NAN
-#undef sincos
-#include <sysdeps/ieee754/dbl-64/s_sin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sin, sinl, GLIBC_2_0);
-compat_symbol (libm, __cos, cosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_sincos.c b/sysdeps/ieee754/ldbl-opt/s_sincos.c
deleted file mode 100644
index 6d2a48f25b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sincos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_sincos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __sincos, sincosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tan.c b/sysdeps/ieee754/ldbl-opt/s_tan.c
deleted file mode 100644
index 6b0fec0063..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, tan, tanl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tanh.c b/sysdeps/ieee754/ldbl-opt/s_tanh.c
deleted file mode 100644
index e763bbde77..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __tanh, tanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_trunc.c b/sysdeps/ieee754/ldbl-opt/s_trunc.c
deleted file mode 100644
index 9d90a2bd73..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_trunc.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_trunc.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
new file mode 100644
index 0000000000..be92325403
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
@@ -0,0 +1 @@
+#include <math/test-narrow-macros.c>
diff --git a/sysdeps/ieee754/ldbl-opt/w_acos.c b/sysdeps/ieee754/ldbl-opt/w_acos.c
deleted file mode 100644
index 2934041d4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acos, acosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosh.c b/sysdeps/ieee754/ldbl-opt/w_acosh.c
deleted file mode 100644
index 7f7fa14e27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acosh, acoshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acoshl.c b/sysdeps/ieee754/ldbl-opt/w_acoshl.c
deleted file mode 100644
index 6243c2ac80..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acoshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acoshl.c>
-long_double_symbol (libm, __acoshl, acoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosl.c b/sysdeps/ieee754/ldbl-opt/w_acosl.c
deleted file mode 100644
index 8b6e890a53..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acosl.c>
-long_double_symbol (libm, __acosl, acosl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_asin.c b/sysdeps/ieee754/ldbl-opt/w_asin.c
deleted file mode 100644
index 5e1d70ff65..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_asin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asin, asinl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_asinl.c b/sysdeps/ieee754/ldbl-opt/w_asinl.c
deleted file mode 100644
index a58a224a38..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asinl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_asinl.c>
-long_double_symbol (libm, __asinl, asinl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2.c b/sysdeps/ieee754/ldbl-opt/w_atan2.c
deleted file mode 100644
index f1d1501bd2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atan2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atan2, atan2l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2l.c b/sysdeps/ieee754/ldbl-opt/w_atan2l.c
deleted file mode 100644
index 01431eff44..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atan2l.c>
-long_double_symbol (libm, __atan2l, atan2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanh.c b/sysdeps/ieee754/ldbl-opt/w_atanh.c
deleted file mode 100644
index b4cab87c32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atanh, atanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanhl.c b/sysdeps/ieee754/ldbl-opt/w_atanhl.c
deleted file mode 100644
index 0dbc114481..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atanhl.c>
-long_double_symbol (libm, __atanhl, atanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_cosh.c b/sysdeps/ieee754/ldbl-opt/w_cosh.c
deleted file mode 100644
index a6f56cf4c5..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_cosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_cosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cosh, coshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_coshl.c b/sysdeps/ieee754/ldbl-opt/w_coshl.c
deleted file mode 100644
index 8c7dccb7f3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_coshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_coshl.c>
-long_double_symbol (libm, __coshl, coshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp.c b/sysdeps/ieee754/ldbl-opt/w_exp.c
deleted file mode 100644
index 61fcfcc9df..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/w_exp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __exp, expl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10.c b/sysdeps/ieee754/ldbl-opt/w_exp10.c
deleted file mode 100644
index 990c48e61a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_exp10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __exp10, exp10l, GLIBC_2_1);
-compat_symbol (libm, __pow10, pow10l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
new file mode 100644
index 0000000000..895411d1ee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
@@ -0,0 +1,8 @@
+#include <math_ldbl_opt.h>
+#include <math/w_exp10_compat.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+strong_alias (__pow10, __pow10_pow10l)
+compat_symbol (libm, __pow10_pow10l, pow10l, GLIBC_2_1);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l.c b/sysdeps/ieee754/ldbl-opt/w_exp10l.c
deleted file mode 100644
index e06dfb5014..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_exp10l.c>
-long_double_symbol (libm, __exp10l, exp10l);
-long_double_symbol (libm, __pow10l, pow10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
new file mode 100644
index 0000000000..4822211189
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
@@ -0,0 +1,17 @@
+#include <math_ldbl_opt.h>
+#undef compat_symbol
+#define compat_symbol(l,n,a,v)
+#include <math/w_exp10l_compat.c>
+#if LIBM_SVID_COMPAT
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+/* compat_symbol was undefined and redefined above to avoid the
+ default pow10l compat symbol at version GLIBC_2_1 (as for ldbl-opt
+ configurations, that version should have the alias to exp10). So
+ it now needs to be redefined to define the compat symbol at version
+ LONG_DOUBLE_COMPAT_VERSION. */
+# undef compat_symbol
+# define compat_symbol(lib, local, symbol, version) \
+ compat_symbol_reference (lib, local, symbol, version)
+compat_symbol (libm, __pow10l, pow10l, LONG_DOUBLE_COMPAT_VERSION);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmod.c b/sysdeps/ieee754/ldbl-opt/w_fmod.c
deleted file mode 100644
index 81ad5057f7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmod.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_fmod.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmod, fmodl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmodl.c b/sysdeps/ieee754/ldbl-opt/w_fmodl.c
deleted file mode 100644
index 2a534a304c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmodl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_fmodl.c>
-long_double_symbol (libm, __fmodl, fmodl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypot.c b/sysdeps/ieee754/ldbl-opt/w_hypot.c
deleted file mode 100644
index e1cf1ffcfe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypot.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_hypot.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __hypot, hypotl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypotl.c b/sysdeps/ieee754/ldbl-opt/w_hypotl.c
deleted file mode 100644
index 6c46bd4bde..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypotl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_hypotl.c>
-long_double_symbol (libm, __hypotl, hypotl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogb.c b/sysdeps/ieee754/ldbl-opt/w_ilogb.c
deleted file mode 100644
index f518087a5f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_ilogb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ilogb, ilogbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c b/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
deleted file mode 100644
index 36f83f6ade..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_ilogbl.c>
-long_double_symbol (libm, __ilogbl, ilogbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0.c b/sysdeps/ieee754/ldbl-opt/w_j0.c
deleted file mode 100644
index 5c78aff085..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j0.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j0, j0l, GLIBC_2_0);
-compat_symbol (libm, y0, y0l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0l.c b/sysdeps/ieee754/ldbl-opt/w_j0l.c
deleted file mode 100644
index 767a1bcada..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j0l.c>
-long_double_symbol (libm, __j0l, j0l);
-long_double_symbol (libm, __y0l, y0l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1.c b/sysdeps/ieee754/ldbl-opt/w_j1.c
deleted file mode 100644
index ed3dbc0361..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j1, j1l, GLIBC_2_0);
-compat_symbol (libm, y1, y1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1l.c b/sysdeps/ieee754/ldbl-opt/w_j1l.c
deleted file mode 100644
index 946c36467c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j1l.c>
-long_double_symbol (libm, __j1l, j1l);
-long_double_symbol (libm, __y1l, y1l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_jn.c b/sysdeps/ieee754/ldbl-opt/w_jn.c
deleted file mode 100644
index 7a7e0d434b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jn.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_jn.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, jn, jnl, GLIBC_2_0);
-compat_symbol (libm, yn, ynl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_jnl.c b/sysdeps/ieee754/ldbl-opt/w_jnl.c
deleted file mode 100644
index 5219543a97..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jnl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_jnl.c>
-long_double_symbol (libm, __jnl, jnl);
-long_double_symbol (libm, __ynl, ynl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
deleted file mode 100644
index eeab6a6b47..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_lgamma_r.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
deleted file mode 100644
index 25459758d7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_lgammal_r.c>
-long_double_symbol (libm, __lgammal_r, lgammal_r);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log.c b/sysdeps/ieee754/ldbl-opt/w_log.c
deleted file mode 100644
index bde1e31db4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log, logl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10.c b/sysdeps/ieee754/ldbl-opt/w_log10.c
deleted file mode 100644
index 74e716821e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log10, log10l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10l.c b/sysdeps/ieee754/ldbl-opt/w_log10l.c
deleted file mode 100644
index 9c936e376a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log10l.c>
-long_double_symbol (libm, __log10l, log10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2.c b/sysdeps/ieee754/ldbl-opt/w_log2.c
deleted file mode 100644
index 9b9b45b21b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __log2, log2l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2l.c b/sysdeps/ieee754/ldbl-opt/w_log2l.c
deleted file mode 100644
index c859682133..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log2l.c>
-long_double_symbol (libm, __log2l, log2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_logl.c b/sysdeps/ieee754/ldbl-opt/w_logl.c
deleted file mode 100644
index c2354a02b9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_logl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_logl.c>
-long_double_symbol (libm, __logl, logl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_pow.c b/sysdeps/ieee754/ldbl-opt/w_pow.c
deleted file mode 100644
index 2d98fb9be4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_pow.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_pow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __pow, powl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_powl.c b/sysdeps/ieee754/ldbl-opt/w_powl.c
deleted file mode 100644
index 85b8927648..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_powl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_powl.c>
-long_double_symbol (libm, __powl, powl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainder.c b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
index dfa7b7f569..8bdea32c02 100644
--- a/sysdeps/ieee754/ldbl-opt/w_remainder.c
+++ b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
@@ -1,7 +1,6 @@
#include <math_ldbl_opt.h>
-#include <math/w_remainder.c>
+#include <math/w_remainder_compat.c>
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __remainder, remainderl, GLIBC_2_0);
strong_alias (__remainder, __drem)
compat_symbol (libm, __drem, dreml, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl.c b/sysdeps/ieee754/ldbl-opt/w_remainderl.c
deleted file mode 100644
index 7a344b7709..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_remainderl.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_remainderl.c>
-long_double_symbol (libm, __remainderl, remainderl);
-strong_alias (__remainderl, __dreml)
-long_double_symbol (libm, __dreml, dreml);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
new file mode 100644
index 0000000000..2579600aa2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
@@ -0,0 +1,19 @@
+#include <math_ldbl_opt.h>
+#undef weak_alias
+#define weak_alias(n,a)
+#include <math/w_remainderl_compat.c>
+#if LIBM_SVID_COMPAT
+/* If ldbl-opt is used without special versioning for remainderl being
+ required, the generic code does not define remainderl because of
+ the undefine and redefine of weak_alias above. In any case, that
+ undefine and redefine mean _FloatN / _FloatNx aliases have not been
+ defined. */
+# undef weak_alias
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# if !LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+weak_alias (__remainderl, remainderl)
+# endif
+strong_alias (__remainderl, __dreml)
+long_double_symbol (libm, __dreml, dreml);
+libm_alias_ldouble_other (__remainder, remainder)
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalb.c b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
index e2ac601596..f6d53a5ba5 100644
--- a/sysdeps/ieee754/ldbl-opt/w_scalb.c
+++ b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
@@ -1,5 +1,5 @@
#include <math_ldbl_opt.h>
-#include <math/w_scalb.c>
+#include <math/w_scalb_compat.c>
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
compat_symbol (libm, __scalb, scalbl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbl.c b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
index f3d3901f86..c8feb654a2 100644
--- a/sysdeps/ieee754/ldbl-opt/w_scalbl.c
+++ b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
@@ -1,5 +1,5 @@
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
-#include <math/w_scalbl.c>
+#include <math/w_scalbl_compat.c>
long_double_symbol (libm, __scalbl, scalbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinh.c b/sysdeps/ieee754/ldbl-opt/w_sinh.c
deleted file mode 100644
index a5400b5eb1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sinh, sinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinhl.c b/sysdeps/ieee754/ldbl-opt/w_sinhl.c
deleted file mode 100644
index b94f4ec845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sinhl.c>
-long_double_symbol (libm, __sinhl, sinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrt.c b/sysdeps/ieee754/ldbl-opt/w_sqrt.c
deleted file mode 100644
index ca2ba061e8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c b/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
deleted file mode 100644
index 609f5bf3d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sqrtl.c>
-long_double_symbol (libm, __sqrtl, sqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgamma.c b/sysdeps/ieee754/ldbl-opt/w_tgamma.c
deleted file mode 100644
index cce9f348ed..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgamma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_tgamma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __tgamma, tgammal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgammal.c b/sysdeps/ieee754/ldbl-opt/w_tgammal.c
deleted file mode 100644
index c3c511db8c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgammal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_tgammal.c>
-long_double_symbol (libm, __tgammal, tgammal);
diff --git a/sysdeps/ieee754/s_lib_version.c b/sysdeps/ieee754/s_lib_version.c
index bb59300953..40f708d82d 100644
--- a/sysdeps/ieee754/s_lib_version.c
+++ b/sysdeps/ieee754/s_lib_version.c
@@ -18,24 +18,13 @@ static char rcsid[] = "$NetBSD: s_lib_version.c,v 1.6 1995/05/10 20:47:44 jtc Ex
* MACRO for standards
*/
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
/*
* define and initialize _LIB_VERSION
*/
-#ifdef _POSIX_MODE
+#undef _LIB_VERSION
+#if LIBM_SVID_COMPAT
_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _POSIX_;
-#else
-#ifdef _XOPEN_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _XOPEN_;
-#else
-#ifdef _SVID3_MODE
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _SVID_;
-#else /* default _IEEE_MODE */
-_LIB_VERSION_TYPE _LIB_VERSION_INTERNAL = _IEEE_;
+compat_symbol (libm, _LIB_VERSION_INTERNAL, _LIB_VERSION, GLIBC_2_0);
#endif
-#endif
-#endif
-
-weak_alias (_LIB_VERSION_INTERNAL, _LIB_VERSION)
diff --git a/sysdeps/ieee754/s_matherr.c b/sysdeps/ieee754/s_matherr.c
index d5dc6f122d..5eacdd51c6 100644
--- a/sysdeps/ieee754/s_matherr.c
+++ b/sysdeps/ieee754/s_matherr.c
@@ -14,9 +14,10 @@
static char rcsid[] = "$NetBSD: s_matherr.c,v 1.6 1995/05/10 20:47:53 jtc Exp $";
#endif
-#include <math.h>
-#include <math_private.h>
+#include <math-svid-compat.h>
+#undef matherr
+#if LIBM_SVID_COMPAT
int
weak_function
__matherr(struct exception *x)
@@ -25,4 +26,5 @@ __matherr(struct exception *x)
if(x->arg1!=x->arg1) return 0;
return n;
}
-weak_alias (__matherr, matherr)
+compat_symbol (libm, __matherr, matherr, GLIBC_2_0);
+#endif
diff --git a/sysdeps/ieee754/soft-fp/Makefile b/sysdeps/ieee754/soft-fp/Makefile
new file mode 100644
index 0000000000..ada13e8b70
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+CPPFLAGS += -I../soft-fp
+endif
diff --git a/sysdeps/ieee754/soft-fp/s_daddl.c b/sysdeps/ieee754/soft-fp/s_daddl.c
new file mode 100644
index 0000000000..efe3772413
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_daddl.c
@@ -0,0 +1,59 @@
+/* Add long double (ldbl-128) values, narrowing the result to double,
+ using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xaddf64x __hide_f32xaddf64x
+#define f32xaddf128 __hide_f32xaddf128
+#define f64addf64x __hide_f64addf64x
+#define f64addf128 __hide_f64addf128
+#include <math.h>
+#undef f32xaddf64x
+#undef f32xaddf128
+#undef f64addf64x
+#undef f64addf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__daddl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_ADD_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (add)
diff --git a/sysdeps/ieee754/soft-fp/s_ddivl.c b/sysdeps/ieee754/soft-fp/s_ddivl.c
new file mode 100644
index 0000000000..7e598a2132
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_ddivl.c
@@ -0,0 +1,59 @@
+/* Divide long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xdivf64x __hide_f32xdivf64x
+#define f32xdivf128 __hide_f32xdivf128
+#define f64divf64x __hide_f64divf64x
+#define f64divf128 __hide_f64divf128
+#include <math.h>
+#undef f32xdivf64x
+#undef f32xdivf128
+#undef f64divf64x
+#undef f64divf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__ddivl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_DIV_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (div)
diff --git a/sysdeps/ieee754/soft-fp/s_dmull.c b/sysdeps/ieee754/soft-fp/s_dmull.c
new file mode 100644
index 0000000000..4ebf31140b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_dmull.c
@@ -0,0 +1,59 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xmulf64x __hide_f32xmulf64x
+#define f32xmulf128 __hide_f32xmulf128
+#define f64mulf64x __hide_f64mulf64x
+#define f64mulf128 __hide_f64mulf128
+#include <math.h>
+#undef f32xmulf64x
+#undef f32xmulf128
+#undef f64mulf64x
+#undef f64mulf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__dmull (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_MUL_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_dsubl.c b/sysdeps/ieee754/soft-fp/s_dsubl.c
new file mode 100644
index 0000000000..52f489c6ed
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_dsubl.c
@@ -0,0 +1,59 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to
+ double, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32xsubf64x __hide_f32xsubf64x
+#define f32xsubf128 __hide_f32xsubf128
+#define f64subf64x __hide_f64subf64x
+#define f64subf128 __hide_f64subf128
+#include <math.h>
+#undef f32xsubf64x
+#undef f32xsubf128
+#undef f64subf64x
+#undef f64subf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <double.h>
+#include <quad.h>
+
+double
+__dsubl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_D (RN);
+ double ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_SUB_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (D, Q, 2, 4, RN, R);
+#else
+ FP_TRUNC (D, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_D (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_double_ldouble (sub)
diff --git a/sysdeps/ieee754/soft-fp/s_fadd.c b/sysdeps/ieee754/soft-fp/s_fadd.c
new file mode 100644
index 0000000000..606e527300
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fadd.c
@@ -0,0 +1,56 @@
+/* Add double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32addf64 __hide_f32addf64
+#define f32addf32x __hide_f32addf32x
+#define faddl __hide_faddl
+#include <math.h>
+#undef f32addf64
+#undef f32addf32x
+#undef faddl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fadd (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_D (X, x);
+ FP_UNPACK_SEMIRAW_D (Y, y);
+ FP_ADD_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (add)
diff --git a/sysdeps/ieee754/soft-fp/s_faddl.c b/sysdeps/ieee754/soft-fp/s_faddl.c
new file mode 100644
index 0000000000..42c4422060
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_faddl.c
@@ -0,0 +1,55 @@
+/* Add long double (ldbl-128) values, narrowing the result to float,
+ using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32addf64x __hide_f32addf64x
+#define f32addf128 __hide_f32addf128
+#include <math.h>
+#undef f32addf64x
+#undef f32addf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__faddl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_ADD_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_ADD (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (add)
diff --git a/sysdeps/ieee754/soft-fp/s_fdiv.c b/sysdeps/ieee754/soft-fp/s_fdiv.c
new file mode 100644
index 0000000000..341339f5ed
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fdiv.c
@@ -0,0 +1,56 @@
+/* Divide double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32divf64 __hide_f32divf64
+#define f32divf32x __hide_f32divf32x
+#define fdivl __hide_fdivl
+#include <math.h>
+#undef f32divf64
+#undef f32divf32x
+#undef fdivl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fdiv (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (X, x);
+ FP_UNPACK_D (Y, y);
+ FP_DIV_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC_COOKED (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC_COOKED (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (div)
diff --git a/sysdeps/ieee754/soft-fp/s_fdivl.c b/sysdeps/ieee754/soft-fp/s_fdivl.c
new file mode 100644
index 0000000000..7fb3709c73
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fdivl.c
@@ -0,0 +1,55 @@
+/* Divide long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32divf64x __hide_f32divf64x
+#define f32divf128 __hide_f32divf128
+#include <math.h>
+#undef f32divf64x
+#undef f32divf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fdivl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_DIV_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (div)
diff --git a/sysdeps/ieee754/soft-fp/s_fma.c b/sysdeps/ieee754/soft-fp/s_fma.c
new file mode 100644
index 0000000000..41cf81a74b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fma.c
@@ -0,0 +1,68 @@
+/* Implement fma using soft-fp.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <libc-diag.h>
+#include <libm-alias-double.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "double.h"
+
+double
+__fma (double a, double b, double c)
+{
+ FP_DECL_EX;
+ FP_DECL_D (A);
+ FP_DECL_D (B);
+ FP_DECL_D (C);
+ FP_DECL_D (R);
+ double r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (A, a);
+ FP_UNPACK_D (B, b);
+ FP_UNPACK_D (C, c);
+ FP_FMA_D (R, A, B, C);
+ FP_PACK_D (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+#ifndef __fma
+libm_alias_double (__fma, fma)
+#endif
diff --git a/sysdeps/ieee754/soft-fp/s_fmaf.c b/sysdeps/ieee754/soft-fp/s_fmaf.c
new file mode 100644
index 0000000000..afe64356b3
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmaf.c
@@ -0,0 +1,68 @@
+/* Implement fmaf using soft-fp.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <libc-diag.h>
+#include <libm-alias-float.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "single.h"
+
+float
+__fmaf (float a, float b, float c)
+{
+ FP_DECL_EX;
+ FP_DECL_S (A);
+ FP_DECL_S (B);
+ FP_DECL_S (C);
+ FP_DECL_S (R);
+ float r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_S (A, a);
+ FP_UNPACK_S (B, b);
+ FP_UNPACK_S (C, c);
+ FP_FMA_S (R, A, B, C);
+ FP_PACK_S (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+#ifndef __fmaf
+libm_alias_float (__fma, fma)
+#endif
diff --git a/sysdeps/ieee754/soft-fp/s_fmal.c b/sysdeps/ieee754/soft-fp/s_fmal.c
new file mode 100644
index 0000000000..4c2d4c5d9b
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmal.c
@@ -0,0 +1,66 @@
+/* Implement fmal using soft-fp.
+ Copyright (C) 2013-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <libc-diag.h>
+#include <libm-alias-ldouble.h>
+
+/* R_e is not set in cases where it is not used in packing, but the
+ compiler does not see that it is set in all cases where it is
+ used, resulting in warnings that it may be used uninitialized.
+ The location of the warning differs in different versions of GCC,
+ it may be where R is defined using a macro or it may be where the
+ macro is defined. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
+
+#include "soft-fp.h"
+#include "quad.h"
+
+long double
+__fmal (long double a, long double b, long double c)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (A);
+ FP_DECL_Q (B);
+ FP_DECL_Q (C);
+ FP_DECL_Q (R);
+ long double r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (A, a);
+ FP_UNPACK_Q (B, b);
+ FP_UNPACK_Q (C, c);
+ FP_FMA_Q (R, A, B, C);
+ FP_PACK_Q (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+DIAG_POP_NEEDS_COMMENT;
+
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/soft-fp/s_fmul.c b/sysdeps/ieee754/soft-fp/s_fmul.c
new file mode 100644
index 0000000000..5f679b1d45
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmul.c
@@ -0,0 +1,56 @@
+/* Multiply double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32mulf64 __hide_f32mulf64
+#define f32mulf32x __hide_f32mulf32x
+#define fmull __hide_fmull
+#include <math.h>
+#undef f32mulf64
+#undef f32mulf32x
+#undef fmull
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fmul (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (X, x);
+ FP_UNPACK_D (Y, y);
+ FP_MUL_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC_COOKED (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC_COOKED (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_fmull.c b/sysdeps/ieee754/soft-fp/s_fmull.c
new file mode 100644
index 0000000000..da4a12c8ec
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fmull.c
@@ -0,0 +1,55 @@
+/* Multiply long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32mulf64x __hide_f32mulf64x
+#define f32mulf128 __hide_f32mulf128
+#include <math.h>
+#undef f32mulf64x
+#undef f32mulf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fmull (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_Q (X, x);
+ FP_UNPACK_Q (Y, y);
+ FP_MUL_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC_COOKED (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC_COOKED (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_MUL (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (mul)
diff --git a/sysdeps/ieee754/soft-fp/s_fsub.c b/sysdeps/ieee754/soft-fp/s_fsub.c
new file mode 100644
index 0000000000..824a3abbc7
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fsub.c
@@ -0,0 +1,56 @@
+/* Subtract double values, narrowing the result to float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32subf64 __hide_f32subf64
+#define f32subf32x __hide_f32subf32x
+#define fsubl __hide_fsubl
+#include <math.h>
+#undef f32subf64
+#undef f32subf32x
+#undef fsubl
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <double.h>
+
+float
+__fsub (double x, double y)
+{
+ FP_DECL_EX;
+ FP_DECL_D (X);
+ FP_DECL_D (Y);
+ FP_DECL_D (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_D (X, x);
+ FP_UNPACK_SEMIRAW_D (Y, y);
+ FP_SUB_D (R, X, Y);
+#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
+ FP_TRUNC (S, D, 1, 2, RN, R);
+#else
+ FP_TRUNC (S, D, 1, 1, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_float_double (sub)
diff --git a/sysdeps/ieee754/soft-fp/s_fsubl.c b/sysdeps/ieee754/soft-fp/s_fsubl.c
new file mode 100644
index 0000000000..84b1013797
--- /dev/null
+++ b/sysdeps/ieee754/soft-fp/s_fsubl.c
@@ -0,0 +1,55 @@
+/* Subtract long double (ldbl-128) values, narrowing the result to
+ float, using soft-fp.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define f32subf64x __hide_f32subf64x
+#define f32subf128 __hide_f32subf128
+#include <math.h>
+#undef f32subf64x
+#undef f32subf128
+
+#include <math-narrow.h>
+#include <soft-fp.h>
+#include <single.h>
+#include <quad.h>
+
+float
+__fsubl (_Float128 x, _Float128 y)
+{
+ FP_DECL_EX;
+ FP_DECL_Q (X);
+ FP_DECL_Q (Y);
+ FP_DECL_Q (R);
+ FP_DECL_S (RN);
+ float ret;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_SEMIRAW_Q (X, x);
+ FP_UNPACK_SEMIRAW_Q (Y, y);
+ FP_SUB_Q (R, X, Y);
+#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
+ FP_TRUNC (S, Q, 1, 4, RN, R);
+#else
+ FP_TRUNC (S, Q, 1, 2, RN, R);
+#endif
+ FP_PACK_SEMIRAW_S (ret, RN);
+ FP_HANDLE_EXCEPTIONS;
+ CHECK_NARROW_SUB (ret, x, y);
+ return ret;
+}
+libm_alias_float_ldouble (sub)