mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Optimize libm
libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized.
This commit is contained in:
parent
a843a204a3
commit
0ac5ae2335
286
ChangeLog
286
ChangeLog
@ -1,3 +1,289 @@
|
||||
2011-10-12 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
Add integration with gcc's -ffinite-math-only and optimize wrapper
|
||||
functions in libm.
|
||||
* Versions.def: Define GLIBC_2.15 version for libm.
|
||||
* math/Makefile (headers): Add bits/math-finite.h.
|
||||
* math/bits/math-finite.h: New file.
|
||||
* sysdeps/ia64/fpu/bits/math-finite.h: New file.
|
||||
* math/Versions [libm] (GLIBC_2.15): Export __*_finite symbols.
|
||||
* math/e_acoshl.c: Add __*_finite alias.
|
||||
* math/e_acosl.c: Likewise.
|
||||
* math/e_asinl.c: Likewise.
|
||||
* math/e_atan2l.c: Likewise.
|
||||
* math/e_atanhl.c: Likewise.
|
||||
* math/e_coshl.c: Likewise.
|
||||
* math/e_exp10.c: Likewise.
|
||||
* math/e_exp10f.c: Likewise.
|
||||
* math/e_exp10l.c: Likewise.
|
||||
* math/e_exp2l.c: Likewise.
|
||||
* math/e_fmodl.c: Likewise.
|
||||
* math/e_gammal_r.c: Likewise.
|
||||
* math/e_hypotl.c: Likewise.
|
||||
* math/e_j0l.c: Likewise.
|
||||
* math/e_j1l.c: Likewise.
|
||||
* math/e_jnl.c: Likewise.
|
||||
* math/e_lgammal_r.c: Likewise.
|
||||
* math/e_log10l.c: Likewise.
|
||||
* math/e_log2l.c: Likewise.
|
||||
* math/e_logl.c: Likewise.
|
||||
* math/e_powl.c: Likewise.
|
||||
* math/e_sinhl.c: Likewise.
|
||||
* math/e_sqrtl.c: Likewise.
|
||||
* math/e_scalb.c: Completely rewritten and optimized.
|
||||
* math/e_scalbf.c: Likewise.
|
||||
* math/e_scalbl.c: Likewise.
|
||||
* math/w_acos.c: Likewise.
|
||||
* math/w_acosf.c: Likewise.
|
||||
* math/w_acosl.c: Likewise.
|
||||
* math/w_acosh.c: Likewise.
|
||||
* math/w_acoshf.c: Likewise.
|
||||
* math/w_acoshl.c: Likewise.
|
||||
* math/w_asin.c: Likewise.
|
||||
* math/w_asinf.c: Likewise.
|
||||
* math/w_asinl.c: Likewise.
|
||||
* math/w_atan2.c: Likewise.
|
||||
* math/w_atan2f.c: Likewise.
|
||||
* math/w_atan2l.c: Likewise.
|
||||
* math/w_atanh.c: Likewise.
|
||||
* math/w_atanhf.c: Likewise.
|
||||
* math/w_atanhl.c: Likewise.
|
||||
* math/w_exp10.c: Likewise.
|
||||
* math/w_exp10f.c: Likewise.
|
||||
* math/w_exp10l.c: Likewise.
|
||||
* math/w_fmod.c: Likewise.
|
||||
* math/w_fmodf.c: Likewise.
|
||||
* math/w_fmodl.c: Likewise.
|
||||
* math/w_j0.c: Likewise.
|
||||
* math/w_j0f.c: Likewise.
|
||||
* math/w_j0l.c: Likewise.
|
||||
* math/w_j1.c: Likewise.
|
||||
* math/w_j1f.c: Likewise.
|
||||
* math/w_j1l.c: Likewise.
|
||||
* math/w_jn.c: Likewise.
|
||||
* math/w_jnf.c: Likewise.
|
||||
* math/w_log.c: Likewise.
|
||||
* math/w_logf.c: Likewise.
|
||||
* math/w_logl.c: Likewise.
|
||||
* math/w_log10.c: Likewise.
|
||||
* math/w_log10f.c: Likewise.
|
||||
* math/w_log10l.c: Likewise.
|
||||
* math/w_log2.c: Likewise.
|
||||
* math/w_log2f.c: Likewise.
|
||||
* math/w_log2l.c: Likewise.
|
||||
* math/w_pow.c: Likewise.
|
||||
* math/w_powf.c: Likewise.
|
||||
* math/w_powl.c: Likewise.
|
||||
* math/w_remainder.c: Likewise.
|
||||
* math/w_remainderf.c: Likewise.
|
||||
* math/w_remainderl.c: Likewise.
|
||||
* math/w_scalb.c: Likewise.
|
||||
* math/w_scalbf.c: Likewise.
|
||||
* math/w_scalbl.c: Likewise.
|
||||
* math/w_sqrt.c: Likewise.
|
||||
* math/w_sqrtf.c: Likewise.
|
||||
* math/w_sqrtl.c: Likewise.
|
||||
* math/math.h: Define __MATH_DECLARE_LDOUBLE if long double functions
|
||||
are declared. Include <bits/math-finite.h> if -ffinite-math-only is
|
||||
used.
|
||||
* math/math_private.h: Declare __kernel_standard_f.
|
||||
* math/w_cosh.c: Remove cruft and optimize a bit.
|
||||
* math/w_coshf.c: Likewise.
|
||||
* math/w_coshl.c: Likewise.
|
||||
* math/w_exp2.c: Likewise.
|
||||
* math/w_exp2f.c: Likewise.
|
||||
* math/w_exp2l.c: Likewise.
|
||||
* math/w_hypot.c: Likewise.
|
||||
* math/w_hypotf.c: Likewise.
|
||||
* math/w_hypotl.c: Likewise.
|
||||
* math/w_lgamma.c: Likewise.
|
||||
* math/w_lgamma_r.c: Likewise.
|
||||
* math/w_lgammaf.c: Likewise.
|
||||
* math/w_lgammaf_r.c: Likewise.
|
||||
* math/w_lgammal.c: Likewise.
|
||||
* math/w_lgammal_r.c: Likewise.
|
||||
* math/w_sinh.c: Likewise.
|
||||
* math/w_sinhf.c: Likewise.
|
||||
* math/w_sinhl.c: Likewise.
|
||||
* math/w_tgamma.c: Likewise.
|
||||
* math/w_tgammaf.c: Likewise.
|
||||
* math/w_tgammal.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_atanh.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_atanhf.c: Likewise.
|
||||
* sysdeps/i386/fpu/e_acos.S: Add __*_finite alias.
|
||||
Minor optimizations. Pretty printing. Remove cruft.
|
||||
* sysdeps/i386/fpu/e_acosf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_acosh.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_acoshf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_acoshl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_acosl.c: Likewise.
|
||||
* sysdeps/i386/fpu/e_asin.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_asinf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_atan2.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_atan2f.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_atan2l.c: Likewise.
|
||||
* sysdeps/i386/fpu/e_atanh.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_atanhf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_atanhl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp10.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp10f.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp10l.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp2.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp2f.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_exp2l.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_fmod.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_fmodf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_fmodl.c: Likewise.
|
||||
* sysdeps/i386/fpu/e_hypot.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_hypotf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log10.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log10f.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log10l.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log2.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log2f.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_log2l.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_logf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_logl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_pow.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_powf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_powl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_remainder.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_remainderf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_remainderl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_scalb.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_scalbf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_scalbl.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_sqrt.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_sqrtf.S: Likewise.
|
||||
* sysdeps/i386/fpu/e_sqrtl.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_acosh.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_cosh.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_exp2.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_fmod.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_gamma_r.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_hypot.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_j0.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_j1.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_jn.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_lgamma_r.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_log.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_log10.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_log2.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_sinh.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
|
||||
* sysdeps/ieee754/dbl-64/s_asinh.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_acosf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_acoshf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_asinf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_atan2f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_coshf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_exp2f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_fmodf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_gammaf_r.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_hypotf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_j0f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_j1f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_jnf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_lgammaf_r.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_log10f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_log2f.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_logf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_powf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_remainderf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_sinhf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/e_sqrtf.c: Likewise.
|
||||
* sysdeps/ieee754/flt-32/s_asinhf.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_acoshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_acosl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_asinl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_atan2l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_atanhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_coshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_fmodl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_gammal_r.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_hypotl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_j0l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_log10l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_log2l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_logl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_powl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_remainderl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/e_sinhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_acosl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_asinl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_atan2l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_atanhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_coshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_fmodl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_hypotl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_log10l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_log2l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_logl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_powl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_sinhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_acoshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_asinl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_atan2l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_atanhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_coshl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_gammal_r.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_hypotl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_j1l.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_remainderl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/e_sinhl.c: Likewise.
|
||||
* sysdeps/ieee754/ldbl-96/s_asinhl.c: Likewise.
|
||||
* sysdeps/powerpc/fpu/e_hypot.c: Likewise.
|
||||
* sysdeps/powerpc/fpu/e_hypotf.c: Likewise.
|
||||
* sysdeps/powerpc/fpu/e_sqrt.c: Likewise.
|
||||
* sysdeps/powerpc/fpu/e_sqrtf.c: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/fpu/e_sqrt.c: Likewise.
|
||||
* sysdeps/powerpc/powerpc64/fpu/e_sqrtf.c: Likewise.
|
||||
* sysdeps/s390/fpu/e_sqrt.c: Likewise.
|
||||
* sysdeps/s390/fpu/e_sqrtf.c: Likewise.
|
||||
* sysdeps/s390/fpu/e_sqrtl.c: Likewise.
|
||||
* sysdeps/sparc/sparc32/e_sqrt.c: Likewise.
|
||||
* sysdeps/sparc/sparc64/fpu/e_sqrtl.c: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_exp2l.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_fmodl.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_log10l.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_log2l.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_logl.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_powl.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_remainderl.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_scalbl.S: Likewise.
|
||||
* sysdeps/x86_64/fpu/e_sqrt.c: Likewise. Fix parameter order
|
||||
* sysdeps/x86_64/fpu/e_sqrtf.c: Likewise.
|
||||
* sysdeps/x86_64/fpu/math_private.h (__isnan): Cast d parameter.
|
||||
(__isnanf): Likewise.
|
||||
(__isinf_ns): Likewise.
|
||||
(__isinf_nsf): Likewise.
|
||||
(__finite): Likewise.
|
||||
(__finitef): Likewise.
|
||||
(__ieee754_sqrt): Define as macro.
|
||||
(__ieee754_sqrtf): Define as macro.
|
||||
(__ieee754_sqrtl): Define as macro.
|
||||
* sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Add partially
|
||||
inlined copy.
|
||||
* sysdeps/x86_64/fpu/bits/mathinline.h: Make use of
|
||||
__FINITE_MATH_ONLY__ consistent.
|
||||
* sysdeps/ieee754/k_standard.c (__kernel_standard_f): New function.
|
||||
|
||||
2011-10-10 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* inet/getnetgrent_r.c (nscd_getnetgrent): Use __rawmemchr instead
|
||||
|
5
NEWS
5
NEWS
@ -1,4 +1,4 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 2011-10-8
|
||||
GNU C Library NEWS -- history of user-visible changes. 2011-10-12
|
||||
Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
@ -44,6 +44,9 @@ Version 2.15
|
||||
|
||||
* nscd now also caches the netgroup database.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
* Integrate libm with gcc's -ffinite-math-only option.
|
||||
Implemented by Ulrich Drepper.
|
||||
|
||||
Version 2.14
|
||||
|
||||
|
@ -54,6 +54,7 @@ libm {
|
||||
GLIBC_2.2.3
|
||||
GLIBC_2.3.4
|
||||
GLIBC_2.4
|
||||
GLIBC_2.15
|
||||
}
|
||||
libnsl {
|
||||
GLIBC_2.0
|
||||
|
@ -1,5 +1,4 @@
|
||||
# Copyright (C) 1996-2001,2002,2003,2004,2005,2006,2011
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2006,2011 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -25,7 +24,8 @@ subdir := math
|
||||
headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
|
||||
bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
|
||||
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
|
||||
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h
|
||||
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
|
||||
bits/math-finite.h
|
||||
|
||||
# Internal header files.
|
||||
distribute := math_ldbl.h math_private.h machine/asm.h
|
||||
|
@ -168,4 +168,33 @@ libm {
|
||||
# puts exp2l in GLIBC_2.1, which will override this entry.
|
||||
exp2l;
|
||||
}
|
||||
GLIBC_2.15 {
|
||||
# Optimized -ffinite-math-only entry points
|
||||
__acos_finite; __acosf_finite; __acosl_finite;
|
||||
__acosh_finite; __acoshf_finite; __acoshl_finite;
|
||||
__asin_finite; __asinf_finite; __asinl_finite;
|
||||
__atan2_finite; __atan2f_finite; __atan2l_finite;
|
||||
__atanh_finite; __atanhf_finite; __atanhl_finite;
|
||||
__cosh_finite; __coshf_finite; __coshl_finite;
|
||||
__exp10_finite; __exp10f_finite; __exp10l_finite;
|
||||
__exp2_finite; __exp2f_finite; __exp2l_finite;
|
||||
__fmod_finite; __fmodf_finite; __fmodl_finite;
|
||||
__hypot_finite; __hypotf_finite; __hypotl_finite;
|
||||
__j0_finite; __j0f_finite; __j0l_finite;
|
||||
__y0_finite; __y0f_finite; __y0l_finite;
|
||||
__j1_finite; __j1f_finite; __j1l_finite;
|
||||
__y1_finite; __y1f_finite; __y1l_finite;
|
||||
__jn_finite; __jnf_finite; __jnl_finite;
|
||||
__yn_finite; __ynf_finite; __ynl_finite;
|
||||
__lgamma_r_finite; __lgammaf_r_finite; __lgammal_r_finite;
|
||||
__log_finite; __logf_finite; __logl_finite;
|
||||
__log10_finite; __log10f_finite; __log10l_finite;
|
||||
__log2_finite; __log2f_finite; __log2l_finite;
|
||||
__pow_finite; __powf_finite; __powl_finite;
|
||||
__remainder_finite; __remainderf_finite; __remainderl_finite;
|
||||
__scalb_finite; __scalbf_finite; __scalbl_finite;
|
||||
__sinh_finite; __sinhf_finite; __sinhl_finite;
|
||||
__sqrt_finite; __sqrtf_finite; __sqrtl_finite;
|
||||
__gamma_r_finite; __gammaf_r_finite; __gammal_r_finite;
|
||||
}
|
||||
}
|
||||
|
315
math/bits/math-finite.h
Normal file
315
math/bits/math-finite.h
Normal file
@ -0,0 +1,315 @@
|
||||
/* Entry points to finite-math-only compiler runs.
|
||||
Copyright (C) 2011 Free Software 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _MATH_H
|
||||
# error "Never use <bits/math-finite.h> directly; include <math.h> instead."
|
||||
#endif
|
||||
|
||||
/* acos. */
|
||||
extern double acos (double) __asm__ ("__acos_finite");
|
||||
extern float acosf (float) __asm__ ("__acosf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double acosl (long double) __asm__ ("__acosl_finite");
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* acosh. */
|
||||
extern double acosh (double) __asm__ ("__acosh_finite");
|
||||
extern float acoshf (float) __asm__ ("__acoshf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double acoshl (long double) __asm__ ("__acoshl_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* asin. */
|
||||
extern double asin (double) __asm__ ("__asin_finite");
|
||||
extern float asinf (float) __asm__ ("__asinf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double asinl (long double) __asm__ ("__asinl_finite");
|
||||
#endif
|
||||
|
||||
/* atan2. */
|
||||
extern double atan2 (double, double) __asm__ ("__atan2_finite");
|
||||
extern float atan2f (float, float) __asm__ ("__atan2f_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double atan2l (long double, long double) __asm__ ("__atan2l_finite");
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
|
||||
/* atanh. */
|
||||
extern double atanh (double) __asm__ ("__atanh_finite");
|
||||
extern float atanhf (float) __asm__ ("__atanhf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double atanhl (long double) __asm__ ("__atanhl_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* cosh. */
|
||||
extern double cosh (double) __asm__ ("__cosh_finite");
|
||||
extern float coshf (float) __asm__ ("__coshf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double coshl (long double) __asm__ ("__coshl_finite");
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* exp10. */
|
||||
extern double exp10 (double) __asm__ ("__exp10_finite");
|
||||
extern float exp10f (float) __asm__ ("__exp10f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double exp10l (long double) __asm__ ("__exp10l_finite");
|
||||
# endif
|
||||
|
||||
/* pow10. */
|
||||
extern double pow10 (double) __asm__ ("__exp10_finite");
|
||||
extern float pow10f (float) __asm__ ("__exp10f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double pow10l (long double) __asm__ ("__exp10l_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* exp2. */
|
||||
extern double exp2 (double) __asm__ ("__exp2_finite");
|
||||
extern float exp2f (float) __asm__ ("__exp2f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double exp2l (long double) __asm__ ("__exp2l_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* fmod. */
|
||||
extern double fmod (double, double) __asm__ ("__fmod_finite");
|
||||
extern float fmodf (float, float) __asm__ ("__fmodf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double fmodl (long double, long double) __asm__ ("__fmodl_finite");
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* hypot. */
|
||||
extern double hypot (double, double) __asm__ ("__hypot_finite");
|
||||
extern float hypotf (float, float) __asm__ ("__hypotf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double hypotl (long double, long double) __asm__ ("__hypotl_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN
|
||||
/* j0. */
|
||||
extern double j0 (double) __asm__ ("__j0_finite");
|
||||
extern float j0f (float) __asm__ ("__j0f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double j0l (long double) __asm__ ("__j0l_finite");
|
||||
# endif
|
||||
|
||||
/* y0. */
|
||||
extern double y0 (double) __asm__ ("__y0_finite");
|
||||
extern float y0f (float) __asm__ ("__y0f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double y0l (long double) __asm__ ("__y0l_finite");
|
||||
# endif
|
||||
|
||||
/* j1. */
|
||||
extern double j1 (double) __asm__ ("__j1_finite");
|
||||
extern float j1f (float) __asm__ ("__j1f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double j1l (long double) __asm__ ("__j1l_finite");
|
||||
# endif
|
||||
|
||||
/* y1. */
|
||||
extern double y1 (double) __asm__ ("__y1_finite");
|
||||
extern float y1f (float) __asm__ ("__y1f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double y1l (long double) __asm__ ("__y1l_finite");
|
||||
# endif
|
||||
|
||||
/* jn. */
|
||||
extern double jn (int, double) __asm__ ("__jn_finite");
|
||||
extern float jnf (int, float) __asm__ ("__jnf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double jnl (int, long double) __asm__ ("__jnl_finite");
|
||||
# endif
|
||||
|
||||
/* yn. */
|
||||
extern double yn (int, double) __asm__ ("__yn_finite");
|
||||
extern float ynf (int, float) __asm__ ("__ynf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double ynl (int, long double) __asm__ ("__ynl_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* lgamma_r. */
|
||||
extern double lgamma_r (double, int *) __asm__ ("__lgamma_r_finite");
|
||||
extern float lgammaf_r (float, int *) __asm__ ("__lgammaf_r_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double lgammal_r (long double, int *) __asm__ ("__lgammal_r_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
|
||||
/* lgamma. */
|
||||
__extern_always_inline double lgamma (double __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgamma_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgamma_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
__extern_always_inline float lgammaf (float __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgammaf_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgammaf_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
__extern_always_inline long double lgammal (long double __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgammal_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgammal_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN
|
||||
/* gamma. */
|
||||
__extern_always_inline double gamma (double __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgamma_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgamma_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
__extern_always_inline float gammaf (float __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgammaf_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgammaf_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
__extern_always_inline long double gammal (long double __d)
|
||||
{
|
||||
# ifdef __USE_ISOC99
|
||||
int __local_signgam = 0;
|
||||
return lgammal_r (__d, &__local_signgam);
|
||||
# else
|
||||
return lgammal_r (__d, &signgam);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* log. */
|
||||
extern double log (double) __asm__ ("__log_finite");
|
||||
extern float logf (float) __asm__ ("__logf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double logl (long double) __asm__ ("__logl_finite");
|
||||
#endif
|
||||
|
||||
/* log10. */
|
||||
extern double log10 (double) __asm__ ("__log10_finite");
|
||||
extern float log10f (float) __asm__ ("__log10f_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double log10l (long double) __asm__ ("__log10l_finite");
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* log2. */
|
||||
extern double log2 (double) __asm__ ("__log2_finite");
|
||||
extern float log2f (float) __asm__ ("__log2f_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double log2l (long double) __asm__ ("__log2l_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* pow. */
|
||||
extern double pow (double, double) __asm__ ("__pow_finite");
|
||||
extern float powf (float, float) __asm__ ("__powf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double powl (long double, long double) __asm__ ("__powl_finite");
|
||||
#endif
|
||||
|
||||
/* remainder. */
|
||||
extern double remainder (double, double) __asm__ ("__remainder_finite");
|
||||
extern float remainderf (float, float) __asm__ ("__remainderf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double remainderl (long double, long double) __asm__ ("__remainderl_finite");
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
|
||||
/* scalb. */
|
||||
extern double scalb (double, double) __asm__ ("__scalb_finite");
|
||||
extern float scalbf (float, float) __asm__ ("__scalbf_finite");
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double scalbl (long double, long double) __asm__ ("__scalbl_finite");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* sinh. */
|
||||
extern double sinh (double) __asm__ ("__sinh_finite");
|
||||
extern float sinhf (float) __asm__ ("__sinhf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double sinhl (long double) __asm__ ("__sinhl_finite");
|
||||
#endif
|
||||
|
||||
/* sqrt. */
|
||||
extern double sqrt (double) __asm__ ("__sqrt_finite");
|
||||
extern float sqrtf (float) __asm__ ("__sqrtf_finite");
|
||||
#ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double sqrtl (long double) __asm__ ("__sqrtl_finite");
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* tgamma. */
|
||||
extern double __gamma_r_finite (double, int *);
|
||||
__extern_always_inline double tgamma (double __d)
|
||||
{
|
||||
int __local_signgam = 0;
|
||||
double __res = __gamma_r_finite (__d, &__local_signgam);
|
||||
return __local_signgam < 0 ? -__res : __res;
|
||||
}
|
||||
extern float __gammaf_r_finite (float, int *);
|
||||
__extern_always_inline float tgammaf (float __d)
|
||||
{
|
||||
int __local_signgam = 0;
|
||||
float __res = __gammaf_r_finite (__d, &__local_signgam);
|
||||
return __local_signgam < 0 ? -__res : __res;
|
||||
}
|
||||
# ifdef __MATH_DECLARE_LDOUBLE
|
||||
extern long double __gammal_r_finite (long double, int *);
|
||||
__extern_always_inline long double tgammal (long double __d)
|
||||
{
|
||||
int __local_signgam = 0;
|
||||
long double __res = __gammal_r_finite (__d, &__local_signgam);
|
||||
return __local_signgam < 0 ? -__res : __res;
|
||||
}
|
||||
# endif
|
||||
#endif
|
@ -9,6 +9,7 @@ __ieee754_acoshl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_acoshl, __acoshl_finite)
|
||||
|
||||
stub_warning (acoshl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_acosl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_acosl, __acosl_finite)
|
||||
|
||||
stub_warning (acosl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_asinl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_asinl, __asinl_finite)
|
||||
|
||||
stub_warning (asinl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_atan2l (long double x, long double y)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_atan2l, __atan2l_finite)
|
||||
|
||||
stub_warning (atan2l)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_atanhl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_atanhl, __atanhl_finite)
|
||||
|
||||
stub_warning (__ieee754_atanhl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_coshl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_coshl, __coshl_finite)
|
||||
|
||||
stub_warning (__ieee754_coshl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -28,3 +28,4 @@ __ieee754_exp10 (double arg)
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_exp (M_LN10 * arg);
|
||||
}
|
||||
strong_alias (__ieee754_exp10, __exp10_finite)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -28,3 +28,4 @@ __ieee754_exp10f (float arg)
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_expf (M_LN10 * arg);
|
||||
}
|
||||
strong_alias (__ieee754_exp10f, __exp10f_finite)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1998, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -28,3 +28,4 @@ __ieee754_exp10l (long double arg)
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_expl (M_LN10l * arg);
|
||||
}
|
||||
strong_alias (__ieee754_exp10l, __exp10l_finite)
|
||||
|
@ -8,3 +8,4 @@ __ieee754_exp2l (long double x)
|
||||
replaced sometime (soon?). */
|
||||
return __ieee754_expl (M_LN2l * x);
|
||||
}
|
||||
strong_alias (__ieee754_exp2l, __exp2l_finite)
|
||||
|
@ -9,6 +9,7 @@ __ieee754_fmodl (long double x, long double y)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_fmodl, __fmodl_finite)
|
||||
|
||||
stub_warning (fmodl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -10,6 +10,7 @@ __ieee754_gammal_r (long double x, int *signgamp)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_gammal_r, __gammal_r_finite)
|
||||
|
||||
stub_warning (__ieee754_gammal_r)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_hypotl (long double x, long double y)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_hypotl, __hypotl_finite)
|
||||
|
||||
stub_warning (__ieee754_hypotl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -10,6 +10,7 @@ __ieee754_j0l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_j0l, __j0l_finite)
|
||||
|
||||
stub_warning (j0l)
|
||||
|
||||
@ -20,6 +21,7 @@ __ieee754_y0l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_y0l, __y0l_finite)
|
||||
|
||||
stub_warning (y0l)
|
||||
#include <stub-tag.h>
|
||||
|
@ -10,6 +10,7 @@ __ieee754_j1l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_j1l, __j1l_finite)
|
||||
|
||||
stub_warning (j1l)
|
||||
|
||||
@ -20,6 +21,7 @@ __ieee754_y1l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_y1l, __y1l_finite)
|
||||
|
||||
stub_warning (y1l)
|
||||
#include <stub-tag.h>
|
||||
|
@ -10,6 +10,7 @@ __ieee754_jnl (int n, long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_jnl, __jnl_finite)
|
||||
|
||||
stub_warning (jnl)
|
||||
|
||||
@ -20,6 +21,7 @@ __ieee754_ynl (int n, long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_ynl, __ynl_finite)
|
||||
|
||||
stub_warning (ynl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -11,6 +11,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
|
||||
|
||||
stub_warning (lgammal)
|
||||
stub_warning (lgammal_r)
|
||||
|
@ -9,6 +9,7 @@ __ieee754_log10l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_log10l, __log10l_finite)
|
||||
|
||||
stub_warning (log10l)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_log2l (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_log2l, __log2l_finite)
|
||||
|
||||
stub_warning (log2l)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_logl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_logl, __logl_finite)
|
||||
|
||||
stub_warning (logl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_powl (long double x, long double y)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_powl, __powl_finite)
|
||||
|
||||
stub_warning (powl)
|
||||
#include <stub-tag.h>
|
||||
|
102
math/e_scalb.c
102
math/e_scalb.c
@ -1,71 +1,59 @@
|
||||
/* @(#)e_scalb.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: e_scalb.c,v 1.6 1995/05/10 20:46:09 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* __ieee754_scalb(x, fn) is provide for
|
||||
* passing various standard test suite. One
|
||||
* should use scalbn() instead.
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef _SCALB_INT
|
||||
#ifdef __STDC__
|
||||
double __ieee754_scalb(double x, int fn)
|
||||
#else
|
||||
double __ieee754_scalb(x,fn)
|
||||
double x; int fn;
|
||||
#endif
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
double __ieee754_scalb(double x, double fn)
|
||||
#else
|
||||
double __ieee754_scalb(x,fn)
|
||||
double x, fn;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static double
|
||||
__attribute__ ((noinline))
|
||||
invalid_fn (double x, double fn)
|
||||
{
|
||||
#ifdef _SCALB_INT
|
||||
return __scalbn(x,fn);
|
||||
#else
|
||||
if (__isnan(x)||__isnan(fn)) return x*fn;
|
||||
if (!__finite(fn)) {
|
||||
if(fn>0.0) return x*fn;
|
||||
else if (x == 0)
|
||||
return x;
|
||||
else if (!__finite (x))
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nan ("");
|
||||
}
|
||||
else return x/(-fn);
|
||||
}
|
||||
if (__rint (fn) != fn)
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nan ("");
|
||||
}
|
||||
if ( fn > 65000.0) return __scalbn(x, 65000);
|
||||
if (-fn > 65000.0) return __scalbn(x,-65000);
|
||||
return __scalbn(x,(int)fn);
|
||||
#endif
|
||||
else if (fn > 65000.0)
|
||||
return __scalbn (x, 65000);
|
||||
else
|
||||
return __scalbn (x,-65000);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
__ieee754_scalb (double x, double fn)
|
||||
{
|
||||
if (__builtin_expect (__isnan (x), 0))
|
||||
return x * fn;
|
||||
if (__builtin_expect (!__finite (fn), 0))
|
||||
{
|
||||
if (__isnan (fn) || fn > 0.0)
|
||||
return x * fn;
|
||||
if (x == 0.0)
|
||||
return x;
|
||||
return x / -fn;
|
||||
}
|
||||
if (__builtin_expect ((double) (int) fn != fn, 0))
|
||||
return invalid_fn (x, fn);
|
||||
|
||||
return __scalbn (x, (int) fn);
|
||||
}
|
||||
strong_alias (__ieee754_scalb, __scalb_finite)
|
||||
|
@ -1,68 +1,59 @@
|
||||
/* e_scalbf.c -- float version of e_scalb.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: e_scalbf.c,v 1.3 1995/05/10 20:46:12 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef _SCALB_INT
|
||||
#ifdef __STDC__
|
||||
float __ieee754_scalbf(float x, int fn)
|
||||
#else
|
||||
float __ieee754_scalbf(x,fn)
|
||||
float x; int fn;
|
||||
#endif
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
float __ieee754_scalbf(float x, float fn)
|
||||
#else
|
||||
float __ieee754_scalbf(x,fn)
|
||||
float x, fn;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static float
|
||||
__attribute__ ((noinline))
|
||||
invalid_fn (float x, float fn)
|
||||
{
|
||||
#ifdef _SCALB_INT
|
||||
return __scalbnf(x,fn);
|
||||
#else
|
||||
if (__isnanf(x)||__isnanf(fn)) return x*fn;
|
||||
if (!__finitef(fn)) {
|
||||
if(fn>(float)0.0) return x*fn;
|
||||
else if (x == 0)
|
||||
return x;
|
||||
else if (!__finitef (x))
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nanf ("");
|
||||
}
|
||||
else return x/(-fn);
|
||||
}
|
||||
if (__rintf (fn) != fn)
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nanf ("");
|
||||
return __nan ("");
|
||||
}
|
||||
if ( fn > (float)65000.0) return __scalbnf(x, 65000);
|
||||
if (-fn > (float)65000.0) return __scalbnf(x,-65000);
|
||||
else if (fn > 65000.0f)
|
||||
return __scalbnf (x, 65000);
|
||||
else
|
||||
return __scalbnf (x,-65000);
|
||||
}
|
||||
|
||||
|
||||
float
|
||||
__ieee754_scalbf (float x, float fn)
|
||||
{
|
||||
if (__builtin_expect (__isnanf (x), 0))
|
||||
return x * fn;
|
||||
if (__builtin_expect (!__finitef (fn), 0))
|
||||
{
|
||||
if (__isnanf (fn) || fn > 0.0f)
|
||||
return x * fn;
|
||||
if (x == 0.0f)
|
||||
return x;
|
||||
return x / -fn;
|
||||
}
|
||||
if (__builtin_expect ((float) (int) fn != fn, 0))
|
||||
return invalid_fn (x, fn);
|
||||
|
||||
return __scalbnf (x, (int) fn);
|
||||
#endif
|
||||
}
|
||||
strong_alias (__ieee754_scalbf, __scalbf_finite)
|
||||
|
104
math/e_scalbl.c
104
math/e_scalbl.c
@ -1,75 +1,59 @@
|
||||
/* e_scalbl.c -- long double version of s_scalb.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* __ieee754_scalbl(x, fn) is provide for
|
||||
* passing various standard test suite. One
|
||||
* should use scalbnl() instead.
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef _SCALB_INT
|
||||
#ifdef __STDC__
|
||||
long double __ieee754_scalbl(long double x, int fn)
|
||||
#else
|
||||
long double __ieee754_scalbl(x,fn)
|
||||
long double x; int fn;
|
||||
#endif
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
long double __ieee754_scalbl(long double x, long double fn)
|
||||
#else
|
||||
long double __ieee754_scalbl(x,fn)
|
||||
long double x, fn;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static long double
|
||||
__attribute__ ((noinline))
|
||||
invalid_fn (long double x, long double fn)
|
||||
{
|
||||
#ifdef _SCALB_INT
|
||||
return __scalbnl(x,fn);
|
||||
#else
|
||||
if (__isnanl(x)||__isnanl(fn)) return x*fn;
|
||||
if (!__finitel(fn)) {
|
||||
if(fn>0.0) return x*fn;
|
||||
else if (x == 0)
|
||||
return x;
|
||||
else if (!__finitel (x))
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nanl ("");
|
||||
}
|
||||
else return x/(-fn);
|
||||
}
|
||||
if (__rintl (fn) != fn)
|
||||
{
|
||||
# ifdef FE_INVALID
|
||||
feraiseexcept (FE_INVALID);
|
||||
# endif
|
||||
return __nanl ("");
|
||||
return __nan ("");
|
||||
}
|
||||
if ( fn > 65000.0) return __scalbnl(x, 65000);
|
||||
if (-fn > 65000.0) return __scalbnl(x,-65000);
|
||||
else if (fn > 65000.0L)
|
||||
return __scalbnl (x, 65000);
|
||||
else
|
||||
return __scalbnl (x,-65000);
|
||||
}
|
||||
|
||||
|
||||
long double
|
||||
__ieee754_scalbl (long double x, long double fn)
|
||||
{
|
||||
if (__builtin_expect (__isnanl (x), 0))
|
||||
return x * fn;
|
||||
if (__builtin_expect (!__finitel (fn), 0))
|
||||
{
|
||||
if (__isnanl (fn) || fn > 0.0L)
|
||||
return x * fn;
|
||||
if (x == 0.0L)
|
||||
return x;
|
||||
return x / -fn;
|
||||
}
|
||||
if (__builtin_expect ((long double) (int) fn != fn, 0))
|
||||
return invalid_fn (x, fn);
|
||||
|
||||
return __scalbnl (x, (int) fn);
|
||||
#endif
|
||||
}
|
||||
strong_alias (__ieee754_scalbl, __scalbl_finite)
|
||||
|
@ -9,6 +9,7 @@ __ieee754_sinhl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_sinhl, __sinhl_finite)
|
||||
|
||||
stub_warning (__ieee754_sinhl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -9,6 +9,7 @@ __ieee754_sqrtl (long double x)
|
||||
__set_errno (ENOSYS);
|
||||
return 0.0;
|
||||
}
|
||||
strong_alias (__ieee754_sqrtl, __sqrtl_finite)
|
||||
|
||||
stub_warning (sqrtl)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Declarations for math functions.
|
||||
Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009
|
||||
Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009, 2011
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@ -138,6 +138,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
|
||||
# endif
|
||||
# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99
|
||||
# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99
|
||||
# define __MATH_DECLARE_LDOUBLE 1
|
||||
# include <bits/mathcalls.h>
|
||||
# undef _Mdouble_
|
||||
# undef _Mdouble_BEGIN_NAMESPACE
|
||||
@ -416,6 +417,12 @@ extern int matherr (struct exception *__exc);
|
||||
# include <bits/mathinline.h>
|
||||
#endif
|
||||
|
||||
/* Define special entry points to use when the compiler got told to
|
||||
only expect finite results. */
|
||||
#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0
|
||||
# include <bits/math-finite.h>
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC99
|
||||
/* If we've still got undefined comparison macros, provide defaults. */
|
||||
|
||||
|
@ -202,6 +202,7 @@ extern double __ieee754_scalb (double,double);
|
||||
|
||||
/* fdlibm kernel function */
|
||||
extern double __kernel_standard (double,double,int);
|
||||
extern float __kernel_standard_f (float,float,int);
|
||||
extern double __kernel_sin (double,double,int);
|
||||
extern double __kernel_cos (double,double);
|
||||
extern double __kernel_tan (double,double,int);
|
||||
|
@ -1,45 +1,39 @@
|
||||
/* @(#)w_acos.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_acos.c,v 1.6 1995/05/10 20:48:26 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrap_acos(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __acos(double x) /* wrapper acos */
|
||||
#else
|
||||
double __acos(x) /* wrapper acos */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper acos */
|
||||
double
|
||||
__acos (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* acos(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 1);
|
||||
}
|
||||
|
||||
return __ieee754_acos (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_acos(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(fabs(x)>1.0) {
|
||||
return __kernel_standard(x,x,1); /* acos(|x|>1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__acos, acos)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,48 +1,38 @@
|
||||
/* w_acosf.c -- float version of w_acos.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_acosf.c,v 1.3 1995/05/10 20:48:29 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.
|
||||
|
||||
/*
|
||||
* wrap_acosf(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __acosf(float x) /* wrapper acosf */
|
||||
#else
|
||||
float __acosf(x) /* wrapper acosf */
|
||||
float x;
|
||||
#endif
|
||||
/* wrapper acosf */
|
||||
float
|
||||
__acosf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* acos(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 101);
|
||||
}
|
||||
|
||||
return __ieee754_acosf (x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_acosf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(fabsf(x)>(float)1.0) {
|
||||
/* acosf(|x|>1) */
|
||||
return (float)__kernel_standard((double)x,(double)x,101);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__acosf, acosf)
|
||||
|
@ -1,44 +1,35 @@
|
||||
/* @(#)w_acosh.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_acosh.c,v 1.6 1995/05/10 20:48:31 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper acosh(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __acosh(double x) /* wrapper acosh */
|
||||
#else
|
||||
double __acosh(x) /* wrapper acosh */
|
||||
double x;
|
||||
#endif
|
||||
|
||||
/* wrapper acosh */
|
||||
double
|
||||
__acosh (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x < 1.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* acosh(x<1) */
|
||||
return __kernel_standard (x, x, 29);
|
||||
|
||||
return __ieee754_acosh (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_acosh(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(x<1.0) {
|
||||
return __kernel_standard(x,x,29); /* acosh(x<1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__acosh, acosh)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,48 +1,34 @@
|
||||
/* w_acoshf.c -- float version of w_acosh.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_acoshf.c,v 1.3 1995/05/10 20:48:33 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.
|
||||
|
||||
/*
|
||||
* wrapper acoshf(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __acoshf(float x) /* wrapper acoshf */
|
||||
#else
|
||||
float __acoshf(x) /* wrapper acoshf */
|
||||
float x;
|
||||
#endif
|
||||
|
||||
/* wrapper acoshf */
|
||||
float
|
||||
__acoshf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_acoshf(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_acoshf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(x<(float)1.0) {
|
||||
if (__builtin_expect (x < 1.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* acosh(x<1) */
|
||||
return (float)__kernel_standard((double)x,(double)x,129);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
return __kernel_standard_f (x, x, 129);
|
||||
|
||||
return __ieee754_acoshf (x);
|
||||
}
|
||||
weak_alias (__acoshf, acoshf)
|
||||
|
@ -1,47 +1,34 @@
|
||||
/* w_acoshl.c -- long double version of w_acosh.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper acoshl(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __acoshl(long double x) /* wrapper acosh */
|
||||
#else
|
||||
long double __acoshl(x) /* wrapper acosh */
|
||||
long double x;
|
||||
#endif
|
||||
|
||||
/* wrapper acosl */
|
||||
long double
|
||||
__acoshl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x < 1.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* acosh(x<1) */
|
||||
return __kernel_standard (x, x, 229);
|
||||
|
||||
return __ieee754_acoshl (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_acoshl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(x<1.0) {
|
||||
return __kernel_standard(x,x,229); /* acoshl(x<1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__acoshl, acoshl)
|
||||
|
@ -1,48 +1,38 @@
|
||||
/* w_acosl.c -- long double version of w_acos.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrap_acosl(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __acosl(long double x) /* wrapper acos */
|
||||
#else
|
||||
long double __acosl(x) /* wrapper acos */
|
||||
long double x;
|
||||
#endif
|
||||
/* wrapper acosl */
|
||||
long double
|
||||
__acosl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* acos(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 201);
|
||||
}
|
||||
|
||||
return __ieee754_acosl (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_acosl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(fabsl(x)>1.0) {
|
||||
return __kernel_standard(x,x,201); /* acosl(|x|>1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__acosl, acosl)
|
||||
|
@ -1,46 +1,39 @@
|
||||
/* @(#)w_asin.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_asin.c,v 1.6 1995/05/10 20:48:35 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper asin(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __asin(double x) /* wrapper asin */
|
||||
#else
|
||||
double __asin(x) /* wrapper asin */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper asin */
|
||||
double
|
||||
__asin (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) > 1.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* asin(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 2);
|
||||
}
|
||||
|
||||
return __ieee754_asin (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_asin(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(fabs(x)>1.0) {
|
||||
return __kernel_standard(x,x,2); /* asin(|x|>1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__asin, asin)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,49 +1,38 @@
|
||||
/* w_asinf.c -- float version of w_asin.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_asinf.c,v 1.3 1995/05/10 20:48:37 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper asinf(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __asinf(float x) /* wrapper asinf */
|
||||
#else
|
||||
float __asinf(x) /* wrapper asinf */
|
||||
float x;
|
||||
#endif
|
||||
/* wrapper asinf */
|
||||
float
|
||||
__asinf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsf (x) > 1.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* asin(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 102);
|
||||
}
|
||||
|
||||
return __ieee754_asinf (x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_asinf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(fabsf(x)>(float)1.0) {
|
||||
/* asinf(|x|>1) */
|
||||
return (float)__kernel_standard((double)x,(double)x,102);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__asinf, asinf)
|
||||
|
@ -1,49 +1,38 @@
|
||||
/* w_asinl.c -- long double version of w_asin.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper asinl(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __asinl(long double x) /* wrapper asinl */
|
||||
#else
|
||||
long double __asinl(x) /* wrapper asinl */
|
||||
long double x;
|
||||
#endif
|
||||
/* wrapper asinl */
|
||||
long double
|
||||
__asinl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsl (x) > 1.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
/* asin(|x|>1) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 202);
|
||||
}
|
||||
|
||||
return __ieee754_asinl (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_asinl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(fabsl(x)>1.0) {
|
||||
return __kernel_standard(x,x,202); /* asinl(|x|>1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__asinl, asinl)
|
||||
|
@ -1,18 +1,21 @@
|
||||
/* @(#)w_atan2.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_atan2.c,v 1.6 1995/05/10 20:48:39 jtc Exp $";
|
||||
#endif
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* wrapper atan2(y,x)
|
||||
@ -22,23 +25,13 @@ static char rcsid[] = "$NetBSD: w_atan2.c,v 1.6 1995/05/10 20:48:39 jtc Exp $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __atan2(double y, double x) /* wrapper atan2 */
|
||||
#else
|
||||
double __atan2(y,x) /* wrapper atan2 */
|
||||
double y,x;
|
||||
#endif
|
||||
double
|
||||
__atan2 (double y, double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_atan2(y,x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_atan2(y,x);
|
||||
if(_LIB_VERSION != _SVID_||__isnan(x)||__isnan(y)) return z;
|
||||
if(x==0.0&&y==0.0)
|
||||
if (__builtin_expect (x == 0.0 && y == 0.0, 0) && _LIB_VERSION == _SVID_)
|
||||
return __kernel_standard (y, x, 3); /* atan2(+-0,+-0) */
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_atan2 (y, x);
|
||||
}
|
||||
weak_alias (__atan2, atan2)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,21 +1,21 @@
|
||||
/* w_atan2f.c -- float version of w_atan2.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_atan2f.c,v 1.3 1995/05/10 20:48:42 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* wrapper atan2f(y,x)
|
||||
@ -25,22 +25,12 @@ static char rcsid[] = "$NetBSD: w_atan2f.c,v 1.3 1995/05/10 20:48:42 jtc Exp $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __atan2f(float y, float x) /* wrapper atan2f */
|
||||
#else
|
||||
float __atan2f(y,x) /* wrapper atan2 */
|
||||
float y,x;
|
||||
#endif
|
||||
float
|
||||
__atan2f (float y, float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x == 0.0f && y == 0.0f, 0) && _LIB_VERSION == _SVID_)
|
||||
return __kernel_standard_f (y, x, 103); /* atan2(+-0,+-0) */
|
||||
|
||||
return __ieee754_atan2f (y, x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_atan2f(y,x);
|
||||
if(_LIB_VERSION != _SVID_||__isnanf(x)||__isnanf(y)) return z;
|
||||
if(x==0.0&&y==0.0)
|
||||
return __kernel_standard(y,x,103); /* atan2(+-0,+-0) */
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__atan2f, atan2f)
|
||||
|
@ -1,22 +1,21 @@
|
||||
/* w_atan2l.c -- long double version of w_atan2.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* wrapper atan2l(y,x)
|
||||
@ -26,22 +25,12 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __atan2l(long double y, long double x) /* wrapper atan2l */
|
||||
#else
|
||||
long double __atan2l(y,x) /* wrapper atan2l */
|
||||
long double y,x;
|
||||
#endif
|
||||
long double
|
||||
__atan2l (long double y, long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_atan2l(y,x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_atan2l(y,x);
|
||||
if(_LIB_VERSION != _SVID_||__isnanl(x)||__isnanl(y)) return z;
|
||||
if(x==0.0&&y==0.0)
|
||||
if (__builtin_expect (x == 0.0L && y == 0.0L, 0) && _LIB_VERSION == _SVID_)
|
||||
return __kernel_standard (y, x, 203); /* atan2(+-0,+-0) */
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_atan2l (y, x);
|
||||
}
|
||||
weak_alias (__atan2l, atan2l)
|
||||
|
@ -1,49 +1,37 @@
|
||||
/* @(#)w_atanh.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_atanh.c,v 1.6 1995/05/10 20:48:43 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper atanh(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __atanh(double x) /* wrapper atanh */
|
||||
#else
|
||||
double __atanh(x) /* wrapper atanh */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper atanh */
|
||||
double
|
||||
__atanh (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) >= 1.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x,
|
||||
fabs (x) > 1.0
|
||||
? 30 /* atanh(|x|>1) */
|
||||
: 31); /* atanh(|x|==1) */
|
||||
|
||||
return __ieee754_atanh (x);
|
||||
#else
|
||||
double z,y;
|
||||
z = __ieee754_atanh(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
y = fabs(x);
|
||||
if(y>=1.0) {
|
||||
if(y>1.0)
|
||||
return __kernel_standard(x,x,30); /* atanh(|x|>1) */
|
||||
else
|
||||
return __kernel_standard(x,x,31); /* atanh(|x|==1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__atanh, atanh)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,53 +1,36 @@
|
||||
/* w_atanhf.c -- float version of w_atanh.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_atanhf.c,v 1.3 1995/05/10 20:48:45 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.
|
||||
|
||||
/*
|
||||
* wrapper atanhf(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __atanhf(float x) /* wrapper atanhf */
|
||||
#else
|
||||
float __atanhf(x) /* wrapper atanhf */
|
||||
float x;
|
||||
#endif
|
||||
/* wrapper atanhf */
|
||||
float
|
||||
__atanhf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsf (x) >= 1.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f (x, x,
|
||||
fabsf (x) > 1.0f
|
||||
? 130 /* atanh(|x|>1) */
|
||||
: 131); /* atanh(|x|==1) */
|
||||
|
||||
return __ieee754_atanhf (x);
|
||||
#else
|
||||
float z,y;
|
||||
z = __ieee754_atanhf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
y = fabsf(x);
|
||||
if(y>=(float)1.0) {
|
||||
if(y>(float)1.0)
|
||||
/* atanhf(|x|>1) */
|
||||
return (float)__kernel_standard((double)x,(double)x,130);
|
||||
else
|
||||
/* atanhf(|x|==1) */
|
||||
return (float)__kernel_standard((double)x,(double)x,131);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__atanhf, atanhf)
|
||||
|
@ -1,52 +1,36 @@
|
||||
/* w_atanhl.c -- long double version of w_atanh.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper atanhl(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __atanhl(long double x) /* wrapper atanhl */
|
||||
#else
|
||||
long double __atanhl(x) /* wrapper atanhl */
|
||||
long double x;
|
||||
#endif
|
||||
/* wrapper atanhl */
|
||||
long double
|
||||
__atanhl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsl (x) >= 1.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x,
|
||||
fabsl (x) > 1.0L
|
||||
? 230 /* atanh(|x|>1) */
|
||||
: 231); /* atanh(|x|==1) */
|
||||
|
||||
return __ieee754_atanhl (x);
|
||||
#else
|
||||
long double z,y;
|
||||
z = __ieee754_atanhl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
y = fabsl(x);
|
||||
if(y>=1.0) {
|
||||
if(y>1.0)
|
||||
return __kernel_standard(x,x,230); /* atanhl(|x|>1) */
|
||||
else
|
||||
return __kernel_standard(x,x,231); /* atanhl(|x|==1) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__atanhl, atanhl)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* @(#)w_cosh.c 5.1 93/09/24 */
|
||||
/* Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011 */
|
||||
/*
|
||||
* ====================================================
|
||||
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
@ -10,10 +10,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_cosh.c,v 1.6 1995/05/10 20:48:47 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper cosh(x)
|
||||
*/
|
||||
@ -21,24 +17,15 @@ static char rcsid[] = "$NetBSD: w_cosh.c,v 1.6 1995/05/10 20:48:47 jtc Exp $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __cosh(double x) /* wrapper cosh */
|
||||
#else
|
||||
double __cosh(x) /* wrapper cosh */
|
||||
double x;
|
||||
#endif
|
||||
double
|
||||
__cosh (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_cosh(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_cosh(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(!__finite(z) && __finite(x)) {
|
||||
double z = __ieee754_cosh (x);
|
||||
if (__builtin_expect (!__finite (z), 0) && __finite (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x, 5); /* cosh overflow */
|
||||
} else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__cosh, cosh)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* w_coshf.c -- float version of w_cosh.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
* Optimizations by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -13,10 +14,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_coshf.c,v 1.3 1995/05/10 20:48:49 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper coshf(x)
|
||||
*/
|
||||
@ -24,24 +21,14 @@ static char rcsid[] = "$NetBSD: w_coshf.c,v 1.3 1995/05/10 20:48:49 jtc Exp $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __coshf(float x) /* wrapper coshf */
|
||||
#else
|
||||
float __coshf(x) /* wrapper coshf */
|
||||
float x;
|
||||
#endif
|
||||
float
|
||||
__coshf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_coshf(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_coshf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(!__finite(z) && __finite(x)) {
|
||||
/* cosh overflow */
|
||||
return (float)__kernel_standard((double)x,(double)x,105);
|
||||
} else
|
||||
float z = __ieee754_coshf (x);
|
||||
if (__builtin_expect (!__finitef (z), 0) && __finitef (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f (x, x, 105); /* cosh overflow */
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__coshf, coshf)
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* w_acoshl.c -- long double version of w_acosh.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
* Optimizations bu Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -14,10 +15,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper coshl(x)
|
||||
*/
|
||||
@ -25,23 +22,14 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __coshl(long double x) /* wrapper coshl */
|
||||
#else
|
||||
long double __coshl(x) /* wrapper coshl */
|
||||
long double x;
|
||||
#endif
|
||||
long double
|
||||
__coshl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_coshl(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_coshl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(!__finitel(z) && __finitel(x)) {
|
||||
long double z = __ieee754_coshl (x);
|
||||
if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x, 205); /* cosh overflow */
|
||||
} else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__coshl, coshl)
|
||||
|
@ -1,17 +1,22 @@
|
||||
/* @(#)w_exp10.c
|
||||
* Conversion to exp10 by Ulrich Drepper <drepper@cygnus.com>.
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* wrapper exp10(x)
|
||||
@ -20,25 +25,16 @@
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __exp10(double x) /* wrapper exp10 */
|
||||
#else
|
||||
double __exp10(x) /* wrapper exp10 */
|
||||
double x;
|
||||
#endif
|
||||
double
|
||||
__exp10 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_exp10(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_exp10(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finite(z) && __finite(x)) {
|
||||
double z = __ieee754_exp10 (x);
|
||||
if (__builtin_expect (!__finite (z), 0)
|
||||
&& __finite (x) && _LIB_VERSION != _IEEE_)
|
||||
/* exp10 overflow (46) if x > 0, underflow (47) if x < 0. */
|
||||
return __kernel_standard (x, x, 46 + !!__signbit (x));
|
||||
}
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp10, exp10)
|
||||
strong_alias (__exp10, __pow10)
|
||||
|
@ -1,45 +1,40 @@
|
||||
/* w_exp10f.c -- float version of w_exp10.c.
|
||||
* Conversion to exp10 by Ulrich Drepper <drepper@cygnus.com>.
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* wrapper expf10(x)
|
||||
* wrapper exp10f(x)
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __exp10f(float x) /* wrapper exp10f */
|
||||
#else
|
||||
float __exp10f(x) /* wrapper exp10f */
|
||||
float x;
|
||||
#endif
|
||||
float
|
||||
__exp10f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_exp10f(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_exp10f(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finitef(z) && __finitef(x)) {
|
||||
float z = __ieee754_exp10f (x);
|
||||
if (__builtin_expect (!__finitef (z), 0)
|
||||
&& __finitef (x) && _LIB_VERSION != _IEEE_)
|
||||
/* exp10f overflow (146) if x > 0, underflow (147) if x < 0. */
|
||||
return (float)__kernel_standard((double) x, (double) x,
|
||||
146+!!__signbitf(x));
|
||||
}
|
||||
return __kernel_standard_f (x, x, 146 + !!__signbitf (x));
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp10f, exp10f)
|
||||
strong_alias (__exp10f, __pow10f)
|
||||
|
@ -1,18 +1,22 @@
|
||||
/* w_exp10l.c -- long double version of w_exp10.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* wrapper exp10l(x)
|
||||
@ -21,25 +25,16 @@
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __exp10l(long double x) /* wrapper exp10 */
|
||||
#else
|
||||
long double __exp10l(x) /* wrapper exp10 */
|
||||
long double x;
|
||||
#endif
|
||||
long double
|
||||
__exp10l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_exp10l(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_exp10l(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finitel(z) && __finitel(x)) {
|
||||
/* exp10 overflow (246) if x > 0, underflow (247) if x < 0. */
|
||||
return __kernel_standard(x,x,246+__signbitl(x));
|
||||
}
|
||||
long double z = __ieee754_exp10l (x);
|
||||
if (__builtin_expect (!__finitel (z), 0)
|
||||
&& __finitel (x) && _LIB_VERSION != _IEEE_)
|
||||
/* exp10l overflow (246) if x > 0, underflow (247) if x < 0. */
|
||||
return __kernel_standard (x, x, 246 + !!__signbitl (x));
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp10l, exp10l)
|
||||
strong_alias (__exp10l, __pow10l)
|
||||
|
@ -10,24 +10,14 @@ static const double o_threshold= (double) DBL_MAX_EXP;
|
||||
static const double u_threshold = (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
|
||||
|
||||
double
|
||||
__exp2 (double x) /* wrapper exp2 */
|
||||
__exp2 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && __finite (x))
|
||||
/* exp2 overflow: 44, exp2 underflow: 45 */
|
||||
return __kernel_standard (x, x, 44 + (x <= o_threshold));
|
||||
|
||||
return __ieee754_exp2 (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_exp2 (x);
|
||||
if (_LIB_VERSION != _IEEE_ && __finite (x))
|
||||
{
|
||||
if (x > o_threshold)
|
||||
/* exp2 overflow */
|
||||
return __kernel_standard (x, x, 44);
|
||||
else if (x <= u_threshold)
|
||||
/* exp2 underflow */
|
||||
return __kernel_standard (x, x, 45);
|
||||
}
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp2, exp2)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -10,23 +10,13 @@ static const float o_threshold= (float) FLT_MAX_EXP;
|
||||
static const float u_threshold = (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
|
||||
|
||||
float
|
||||
__exp2f (float x) /* wrapper exp2f */
|
||||
__exp2f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && __finitef (x))
|
||||
/* exp2 overflow: 144, exp2 underflow: 145 */
|
||||
return __kernel_standard_f (x, x, 144 + (x <= o_threshold));
|
||||
|
||||
return __ieee754_exp2f (x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_exp2f (x);
|
||||
if (_LIB_VERSION != _IEEE_ && __finitef (x))
|
||||
{
|
||||
if (x > o_threshold)
|
||||
/* exp2 overflow */
|
||||
return (float) __kernel_standard ((double) x, (double) x, 144);
|
||||
else if (x <= u_threshold)
|
||||
/* exp2 underflow */
|
||||
return (float) __kernel_standard ((double) x, (double) x, 145);
|
||||
}
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp2f, exp2f)
|
||||
|
@ -11,21 +11,13 @@ static const long double u_threshold
|
||||
= (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
|
||||
|
||||
long double
|
||||
__exp2l (long double x) /* wrapper exp2l */
|
||||
__exp2l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (x <= u_threshold || x > o_threshold, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && __finitel (x))
|
||||
/* exp2 overflow: 244, exp2 underflow: 245 */
|
||||
return __kernel_standard (x, x, 244 + (x <= o_threshold));
|
||||
|
||||
return __ieee754_exp2l (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_exp2l (x);
|
||||
if (_LIB_VERSION != _IEEE_ && __finitel (x))
|
||||
{
|
||||
if (x > o_threshold)
|
||||
return __kernel_standard (x, x, 244); /* exp2l overflow */
|
||||
else if (x <= u_threshold)
|
||||
return __kernel_standard (x, x, 245); /* exp2l underflow */
|
||||
}
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__exp2l, exp2l)
|
||||
|
@ -1,46 +1,35 @@
|
||||
/* @(#)w_fmod.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_fmod.c,v 1.6 1995/05/10 20:48:55 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper fmod(x,y)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __fmod(double x, double y) /* wrapper fmod */
|
||||
#else
|
||||
double __fmod(x,y) /* wrapper fmod */
|
||||
double x,y;
|
||||
#endif
|
||||
/* wrapper fmod */
|
||||
double
|
||||
__fmod (double x, double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_fmod(x,y);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_fmod(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ ||__isnan(y)||__isnan(x)) return z;
|
||||
if(__isinf_ns(x)||y==0.0) {
|
||||
if (__builtin_expect (__isinf_ns (x) || y == 0.0, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && !__isnan (y) && !__isnan (x))
|
||||
/* fmod(+-Inf,y) or fmod(x,0) */
|
||||
return __kernel_standard (x, y, 27);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_fmod (x, y);
|
||||
}
|
||||
weak_alias (__fmod, fmod)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,48 +1,34 @@
|
||||
/* w_fmodf.c -- float version of w_fmod.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_fmodf.c,v 1.3 1995/05/10 20:48:57 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.
|
||||
|
||||
/*
|
||||
* wrapper fmodf(x,y)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __fmodf(float x, float y) /* wrapper fmodf */
|
||||
#else
|
||||
float __fmodf(x,y) /* wrapper fmodf */
|
||||
float x,y;
|
||||
#endif
|
||||
/* wrapper fmodf */
|
||||
float
|
||||
__fmodf (float x, float y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (__isinf_nsf (x) || y == 0.0f, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && !__isnanf (y) && !__isnanf (x))
|
||||
/* fmod(+-Inf,y) or fmod(x,0) */
|
||||
return __kernel_standard_f (x, y, 127);
|
||||
|
||||
return __ieee754_fmodf (x, y);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_fmodf(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ ||__isnanf(y)||__isnanf(x)) return z;
|
||||
if(__isinf_nsf(x)||y==(float)0.0) {
|
||||
/* fmodf(+-Inf,y) or fmodf(x,0) */
|
||||
return (float)__kernel_standard((double)x,(double)y,127);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__fmodf, fmodf)
|
||||
|
@ -1,49 +1,34 @@
|
||||
/* w_fmodl.c -- long double version of w_fmod.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper fmodl(x,y)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __fmodl(long double x, long double y)/* wrapper fmodl */
|
||||
#else
|
||||
long double __fmodl(x,y) /* wrapper fmodl */
|
||||
long double x,y;
|
||||
#endif
|
||||
/* wrapper fmodl */
|
||||
long double
|
||||
__fmodl (long double x, long double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_fmodl(x,y);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_fmodl(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ ||__isnanl(y)||__isnanl(x)) return z;
|
||||
if(__isinf_nsl(x)||y==0.0) {
|
||||
/* fmodl(+-Inf,y) or fmodl(x,0) */
|
||||
if (__builtin_expect (__isinf_nsl (x) || y == 0.0L, 0)
|
||||
&& _LIB_VERSION != _IEEE_ && !__isnanl (y) && !__isnanl (x))
|
||||
/* fmod(+-Inf,y) or fmod(x,0) */
|
||||
return __kernel_standard (x, y, 227);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_fmodl (x, y);
|
||||
}
|
||||
weak_alias (__fmodl, fmodl)
|
||||
|
@ -10,10 +10,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper hypot(x,y)
|
||||
*/
|
||||
@ -22,24 +18,15 @@ static char rcsid[] = "$NetBSD: w_hypot.c,v 1.6 1995/05/10 20:49:07 jtc Exp $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __hypot(double x, double y)/* wrapper hypot */
|
||||
#else
|
||||
double __hypot(x,y) /* wrapper hypot */
|
||||
double x,y;
|
||||
#endif
|
||||
double
|
||||
__hypot (double x, double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_hypot(x,y);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_hypot(x,y);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if((!__finite(z))&&__finite(x)&&__finite(y))
|
||||
double z = __ieee754_hypot(x,y);
|
||||
if(__builtin_expect(!__finite(z), 0)
|
||||
&& __finite(x) && __finite(y) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, y, 4); /* hypot overflow */
|
||||
else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__hypot, hypot)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -13,10 +13,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper hypotf(x,y)
|
||||
*/
|
||||
@ -25,24 +21,15 @@ static char rcsid[] = "$NetBSD: w_hypotf.c,v 1.3 1995/05/10 20:49:09 jtc Exp $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __hypotf(float x, float y) /* wrapper hypotf */
|
||||
#else
|
||||
float __hypotf(x,y) /* wrapper hypotf */
|
||||
float x,y;
|
||||
#endif
|
||||
float
|
||||
__hypotf(float x, float y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_hypotf(x,y);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_hypotf(x,y);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if((!__finitef(z))&&__finitef(x)&&__finitef(y))
|
||||
float z = __ieee754_hypotf(x,y);
|
||||
if(__builtin_expect(!__finitef(z), 0)
|
||||
&& __finitef(x) && __finitef(y) && _LIB_VERSION != _IEEE_)
|
||||
/* hypot overflow */
|
||||
return (float)__kernel_standard((double)x,(double)y,104);
|
||||
else
|
||||
return __kernel_standard_f(x, y, 104);
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__hypotf, hypotf)
|
||||
|
@ -14,10 +14,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper hypotl(x,y)
|
||||
*/
|
||||
@ -26,23 +22,15 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __hypotl(long double x, long double y)/* wrapper hypotl */
|
||||
#else
|
||||
long double __hypotl(x,y) /* wrapper hypotl */
|
||||
long double x,y;
|
||||
#endif
|
||||
long double
|
||||
__hypotl(long double x, long double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_hypotl(x,y);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_hypotl(x,y);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if((!__finitel(z))&&__finitel(x)&&__finitel(y))
|
||||
if(__builtin_expect(!__finitel(z), 0)
|
||||
&& __finitel(x) && __finitel(y) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, y, 204); /* hypot overflow */
|
||||
else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__hypotl, hypotl)
|
||||
|
98
math/w_j0.c
98
math/w_j0.c
@ -1,75 +1,63 @@
|
||||
/* @(#)w_j0.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_j0.c,v 1.6 1995/05/10 20:49:11 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper j0(double x), y0(double x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double j0(double x) /* wrapper j0 */
|
||||
#else
|
||||
double j0(x) /* wrapper j0 */
|
||||
double x;
|
||||
#endif
|
||||
|
||||
/* wrapper j0 */
|
||||
double
|
||||
j0 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* j0(|x|>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 34);
|
||||
|
||||
return __ieee754_j0 (x);
|
||||
#else
|
||||
double z = __ieee754_j0(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(fabs(x)>X_TLOSS) {
|
||||
return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (j0, j0l)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double y0(double x) /* wrapper y0 */
|
||||
#else
|
||||
double y0(x) /* wrapper y0 */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper y0 */
|
||||
double
|
||||
y0 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y0(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_y0(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
if(x==0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return __kernel_standard(x,x,8);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 9);
|
||||
}
|
||||
if(x>X_TLOSS) {
|
||||
return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
else if (x == 0.0)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard (x, x, 8);
|
||||
else
|
||||
/* y0(x>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 35);
|
||||
}
|
||||
|
||||
return __ieee754_y0 (x);
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (y0, y0l)
|
||||
|
104
math/w_j0f.c
104
math/w_j0f.c
@ -1,74 +1,60 @@
|
||||
/* w_j0f.c -- float version of w_j0.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_j0f.c,v 1.3 1995/05/10 20:49:13 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.
|
||||
|
||||
/*
|
||||
* wrapper j0f(float x), y0f(float x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float j0f(float x) /* wrapper j0f */
|
||||
#else
|
||||
float j0f(x) /* wrapper j0f */
|
||||
float x;
|
||||
#endif
|
||||
|
||||
/* wrapper j0f */
|
||||
float
|
||||
j0f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
/* j0(|x|>X_TLOSS) */
|
||||
return __kernel_standard_f (x, x, 134);
|
||||
|
||||
return __ieee754_j0f (x);
|
||||
#else
|
||||
float z = __ieee754_j0f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(fabsf(x)>(float)X_TLOSS) {
|
||||
/* j0f(|x|>X_TLOSS) */
|
||||
return (float)__kernel_standard((double)x,(double)x,134);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
float y0f(float x) /* wrapper y0f */
|
||||
#else
|
||||
float y0f(x) /* wrapper y0f */
|
||||
float x;
|
||||
#endif
|
||||
|
||||
/* wrapper y0f */
|
||||
float
|
||||
y0f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y0f(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_y0f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
|
||||
if(x <= (float)0.0){
|
||||
if(x==(float)0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return (float)__kernel_standard((double)x,(double)x,108);
|
||||
if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0f)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 109);
|
||||
}
|
||||
else if (x == 0.0f)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard_f (x, x, 108);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
return (float)__kernel_standard((double)x,(double)x,109);
|
||||
}
|
||||
if(x>(float)X_TLOSS) {
|
||||
/* y0(x>X_TLOSS) */
|
||||
return (float)__kernel_standard((double)x,(double)x,135);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
return __kernel_standard_f (x, x, 135);
|
||||
}
|
||||
|
||||
return __ieee754_y0f (x);
|
||||
}
|
||||
|
100
math/w_j0l.c
100
math/w_j0l.c
@ -1,76 +1,60 @@
|
||||
/* w_j0l.c -- long double version of w_j0.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper j0l(long double x), y0l(long double x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __j0l(long double x) /* wrapper j0l */
|
||||
#else
|
||||
long double __j0l(x) /* wrapper j0 */
|
||||
long double x;
|
||||
#endif
|
||||
|
||||
/* wrapper j0l */
|
||||
long double
|
||||
__j0l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* j0(|x|>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 234);
|
||||
|
||||
return __ieee754_j0l (x);
|
||||
#else
|
||||
long double z = __ieee754_j0l(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(fabsl(x)>X_TLOSS) {
|
||||
return __kernel_standard(x,x,234); /* j0(|x|>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__j0l, j0l)
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __y0l(long double x) /* wrapper y0l */
|
||||
#else
|
||||
long double __y0l(x) /* wrapper y0 */
|
||||
long double x;
|
||||
#endif
|
||||
|
||||
/* wrapper y0l */
|
||||
long double
|
||||
__y0l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y0l(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_y0l(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
if(x==0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return __kernel_standard(x,x,208);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0L)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 209);
|
||||
}
|
||||
if(x>X_TLOSS) {
|
||||
return __kernel_standard(x,x,235); /* y0(x>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
else if (x == 0.0L)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard (x, x, 208);
|
||||
else
|
||||
/* y0(x>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 235);
|
||||
}
|
||||
|
||||
return __ieee754_y0l (x);
|
||||
}
|
||||
weak_alias (__y0l, y0l)
|
||||
|
99
math/w_j1.c
99
math/w_j1.c
@ -1,76 +1,63 @@
|
||||
/* @(#)w_j1.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_j1.c,v 1.6 1995/05/10 20:49:15 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper of j1,y1
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double j1(double x) /* wrapper j1 */
|
||||
#else
|
||||
double j1(x) /* wrapper j1 */
|
||||
double x;
|
||||
#endif
|
||||
|
||||
/* wrapper j1 */
|
||||
double
|
||||
j1 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* j1(|x|>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 36);
|
||||
|
||||
return __ieee754_j1 (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_j1(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
|
||||
if(fabs(x)>X_TLOSS) {
|
||||
return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (j1, j1l)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double y1(double x) /* wrapper y1 */
|
||||
#else
|
||||
double y1(x) /* wrapper y1 */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper y1 */
|
||||
double
|
||||
y1 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y1(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_y1(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
if(x==0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return __kernel_standard(x,x,10);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 11);
|
||||
}
|
||||
if(x>X_TLOSS) {
|
||||
return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
else if (x == 0.0)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard (x, x, 10);
|
||||
else
|
||||
/* y1(x>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 37);
|
||||
}
|
||||
|
||||
return __ieee754_y1 (x);
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (y1, y1l)
|
||||
|
104
math/w_j1f.c
104
math/w_j1f.c
@ -1,75 +1,59 @@
|
||||
/* w_j1f.c -- float version of w_j1.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_j1f.c,v 1.3 1995/05/10 20:49:17 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.
|
||||
|
||||
/*
|
||||
* wrapper of j1f,y1f
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float j1f(float x) /* wrapper j1f */
|
||||
#else
|
||||
float j1f(x) /* wrapper j1f */
|
||||
float x;
|
||||
#endif
|
||||
|
||||
/* wrapper j1f */
|
||||
float
|
||||
j1f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_j1f(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_j1f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
|
||||
if(fabsf(x)>(float)X_TLOSS) {
|
||||
if (__builtin_expect (fabsf (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* j1(|x|>X_TLOSS) */
|
||||
return (float)__kernel_standard((double)x,(double)x,136);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
return __kernel_standard_f (x, x, 136);
|
||||
|
||||
return __ieee754_j1f (x);
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
float y1f(float x) /* wrapper y1f */
|
||||
#else
|
||||
float y1f(x) /* wrapper y1f */
|
||||
float x;
|
||||
#endif
|
||||
|
||||
/* wrapper y1f */
|
||||
float
|
||||
y1f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y1f(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_y1f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
|
||||
if(x <= (float)0.0){
|
||||
if(x==(float)0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return (float)__kernel_standard((double)x,(double)x,110);
|
||||
if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0f)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 111);
|
||||
}
|
||||
else if (x == 0.0f)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard_f (x, x, 110);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
return (float)__kernel_standard((double)x,(double)x,111);
|
||||
}
|
||||
if(x>(float)X_TLOSS) {
|
||||
/* y1(x>X_TLOSS) */
|
||||
return (float)__kernel_standard((double)x,(double)x,137);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
return __kernel_standard_f (x, x, 137);
|
||||
}
|
||||
|
||||
return __ieee754_y1f (x);
|
||||
}
|
||||
|
102
math/w_j1l.c
102
math/w_j1l.c
@ -1,76 +1,60 @@
|
||||
/* w_j1l.c -- long double version of w_j1.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper of j1l,y1l
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __j1l(long double x) /* wrapper j1l */
|
||||
#else
|
||||
long double __j1l(x) /* wrapper j1l */
|
||||
long double x;
|
||||
#endif
|
||||
|
||||
/* wrapper j1l */
|
||||
long double
|
||||
__j1l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsl (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* j1(|x|>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 236);
|
||||
|
||||
return __ieee754_j1l (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_j1l(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
|
||||
if(fabsl(x)>X_TLOSS) {
|
||||
return __kernel_standard(x,x,236); /* j1(|x|>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__j1l, j1l)
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __y1l(long double x) /* wrapper y1l */
|
||||
#else
|
||||
long double __y1l(x) /* wrapper y1l */
|
||||
long double x;
|
||||
#endif
|
||||
|
||||
/* wrapper y1l */
|
||||
long double
|
||||
__y1l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_y1l(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_y1l(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
if(x==0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return __kernel_standard(x,x,210);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
if (__builtin_expect (x <= 0.0L || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0L)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 211);
|
||||
}
|
||||
if(x>X_TLOSS) {
|
||||
return __kernel_standard(x,x,237); /* y1(x>X_TLOSS) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
else if (x == 0.0L)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard (x, x, 210);
|
||||
else
|
||||
/* y1(x>X_TLOSS) */
|
||||
return __kernel_standard (x, x, 237);
|
||||
}
|
||||
|
||||
return __ieee754_y1l (x);
|
||||
}
|
||||
weak_alias (__y1l, y1l)
|
||||
|
123
math/w_jn.c
123
math/w_jn.c
@ -1,98 +1,63 @@
|
||||
/* @(#)w_jn.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_jn.c,v 1.6 1995/05/10 20:49:19 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper jn(int n, double x), yn(int n, double x)
|
||||
* floating point Bessel's function of the 1st and 2nd kind
|
||||
* of order n
|
||||
*
|
||||
* Special cases:
|
||||
* y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal;
|
||||
* y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal.
|
||||
* Note 2. About jn(n,x), yn(n,x)
|
||||
* For n=0, j0(x) is called,
|
||||
* for n=1, j1(x) is called,
|
||||
* for n<x, forward recursion us used starting
|
||||
* from values of j0(x) and j1(x).
|
||||
* for n>x, a continued fraction approximation to
|
||||
* j(n,x)/j(n-1,x) is evaluated and then backward
|
||||
* recursion is used starting from a supposed value
|
||||
* for j(n,x). The resulting value of j(0,x) is
|
||||
* compared with the actual value to correct the
|
||||
* supposed value of j(n,x).
|
||||
*
|
||||
* yn(n,x) is similar in all respects, except
|
||||
* that forward recursion is used for all
|
||||
* values of n>1.
|
||||
*
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double jn(int n, double x) /* wrapper jn */
|
||||
#else
|
||||
double jn(n,x) /* wrapper jn */
|
||||
double x; int n;
|
||||
#endif
|
||||
|
||||
/* wrapper jn */
|
||||
double
|
||||
jn (int n, double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabs (x) > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
/* jn(n,|x|>X_TLOSS) */
|
||||
return __kernel_standard (n, x, 38);
|
||||
|
||||
return __ieee754_jn (n, x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_jn(n,x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
|
||||
if(fabs(x)>X_TLOSS) {
|
||||
return __kernel_standard((double)n,x,38); /* jn(|x|>X_TLOSS,n) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (jn, jnl)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double yn(int n, double x) /* wrapper yn */
|
||||
#else
|
||||
double yn(n,x) /* wrapper yn */
|
||||
double x; int n;
|
||||
#endif
|
||||
/* wrapper yn */
|
||||
double
|
||||
yn (int n, double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_yn(n,x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_yn(n,x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) ) return z;
|
||||
if(x <= 0.0){
|
||||
if(x==0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return __kernel_standard((double)n,x,12);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
return __kernel_standard((double)n,x,13);
|
||||
if (__builtin_expect (x <= 0.0 || x > X_TLOSS, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (n, x, 13);
|
||||
}
|
||||
if(x>X_TLOSS) {
|
||||
return __kernel_standard((double)n,x,39); /* yn(x>X_TLOSS,n) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
else if (x == 0.0)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard (n, x, 12);
|
||||
else
|
||||
/* yn(n,x>X_TLOSS) */
|
||||
return __kernel_standard (n, x, 39);
|
||||
}
|
||||
|
||||
return __ieee754_yn (n, x);
|
||||
}
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
strong_alias (yn, ynl)
|
||||
|
103
math/w_jnf.c
103
math/w_jnf.c
@ -1,71 +1,60 @@
|
||||
/* w_jnf.c -- float version of w_jn.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_jnf.c,v 1.3 1995/05/10 20:49:21 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float jnf(int n, float x) /* wrapper jnf */
|
||||
#else
|
||||
float jnf(n,x) /* wrapper jnf */
|
||||
float x; int n;
|
||||
#endif
|
||||
|
||||
/* wrapper jnf */
|
||||
float
|
||||
jnf (int n, float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (__builtin_expect (fabsf (x) > (float) X_TLOSS, 0)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
/* jn(n,|x|>X_TLOSS) */
|
||||
return __kernel_standard_f (n, x, 138);
|
||||
|
||||
return __ieee754_jnf (n, x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_jnf(n,x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
|
||||
if(fabsf(x)>(float)X_TLOSS) {
|
||||
/* jn(|x|>X_TLOSS,n) */
|
||||
return (float)__kernel_standard((double)n,(double)x,138);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
float ynf(int n, float x) /* wrapper ynf */
|
||||
#else
|
||||
float ynf(n,x) /* wrapper ynf */
|
||||
float x; int n;
|
||||
#endif
|
||||
|
||||
/* wrapper ynf */
|
||||
float
|
||||
ynf (int n, float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_ynf(n,x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_ynf(n,x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) ) return z;
|
||||
if(x <= (float)0.0){
|
||||
if(x==(float)0.0)
|
||||
/* d= -one/(x-x); */
|
||||
return (float)__kernel_standard((double)n,(double)x,112);
|
||||
if (__builtin_expect (x <= 0.0f || x > (float) X_TLOSS, 0)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x < 0.0f)
|
||||
{
|
||||
/* d = zero/(x-x) */
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (n, x, 113);
|
||||
}
|
||||
else if (x == 0.0)
|
||||
/* d = -one/(x-x) */
|
||||
return __kernel_standard_f (n, x, 112);
|
||||
else
|
||||
/* d = zero/(x-x); */
|
||||
return (float)__kernel_standard((double)n,(double)x,113);
|
||||
/* yn(n,x>X_TLOSS) */
|
||||
return __kernel_standard_f (n, x, 139);
|
||||
}
|
||||
if(x>(float)X_TLOSS) {
|
||||
/* yn(x>X_TLOSS,n) */
|
||||
return (float)__kernel_standard((double)n,(double)x,139);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_ynf (n, x);
|
||||
}
|
||||
|
@ -10,10 +10,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/* double lgamma(double x)
|
||||
* Return the logarithm of the Gamma function of x.
|
||||
*
|
||||
@ -23,31 +19,24 @@ static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __lgamma(double x)
|
||||
#else
|
||||
double __lgamma(x)
|
||||
double x;
|
||||
#endif
|
||||
double
|
||||
__lgamma(double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgamma_r(x,&signgam);
|
||||
#else
|
||||
double y;
|
||||
int local_signgam = 0;
|
||||
y = __ieee754_lgamma_r(x,&local_signgam);
|
||||
if (_LIB_VERSION != _ISOC_)
|
||||
/* ISO C99 does not define the global variable. */
|
||||
signgam = local_signgam;
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finite(y)&&__finite(x)) {
|
||||
if(__floor(x)==x&&x<=0.0)
|
||||
return __kernel_standard(x,x,15); /* lgamma pole */
|
||||
else
|
||||
return __kernel_standard(x,x,14); /* lgamma overflow */
|
||||
} else
|
||||
double y = __ieee754_lgamma_r(x,
|
||||
_LIB_VERSION != _ISOC_
|
||||
/* ISO C99 does not define the
|
||||
global variable. */
|
||||
? &signgam
|
||||
: &local_signgam);
|
||||
if(__builtin_expect(!__finite(y), 0)
|
||||
&& __finite(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, x,
|
||||
__floor(x)==x&&x<=0.0
|
||||
? 15 /* lgamma pole */
|
||||
: 14); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgamma, lgamma)
|
||||
strong_alias (__lgamma, __gamma)
|
||||
|
@ -10,10 +10,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_lgamma_r.c,v 1.6 1995/05/10 20:49:27 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper double lgamma_r(double x, int *signgamp)
|
||||
*/
|
||||
@ -22,27 +18,18 @@ static char rcsid[] = "$NetBSD: w_lgamma_r.c,v 1.6 1995/05/10 20:49:27 jtc Exp $
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
|
||||
#else
|
||||
double __lgamma_r(x,signgamp) /* wrapper lgamma_r */
|
||||
double x; int *signgamp;
|
||||
#endif
|
||||
double
|
||||
__lgamma_r(double x, int *signgamp)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgamma_r(x,signgamp);
|
||||
#else
|
||||
double y;
|
||||
y = __ieee754_lgamma_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finite(y)&&__finite(x)) {
|
||||
if(__floor(x)==x&&x<=0.0)
|
||||
return __kernel_standard(x,x,15); /* lgamma pole */
|
||||
else
|
||||
return __kernel_standard(x,x,14); /* lgamma overflow */
|
||||
} else
|
||||
double y = __ieee754_lgamma_r(x,signgamp);
|
||||
if(__builtin_expect(!__finite(y), 0)
|
||||
&& __finite(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, x,
|
||||
__floor(x)==x&&x<=0.0
|
||||
? 15 /* lgamma pole */
|
||||
: 14); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgamma_r, lgamma_r)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -13,40 +13,27 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_lgammaf.c,v 1.3 1995/05/10 20:49:30 jtc Exp $";
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __lgammaf(float x)
|
||||
#else
|
||||
float __lgammaf(x)
|
||||
float x;
|
||||
#endif
|
||||
float
|
||||
__lgammaf(float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgammaf_r(x,&signgam);
|
||||
#else
|
||||
float y;
|
||||
int local_signgam = 0;
|
||||
y = __ieee754_lgammaf_r(x,&local_signgam);
|
||||
if (_LIB_VERSION != _ISOC_)
|
||||
/* ISO C99 does not define the global variable. */
|
||||
signgam = local_signgam;
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finitef(y)&&__finitef(x)) {
|
||||
if(__floorf(x)==x&&x<=(float)0.0)
|
||||
/* lgamma pole */
|
||||
return (float)__kernel_standard((double)x,(double)x,115);
|
||||
else
|
||||
/* lgamma overflow */
|
||||
return (float)__kernel_standard((double)x,(double)x,114);
|
||||
} else
|
||||
float y = __ieee754_lgammaf_r(x,
|
||||
_LIB_VERSION != _ISOC_
|
||||
/* ISO C99 does not define the
|
||||
global variable. */
|
||||
? &signgam
|
||||
: &local_signgam);
|
||||
if(__builtin_expect(!__finitef(y), 0)
|
||||
&& __finitef(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f(x, x,
|
||||
__floorf(x)==x&&x<=0.0f
|
||||
? 115 /* lgamma pole */
|
||||
: 114); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgammaf, lgammaf)
|
||||
strong_alias (__lgammaf, __gammaf)
|
||||
|
@ -13,10 +13,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_lgammaf_r.c,v 1.3 1995/05/10 20:49:32 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper float lgammaf_r(float x, int *signgamp)
|
||||
*/
|
||||
@ -25,28 +21,17 @@ static char rcsid[] = "$NetBSD: w_lgammaf_r.c,v 1.3 1995/05/10 20:49:32 jtc Exp
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
|
||||
#else
|
||||
float __lgammaf_r(x,signgamp) /* wrapper lgammaf_r */
|
||||
float x; int *signgamp;
|
||||
#endif
|
||||
float
|
||||
__lgammaf_r(float x, int *signgamp)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgammaf_r(x,signgamp);
|
||||
#else
|
||||
float y;
|
||||
y = __ieee754_lgammaf_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finitef(y)&&__finitef(x)) {
|
||||
if(__floorf(x)==x&&x<=(float)0.0)
|
||||
/* lgamma pole */
|
||||
return (float)__kernel_standard((double)x,(double)x,115);
|
||||
else
|
||||
/* lgamma overflow */
|
||||
return (float)__kernel_standard((double)x,(double)x,114);
|
||||
} else
|
||||
float y = __ieee754_lgammaf_r(x,signgamp);
|
||||
if(__builtin_expect(!__finitef(y), 0)
|
||||
&& __finitef(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f(x, x,
|
||||
__floorf(x)==x&&x<=0.0f
|
||||
? 115 /* lgamma pole */
|
||||
: 114); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgammaf_r, lgammaf_r)
|
||||
|
@ -14,10 +14,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: $";
|
||||
#endif
|
||||
|
||||
/* long double lgammal(long double x)
|
||||
* Return the logarithm of the Gamma function of x.
|
||||
*
|
||||
@ -27,31 +23,24 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __lgammal(long double x)
|
||||
#else
|
||||
long double __lgammal(x)
|
||||
long double x;
|
||||
#endif
|
||||
long double
|
||||
__lgammal(long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgammal_r(x,&signgam);
|
||||
#else
|
||||
long double y;
|
||||
int local_signgam = 0;
|
||||
y = __ieee754_lgammal_r(x,&local_signgam);
|
||||
if (_LIB_VERSION != _ISOC_)
|
||||
/* ISO C99 does not define the global variable. */
|
||||
signgam = local_signgam;
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finitel(y)&&__finitel(x)) {
|
||||
if(__floorl(x)==x&&x<=0.0)
|
||||
return __kernel_standard(x,x,215); /* lgamma pole */
|
||||
else
|
||||
return __kernel_standard(x,x,214); /* lgamma overflow */
|
||||
} else
|
||||
long double y = __ieee754_lgammal_r(x,
|
||||
_LIB_VERSION != _ISOC_
|
||||
/* ISO C99 does not define the
|
||||
global variable. */
|
||||
? &signgam
|
||||
: &local_signgam);
|
||||
if(__builtin_expect(!__finitel(y), 0)
|
||||
&& __finitel(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, x,
|
||||
__floorl(x)==x&&x<=0.0L
|
||||
? 215 /* lgamma pole */
|
||||
: 214); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgammal, lgammal)
|
||||
strong_alias (__lgammal, __gammal)
|
||||
|
@ -14,10 +14,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper long double lgammal_r(long double x, int *signgamp)
|
||||
*/
|
||||
@ -26,27 +22,17 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __lgammal_r(long double x, int *signgamp)
|
||||
/* wrapper lgamma_r */
|
||||
#else
|
||||
long double __lgammal_r(x,signgamp) /* wrapper lgamma_r */
|
||||
long double x; int *signgamp;
|
||||
#endif
|
||||
long double
|
||||
__lgammal_r(long double x, int *signgamp)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_lgammal_r(x,signgamp);
|
||||
#else
|
||||
long double y;
|
||||
y = __ieee754_lgammal_r(x,signgamp);
|
||||
if(_LIB_VERSION == _IEEE_) return y;
|
||||
if(!__finitel(y)&&__finitel(x)) {
|
||||
if(__floorl(x)==x&&x<=0.0)
|
||||
return __kernel_standard(x,x,215); /* lgamma pole */
|
||||
else
|
||||
return __kernel_standard(x,x,214); /* lgamma overflow */
|
||||
} else
|
||||
long double y = __ieee754_lgammal_r(x,signgamp);
|
||||
if(__builtin_expect(!__finitel(y), 0)
|
||||
&& __finitel(x) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard(x, x,
|
||||
__floorl(x)==x&&x<=0.0
|
||||
? 215 /* lgamma pole */
|
||||
: 214); /* lgamma overflow */
|
||||
|
||||
return y;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__lgammal_r, lgammal_r)
|
||||
|
61
math/w_log.c
61
math/w_log.c
@ -1,45 +1,46 @@
|
||||
/* @(#)w_log.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_log.c,v 1.6 1995/05/10 20:49:33 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper log(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __log(double x) /* wrapper log */
|
||||
#else
|
||||
double __log(x) /* wrapper log */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper log(x) */
|
||||
double
|
||||
__log (double x)
|
||||
{
|
||||
if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_log(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x) || x > 0.0) return z;
|
||||
if (x == 0.0)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 16); /* log(0) */
|
||||
}
|
||||
else
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 17); /* log(x<0) */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log (x);
|
||||
}
|
||||
weak_alias (__log, log)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,48 +1,46 @@
|
||||
/* @(#)w_log10.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_log10.c,v 1.6 1995/05/10 20:49:35 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper log10(X)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __log10(double x) /* wrapper log10 */
|
||||
#else
|
||||
double __log10(x) /* wrapper log10 */
|
||||
double x;
|
||||
#endif
|
||||
/* wrapper log10(x) */
|
||||
double
|
||||
__log10 (double x)
|
||||
{
|
||||
if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log10(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_log10(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(x<=0.0) {
|
||||
if (x == 0.0)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 18); /* log10(0) */
|
||||
}
|
||||
else
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 19); /* log10(x<0) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log10 (x);
|
||||
}
|
||||
weak_alias (__log10, log10)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,52 +1,45 @@
|
||||
/* w_log10f.c -- float version of w_log10.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_log10f.c,v 1.3 1995/05/10 20:49:37 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.
|
||||
|
||||
/*
|
||||
* wrapper log10f(X)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __log10f(float x) /* wrapper log10f */
|
||||
#else
|
||||
float __log10f(x) /* wrapper log10f */
|
||||
float x;
|
||||
#endif
|
||||
/* wrapper log10f(x) */
|
||||
float
|
||||
__log10f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log10f(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_log10f(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x)) return z;
|
||||
if(x<=(float)0.0) {
|
||||
if(x==(float)0.0)
|
||||
/* log10(0) */
|
||||
return (float)__kernel_standard((double)x,(double)x,118);
|
||||
if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0f)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard_f (x, x, 118); /* log10(0) */
|
||||
}
|
||||
else
|
||||
/* log10(x<0) */
|
||||
return (float)__kernel_standard((double)x,(double)x,119);
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 119); /* log10(x<0) */
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log10f (x);
|
||||
}
|
||||
weak_alias (__log10f, log10f)
|
||||
|
@ -1,51 +1,45 @@
|
||||
/* w_log10l.c -- long double version of w_log10.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper log10l(X)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __log10l(long double x) /* wrapper log10l */
|
||||
#else
|
||||
long double __log10l(x) /* wrapper log10l */
|
||||
long double x;
|
||||
#endif
|
||||
/* wrapper log10l(x) */
|
||||
long double
|
||||
__log10l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log10l(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_log10l(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
|
||||
if(x<=0.0) {
|
||||
if(x==0.0)
|
||||
if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0L)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 218); /* log10(0) */
|
||||
}
|
||||
else
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 219); /* log10(x<0) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log10l (x);
|
||||
}
|
||||
weak_alias (__log10l, log10l)
|
||||
|
@ -1,29 +1,46 @@
|
||||
/*
|
||||
* wrapper log2(X)
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
/* wrapper log2(x) */
|
||||
double
|
||||
__log2 (double x) /* wrapper log2 */
|
||||
__log2 (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log2 (x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_log2 (x);
|
||||
if (_LIB_VERSION == _IEEE_ || __isnan (x)) return z;
|
||||
if (x <= 0.0)
|
||||
if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 48); /* log2(0) */
|
||||
else
|
||||
return __kernel_standard (x, x, 49); /* log2 (x < 0) */
|
||||
}
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 49); /* log2(x<0) */
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log2 (x);
|
||||
}
|
||||
weak_alias (__log2, log2)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,30 +1,45 @@
|
||||
/*
|
||||
* wrapper log2(X)
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
/* wrapper log2f(x) */
|
||||
float
|
||||
__log2f (float x) /* wrapper log2f */
|
||||
__log2f (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log2f (x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_log2f (x);
|
||||
if (_LIB_VERSION == _IEEE_ || __isnanf (x)) return z;
|
||||
if (x <= 0.0f)
|
||||
if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0f)
|
||||
/* log2f (0) */
|
||||
return __kernel_standard ((double) x, (double) x, 148);
|
||||
else
|
||||
/* log2f (x < 0) */
|
||||
return __kernel_standard ((double) x, (double) x, 149);
|
||||
if (x == 0.0)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard_f (x, x, 148); /* log2(0) */
|
||||
}
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 149); /* log2(x<0) */
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log2f (x);
|
||||
}
|
||||
weak_alias (__log2f, log2f)
|
||||
|
@ -1,28 +1,45 @@
|
||||
/*
|
||||
* wrapper log2l(X)
|
||||
*/
|
||||
/* Copyright (C) 2011 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
/* wrapper log2l(x) */
|
||||
long double
|
||||
__log2l (long double x) /* wrapper log2l */
|
||||
__log2l (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_log2l (x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_log2l (x);
|
||||
if (_LIB_VERSION == _IEEE_ || __isnanl (x)) return z;
|
||||
if (x <= 0.0)
|
||||
if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0)
|
||||
return __kernel_standard (x, x, 248); /* log2l (0) */
|
||||
else
|
||||
return __kernel_standard (x, x, 249); /* log2l (x < 0) */
|
||||
if (x == 0.0L)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 248); /* log2(0) */
|
||||
}
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 249); /* log2(x<0) */
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_log2l (x);
|
||||
}
|
||||
weak_alias (__log2l, log2l)
|
||||
|
@ -1,49 +1,45 @@
|
||||
/* w_logf.c -- float version of w_log.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_logf.c,v 1.3 1995/05/10 20:49:40 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.
|
||||
|
||||
/*
|
||||
* wrapper logf(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __logf(float x) /* wrapper logf */
|
||||
#else
|
||||
float __logf(x) /* wrapper logf */
|
||||
float x;
|
||||
#endif
|
||||
/* wrapper logf(x) */
|
||||
float
|
||||
__logf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_logf(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_logf(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(x) || x > (float)0.0) return z;
|
||||
if(x==(float)0.0)
|
||||
/* logf(0) */
|
||||
return (float)__kernel_standard((double)x,(double)x,116);
|
||||
if (__builtin_expect (x <= 0.0f, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0f)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard_f (x, x, 116); /* log(0) */
|
||||
}
|
||||
else
|
||||
/* logf(x<0) */
|
||||
return (float)__kernel_standard((double)x,(double)x,117);
|
||||
#endif
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard_f (x, x, 117); /* log(x<0) */
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_logf (x);
|
||||
}
|
||||
weak_alias (__logf, logf)
|
||||
|
@ -1,48 +1,45 @@
|
||||
/* w_logl.c -- long double version of w_log.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper logl(x)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __logl(long double x) /* wrapper logl */
|
||||
#else
|
||||
long double __logl(x) /* wrapper logl */
|
||||
long double x;
|
||||
#endif
|
||||
/* wrapper logl(x) */
|
||||
long double
|
||||
__logl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_logl(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_logl(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(x) || x > 0.0) return z;
|
||||
if(x==0.0)
|
||||
if (__builtin_expect (x <= 0.0L, 0) && _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0L)
|
||||
{
|
||||
feraiseexcept (FE_DIVBYZERO);
|
||||
return __kernel_standard (x, x, 216); /* log(0) */
|
||||
}
|
||||
else
|
||||
{
|
||||
feraiseexcept (FE_INVALID);
|
||||
return __kernel_standard (x, x, 217); /* log(x<0) */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return __ieee754_logl (x);
|
||||
}
|
||||
weak_alias (__logl, logl)
|
||||
|
105
math/w_pow.c
105
math/w_pow.c
@ -1,67 +1,76 @@
|
||||
/* Copyright (C) 2011 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.
|
||||
|
||||
/* @(#)w_pow.c 5.2 93/10/01 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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 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.
|
||||
|
||||
/*
|
||||
* wrapper pow(x,y) return x**y
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
double __pow(double x, double y) /* wrapper pow */
|
||||
#else
|
||||
double __pow(x,y) /* wrapper pow */
|
||||
double x,y;
|
||||
#endif
|
||||
/* wrapper pow */
|
||||
double
|
||||
__pow (double x, double y)
|
||||
{
|
||||
double z = __ieee754_pow (x, y);
|
||||
if (__builtin_expect (!__finite (z), 0))
|
||||
{
|
||||
if (_LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (__isnan (x))
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_pow(x,y);
|
||||
#else
|
||||
double z;
|
||||
z=__ieee754_pow(x,y);
|
||||
if(_LIB_VERSION == _IEEE_|| __isnan(y)) return z;
|
||||
if(__isnan(x)) {
|
||||
if (y == 0.0)
|
||||
return __kernel_standard(x,y,42); /* pow(NaN,0.0) */
|
||||
else
|
||||
return z;
|
||||
/* pow(NaN,0.0) */
|
||||
return __kernel_standard (x, y, 42);
|
||||
}
|
||||
if(x==0.0) {
|
||||
if(y==0.0)
|
||||
return __kernel_standard(x,y,20); /* pow(0.0,0.0) */
|
||||
if(__finite(y)&&y<0.0) {
|
||||
if (signbit (x) && signbit (z))
|
||||
return __kernel_standard(x,y,23); /* pow(-0.0,negative) */
|
||||
else
|
||||
return __kernel_standard(x,y,43); /* pow(+0.0,negative) */
|
||||
}
|
||||
return z;
|
||||
}
|
||||
if(!__finite(z)) {
|
||||
if(__finite(x)&&__finite(y)) {
|
||||
else if (__finite (x) && __finite (y))
|
||||
{
|
||||
if (__isnan (z))
|
||||
return __kernel_standard(x,y,24); /* pow neg**non-int */
|
||||
/* pow neg**non-int */
|
||||
return __kernel_standard (x, y, 24);
|
||||
else if (x == 0.0 && y < 0.0)
|
||||
{
|
||||
if (signbit (x) && signbit (z))
|
||||
/* pow(-0.0,negative) */
|
||||
return __kernel_standard (x, y, 23);
|
||||
else
|
||||
return __kernel_standard(x,y,21); /* pow overflow */
|
||||
/* pow(+0.0,negative) */
|
||||
return __kernel_standard (x, y, 43);
|
||||
}
|
||||
else
|
||||
/* pow overflow */
|
||||
return __kernel_standard (x, y, 21);
|
||||
}
|
||||
}
|
||||
if(z==0.0&&__finite(x)&&__finite(y))
|
||||
return __kernel_standard(x,y,22); /* pow underflow */
|
||||
}
|
||||
else if (__builtin_expect (z == 0.0, 0) && __finite (x) && __finite (y)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0)
|
||||
{
|
||||
if (y == 0.0)
|
||||
/* pow(0.0,0.0) */
|
||||
return __kernel_standard (x, y, 20);
|
||||
}
|
||||
else
|
||||
/* pow underflow */
|
||||
return __kernel_standard (x, y, 22);
|
||||
}
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__pow, pow)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
118
math/w_powf.c
118
math/w_powf.c
@ -1,77 +1,75 @@
|
||||
/* w_powf.c -- float version of w_pow.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_powf.c,v 1.3 1995/05/10 20:49:41 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.
|
||||
|
||||
/*
|
||||
* wrapper powf(x,y) return x**y
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
float __powf(float x, float y) /* wrapper powf */
|
||||
#else
|
||||
float __powf(x,y) /* wrapper powf */
|
||||
float x,y;
|
||||
#endif
|
||||
/* wrapper powf */
|
||||
float
|
||||
__powf (float x, float y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_powf(x,y);
|
||||
#else
|
||||
float z;
|
||||
z=__ieee754_powf(x,y);
|
||||
if(_LIB_VERSION == _IEEE_|| __isnanf(y)) return z;
|
||||
if(__isnanf(x)) {
|
||||
if(y==(float)0.0)
|
||||
/* powf(NaN,0.0) */
|
||||
return (float)__kernel_standard((double)x,(double)y,142);
|
||||
else
|
||||
return z;
|
||||
float z = __ieee754_powf (x, y);
|
||||
if (__builtin_expect (!__finitef (z), 0))
|
||||
{
|
||||
if (_LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (__isnanf (x))
|
||||
{
|
||||
if (y == 0.0f)
|
||||
/* pow(NaN,0.0) */
|
||||
return __kernel_standard_f (x, y, 142);
|
||||
}
|
||||
if(x==(float)0.0) {
|
||||
if(y==(float)0.0)
|
||||
/* powf(0.0,0.0) */
|
||||
return (float)__kernel_standard((double)x,(double)y,120);
|
||||
if(__finitef(y)&&y<(float)0.0) {
|
||||
if (signbit (x) && signbit (z))
|
||||
/* powf(0.0,negative) */
|
||||
return (float)__kernel_standard((double)x,(double)y,123);
|
||||
else
|
||||
return (float)__kernel_standard((double)x,(double)y,143);
|
||||
}
|
||||
return z;
|
||||
}
|
||||
if(!__finitef(z)) {
|
||||
if(__finitef(x)&&__finitef(y)) {
|
||||
else if (__finitef (x) && __finitef (y))
|
||||
{
|
||||
if (__isnanf (z))
|
||||
/* powf neg**non-int */
|
||||
return (float)__kernel_standard((double)x,(double)y,124);
|
||||
/* pow neg**non-int */
|
||||
return __kernel_standard_f (x, y, 124);
|
||||
else if (x == 0.0f && y < 0.0f)
|
||||
{
|
||||
if (signbit (x) && signbit (z))
|
||||
/* pow(-0.0,negative) */
|
||||
return __kernel_standard_f (x, y, 123);
|
||||
else
|
||||
/* powf overflow */
|
||||
return (float)__kernel_standard((double)x,(double)y,121);
|
||||
/* pow(+0.0,negative) */
|
||||
return __kernel_standard_f (x, y, 143);
|
||||
}
|
||||
else
|
||||
/* pow overflow */
|
||||
return __kernel_standard_f (x, y, 121);
|
||||
}
|
||||
}
|
||||
if(z==(float)0.0&&__finitef(x)&&__finitef(y))
|
||||
/* powf underflow */
|
||||
return (float)__kernel_standard((double)x,(double)y,122);
|
||||
}
|
||||
else if (__builtin_expect (z == 0.0f, 0) && __finitef (x) && __finitef (y)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0f)
|
||||
{
|
||||
if (y == 0.0f)
|
||||
/* pow(0.0,0.0) */
|
||||
return __kernel_standard_f (x, y, 120);
|
||||
}
|
||||
else
|
||||
/* pow underflow */
|
||||
return __kernel_standard_f (x, y, 122);
|
||||
}
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__powf, powf)
|
||||
|
111
math/w_powl.c
111
math/w_powl.c
@ -1,68 +1,75 @@
|
||||
/* w_powl.c -- long double version of w_pow.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
|
||||
/*
|
||||
* wrapper powl(x,y) return x**y
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __powl(long double x, long double y)/* wrapper powl */
|
||||
#else
|
||||
long double __powl(x,y) /* wrapper powl */
|
||||
long double x,y;
|
||||
#endif
|
||||
/* wrapper powl */
|
||||
long double
|
||||
__powl (long double x, long double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_powl(x,y);
|
||||
#else
|
||||
long double z;
|
||||
z=__ieee754_powl(x,y);
|
||||
if(_LIB_VERSION == _IEEE_|| __isnanl(y)) return z;
|
||||
if(__isnanl(x)) {
|
||||
if(y==0.0)
|
||||
return __kernel_standard(x,y,242); /* pow(NaN,0.0) */
|
||||
else
|
||||
return z;
|
||||
long double z = __ieee754_powl (x, y);
|
||||
if (__builtin_expect (!__finitel (z), 0))
|
||||
{
|
||||
if (_LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (__isnanl (x))
|
||||
{
|
||||
if (y == 0.0L)
|
||||
/* pow(NaN,0.0) */
|
||||
return __kernel_standard (x, y, 242);
|
||||
}
|
||||
if(x==0.0) {
|
||||
if(y==0.0)
|
||||
return __kernel_standard(x,y,220); /* pow(0.0,0.0) */
|
||||
if(__finitel(y)&&y<0.0) {
|
||||
if (signbit (x) && signbit (z))
|
||||
return __kernel_standard(x,y,223); /* pow(-0.0,negative) */
|
||||
else
|
||||
return __kernel_standard(x,y,243); /* pow(+0.0,negative) */
|
||||
}
|
||||
return z;
|
||||
}
|
||||
if(!__finitel(z)) {
|
||||
if(__finitel(x)&&__finitel(y)) {
|
||||
else if (__finitel (x) && __finitel (y))
|
||||
{
|
||||
if (__isnanl (z))
|
||||
return __kernel_standard(x,y,224); /* pow neg**non-int */
|
||||
/* pow neg**non-int */
|
||||
return __kernel_standard (x, y, 224);
|
||||
else if (x == 0.0L && y < 0.0L)
|
||||
{
|
||||
if (signbit (x) && signbit (z))
|
||||
/* pow(-0.0,negative) */
|
||||
return __kernel_standard (x, y, 223);
|
||||
else
|
||||
return __kernel_standard(x,y,221); /* pow overflow */
|
||||
/* pow(+0.0,negative) */
|
||||
return __kernel_standard (x, y, 243);
|
||||
}
|
||||
else
|
||||
/* pow overflow */
|
||||
return __kernel_standard (x, y, 221);
|
||||
}
|
||||
}
|
||||
if(z==0.0&&__finitel(x)&&__finitel(y))
|
||||
return __kernel_standard(x,y,222); /* pow underflow */
|
||||
}
|
||||
else if (__builtin_expect (z == 0.0L, 0) && __finitel (x) && __finitel (y)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
{
|
||||
if (x == 0.0L)
|
||||
{
|
||||
if (y == 0.0L)
|
||||
/* pow(0.0,0.0) */
|
||||
return __kernel_standard (x, y, 220);
|
||||
}
|
||||
else
|
||||
/* pow underflow */
|
||||
return __kernel_standard (x, y, 222);
|
||||
}
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__powl, powl)
|
||||
|
@ -1,44 +1,36 @@
|
||||
/* @(#)w_remainder.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_remainder.c,v 1.6 1995/05/10 20:49:44 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper remainder(x,p)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __remainder(double x, double y) /* wrapper remainder */
|
||||
#else
|
||||
double __remainder(x,y) /* wrapper remainder */
|
||||
double x,y;
|
||||
#endif
|
||||
|
||||
/* wrapper remainder */
|
||||
double
|
||||
__remainder (double x, double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (((__builtin_expect (y == 0.0, 0) && ! __isnan (x))
|
||||
|| (__builtin_expect (__isinf_ns (x), 0) && ! __isnan (y)))
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, y, 28); /* remainder domain */
|
||||
|
||||
return __ieee754_remainder (x, y);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_remainder(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(y) || __isnan(x)) return z;
|
||||
if(y==0.0 || __isinf_ns(x))
|
||||
return __kernel_standard(x,y,28); /* remainder(x,0) */
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__remainder, remainder)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,47 +1,35 @@
|
||||
/* w_remainderf.c -- float version of w_remainder.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_remainderf.c,v 1.3 1995/05/10 20:49:46 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.
|
||||
|
||||
/*
|
||||
* wrapper remainderf(x,p)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __remainderf(float x, float y) /* wrapper remainder */
|
||||
#else
|
||||
float __remainderf(x,y) /* wrapper remainder */
|
||||
float x,y;
|
||||
#endif
|
||||
|
||||
/* wrapper remainderf */
|
||||
float
|
||||
__remainderf (float x, float y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (((__builtin_expect (y == 0.0f, 0) && ! __isnanf (x))
|
||||
|| (__builtin_expect (__isinf_nsf (x), 0) && ! __isnanf (y)))
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f (x, y, 128); /* remainder domain */
|
||||
|
||||
return __ieee754_remainderf (x, y);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_remainderf(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanf(y) || __isnanf(x)) return z;
|
||||
if(y==(float)0.0 || __isinf_nsf(x))
|
||||
/* remainder(x,0) */
|
||||
return (float)__kernel_standard((double)x,(double)y,128);
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__remainderf, remainderf)
|
||||
|
@ -1,48 +1,35 @@
|
||||
/* w_remainderl.c -- long double version of w_remainder.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper remainderl(x,p)
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __remainderl(long double x, long double y)
|
||||
|
||||
/* wrapper remainderl */
|
||||
#else
|
||||
long double __remainderl(x,y) /* wrapper remainder */
|
||||
long double x,y;
|
||||
#endif
|
||||
long double
|
||||
__remainderl (long double x, long double y)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
if (((__builtin_expect (y == 0.0L, 0) && ! __isnanl (x))
|
||||
|| (__builtin_expect (__isinf_nsl (x), 0) && ! __isnanl (y)))
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, y, 228); /* remainder domain */
|
||||
|
||||
return __ieee754_remainderl (x, y);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_remainderl(x,y);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnanl(y) || __isnanl(x)) return z;
|
||||
if(y==0.0 || __isinf_nsl(x))
|
||||
return __kernel_standard(x,y,228); /* remainder(x,0) */
|
||||
else
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__remainderl, remainderl)
|
||||
|
@ -1,62 +1,54 @@
|
||||
/* @(#)w_scalb.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper scalb(double x, double fn) is provide for
|
||||
* passing various standard test suite. One
|
||||
* should use scalbn() instead.
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
#ifdef _SCALB_INT
|
||||
double __scalb(double x, int fn) /* wrapper scalb */
|
||||
#else
|
||||
double __scalb(double x, double fn) /* wrapper scalb */
|
||||
#endif
|
||||
#else
|
||||
double __scalb(x,fn) /* wrapper scalb */
|
||||
#ifdef _SCALB_INT
|
||||
double x; int fn;
|
||||
#else
|
||||
double x,fn;
|
||||
#endif
|
||||
#endif
|
||||
static double
|
||||
__attribute__ ((noinline))
|
||||
sysv_scalb (double x, double fn)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_scalb(x,fn);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_scalb(x,fn);
|
||||
if(_LIB_VERSION != _SVID_) return z;
|
||||
if(!(__finite(z)||__isnan(z))&&__finite(x)) {
|
||||
return __kernel_standard(x,(double)fn,32); /* scalb overflow */
|
||||
double z = __ieee754_scalb (x, fn);
|
||||
|
||||
if (__builtin_expect (__isinf (z), 0))
|
||||
{
|
||||
if (__finite (x))
|
||||
return __kernel_standard (x, fn, 32); /* scalb overflow */
|
||||
else
|
||||
__set_errno (ERANGE);
|
||||
}
|
||||
if(z==0.0&&z!=x) {
|
||||
return __kernel_standard(x,(double)fn,33); /* scalb underflow */
|
||||
}
|
||||
#ifndef _SCALB_INT
|
||||
if(!__finite(fn)) __set_errno (ERANGE);
|
||||
#endif
|
||||
else if (__builtin_expect (z == 0.0, 0) && z != x)
|
||||
return __kernel_standard (x, fn, 33); /* scalb underflow */
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper scalb */
|
||||
double
|
||||
__scalb (double x, double fn)
|
||||
{
|
||||
return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
|
||||
? sysv_scalb (x, fn)
|
||||
: __ieee754_scalb (x, fn));
|
||||
}
|
||||
weak_alias (__scalb, scalb)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -1,66 +1,53 @@
|
||||
/* w_scalbf.c -- float version of w_scalb.c.
|
||||
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: w_scalbf.c,v 1.3 1995/05/10 20:49:50 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.
|
||||
|
||||
/*
|
||||
* wrapper scalbf(float x, float fn) is provide for
|
||||
* passing various standard test suite. One
|
||||
* should use scalbn() instead.
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
#ifdef _SCALB_INT
|
||||
float __scalbf(float x, int fn) /* wrapper scalbf */
|
||||
#else
|
||||
float __scalbf(float x, float fn) /* wrapper scalbf */
|
||||
#endif
|
||||
#else
|
||||
float __scalbf(x,fn) /* wrapper scalbf */
|
||||
#ifdef _SCALB_INT
|
||||
float x; int fn;
|
||||
#else
|
||||
float x,fn;
|
||||
#endif
|
||||
#endif
|
||||
static float
|
||||
__attribute__ ((noinline))
|
||||
sysv_scalbf (float x, float fn)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_scalbf(x,fn);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_scalbf(x,fn);
|
||||
if(_LIB_VERSION != _SVID_) return z;
|
||||
if(!(__finitef(z)||__isnanf(z))&&__finitef(x)) {
|
||||
/* scalbf overflow */
|
||||
return (float)__kernel_standard((double)x,(double)fn,132);
|
||||
float z = __ieee754_scalbf (x, fn);
|
||||
|
||||
if (__builtin_expect (__isinff (z), 0))
|
||||
{
|
||||
if (__finitef (x))
|
||||
return __kernel_standard_f (x, fn, 132); /* scalb overflow */
|
||||
else
|
||||
__set_errno (ERANGE);
|
||||
}
|
||||
if(z==(float)0.0&&z!=x) {
|
||||
/* scalbf underflow */
|
||||
return (float)__kernel_standard((double)x,(double)fn,133);
|
||||
}
|
||||
#ifndef _SCALB_INT
|
||||
if(!__finitef(fn)) __set_errno (ERANGE);
|
||||
#endif
|
||||
else if (__builtin_expect (z == 0.0f, 0) && z != x)
|
||||
return __kernel_standard_f (x, fn, 133); /* scalb underflow */
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper scalbf */
|
||||
float
|
||||
__scalbf (float x, float fn)
|
||||
{
|
||||
return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
|
||||
? sysv_scalbf (x, fn)
|
||||
: __ieee754_scalbf (x, fn));
|
||||
}
|
||||
weak_alias (__scalbf, scalbf)
|
||||
|
@ -1,65 +1,53 @@
|
||||
/* w_scalbl.c -- long double version of w_scalb.c.
|
||||
* Conversion to long double by Ulrich Drepper,
|
||||
* Cygnus Support, drepper@cygnus.com.
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* 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: $";
|
||||
#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.
|
||||
|
||||
/*
|
||||
* wrapper scalbl(long double x, long double fn) is provide for
|
||||
* passing various standard test suite. One
|
||||
* should use scalbnl() instead.
|
||||
*/
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
#ifdef _SCALB_INT
|
||||
long double __scalbl(long double x, int fn) /* wrapper scalbl */
|
||||
#else
|
||||
long double __scalbl(long double x, long double fn)/* wrapper scalbl */
|
||||
#endif
|
||||
#else
|
||||
long double __scalbl(x,fn) /* wrapper scalbl */
|
||||
#ifdef _SCALB_INT
|
||||
long double x; int fn;
|
||||
#else
|
||||
long double x,fn;
|
||||
#endif
|
||||
#endif
|
||||
static long double
|
||||
__attribute__ ((noinline))
|
||||
sysv_scalbl (long double x, long double fn)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_scalbl(x,fn);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_scalbl(x,fn);
|
||||
if(_LIB_VERSION != _SVID_) return z;
|
||||
if(!(__finitel(z)||__isnanl(z))&&__finitel(x)) {
|
||||
return __kernel_standard(x,(double)fn,232); /* scalb overflow */
|
||||
long double z = __ieee754_scalbl (x, fn);
|
||||
|
||||
if (__builtin_expect (__isinfl (z), 0))
|
||||
{
|
||||
if (__finitel (x))
|
||||
return __kernel_standard (x, fn, 232); /* scalb overflow */
|
||||
else
|
||||
__set_errno (ERANGE);
|
||||
}
|
||||
if(z==0.0&&z!=x) {
|
||||
return __kernel_standard(x,(double)fn,233); /* scalb underflow */
|
||||
}
|
||||
#ifndef _SCALB_INT
|
||||
if(!__finitel(fn)) __set_errno (ERANGE);
|
||||
#endif
|
||||
else if (__builtin_expect (z == 0.0L, 0) && z != x)
|
||||
return __kernel_standard (x, fn, 233); /* scalb underflow */
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Wrapper scalbl */
|
||||
long double
|
||||
__scalbl (long double x, long double fn)
|
||||
{
|
||||
return (__builtin_expect (_LIB_VERSION == _SVID_, 0)
|
||||
? sysv_scalbl (x, fn)
|
||||
: __ieee754_scalbl (x, fn));
|
||||
}
|
||||
weak_alias (__scalbl, scalbl)
|
||||
|
@ -10,10 +10,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_sinh.c,v 1.6 1995/05/10 20:49:51 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper sinh(x)
|
||||
*/
|
||||
@ -21,24 +17,15 @@ static char rcsid[] = "$NetBSD: w_sinh.c,v 1.6 1995/05/10 20:49:51 jtc Exp $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __sinh(double x) /* wrapper sinh */
|
||||
#else
|
||||
double __sinh(x) /* wrapper sinh */
|
||||
double x;
|
||||
#endif
|
||||
double
|
||||
__sinh (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_sinh(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_sinh(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finite(z)&&__finite(x)) {
|
||||
double z = __ieee754_sinh (x);
|
||||
if (__builtin_expect (!__finite (z), 0) && __finite (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x, 25); /* sinh overflow */
|
||||
} else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__sinh, sinh)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
@ -13,10 +13,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_sinhf.c,v 1.3 1995/05/10 20:49:54 jtc Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper sinhf(x)
|
||||
*/
|
||||
@ -24,24 +20,14 @@ static char rcsid[] = "$NetBSD: w_sinhf.c,v 1.3 1995/05/10 20:49:54 jtc Exp $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
float __sinhf(float x) /* wrapper sinhf */
|
||||
#else
|
||||
float __sinhf(x) /* wrapper sinhf */
|
||||
float x;
|
||||
#endif
|
||||
float
|
||||
__sinhf (float x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_sinhf(x);
|
||||
#else
|
||||
float z;
|
||||
z = __ieee754_sinhf(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finitef(z)&&__finitef(x)) {
|
||||
/* sinhf overflow */
|
||||
return (float)__kernel_standard((double)x,(double)x,125);
|
||||
} else
|
||||
float z = __ieee754_sinhf (x);
|
||||
if (__builtin_expect (!__finitef (z), 0) && __finitef (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard_f (x, x, 125); /* sinhf overflow */
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__sinhf, sinhf)
|
||||
|
@ -14,10 +14,6 @@
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wrapper sinhl(x)
|
||||
*/
|
||||
@ -25,23 +21,14 @@ static char rcsid[] = "$NetBSD: $";
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
long double __sinhl(long double x) /* wrapper sinhl */
|
||||
#else
|
||||
long double __sinhl(x) /* wrapper sinhl */
|
||||
long double x;
|
||||
#endif
|
||||
long double
|
||||
__sinhl (long double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_sinhl(x);
|
||||
#else
|
||||
long double z;
|
||||
z = __ieee754_sinhl(x);
|
||||
if(_LIB_VERSION == _IEEE_) return z;
|
||||
if(!__finitel(z)&&__finitel(x)) {
|
||||
long double z = __ieee754_sinhl (x);
|
||||
if (__builtin_expect (!__finitel (z), 0) && __finitel (x)
|
||||
&& _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x, 225); /* sinh overflow */
|
||||
} else
|
||||
|
||||
return z;
|
||||
#endif
|
||||
}
|
||||
weak_alias (__sinhl, sinhl)
|
||||
|
@ -1,44 +1,34 @@
|
||||
/* @(#)w_sqrt.c 5.1 93/09/24 */
|
||||
/*
|
||||
* ====================================================
|
||||
* 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.
|
||||
* ====================================================
|
||||
*/
|
||||
/* Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
|
||||
|
||||
#if defined(LIBM_SCCS) && !defined(lint)
|
||||
static char rcsid[] = "$NetBSD: w_sqrt.c,v 1.6 1995/05/10 20:49:55 jtc Exp $";
|
||||
#endif
|
||||
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.
|
||||
|
||||
/*
|
||||
* wrapper sqrt(x)
|
||||
*/
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <math.h>
|
||||
#include <math_private.h>
|
||||
|
||||
#ifdef __STDC__
|
||||
double __sqrt(double x) /* wrapper sqrt */
|
||||
#else
|
||||
double __sqrt(x) /* wrapper sqrt */
|
||||
double x;
|
||||
#endif
|
||||
|
||||
/* wrapper sqrt */
|
||||
double
|
||||
__sqrt (double x)
|
||||
{
|
||||
#ifdef _IEEE_LIBM
|
||||
return __ieee754_sqrt(x);
|
||||
#else
|
||||
double z;
|
||||
z = __ieee754_sqrt(x);
|
||||
if(_LIB_VERSION == _IEEE_ || __isnan(x)) return z;
|
||||
if(x<0.0) {
|
||||
if (__builtin_expect (x < 0.0, 0) && _LIB_VERSION != _IEEE_)
|
||||
return __kernel_standard (x, x, 26); /* sqrt(negative) */
|
||||
} else
|
||||
return z;
|
||||
#endif
|
||||
|
||||
return __ieee754_sqrt (x);
|
||||
}
|
||||
weak_alias (__sqrt, sqrt)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user