diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-10-12 11:27:51 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-10-12 11:27:51 -0400 |
commit | 0ac5ae2335292908f39031b1ea9fe8edce433c0f (patch) | |
tree | f9d26c8abc0de39d18d4c13e70f6022cdc6b461f /sysdeps/ieee754/ldbl-128ibm | |
parent | a843a204a3e8a0dd53584dad3668771abaec84ac (diff) | |
download | glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.gz glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.tar.xz glibc-0ac5ae2335292908f39031b1ea9fe8edce433c0f.zip |
Optimize libm
libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_acoshl.c | 19 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_acosl.c | 7 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_asinl.c | 7 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_atan2l.c | 23 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_atanhl.c | 25 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_coshl.c | 27 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_fmodl.c | 31 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c | 5 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_hypotl.c | 21 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_log10l.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_log2l.c | 1 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_logl.c | 3 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_powl.c | 11 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_remainderl.c | 19 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_sinhl.c | 23 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c | 5 |
16 files changed, 78 insertions, 153 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c index 00576c76c8..20d94eaa1e 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c @@ -10,10 +10,6 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $"; -#endif - /* __ieee754_acosh(x) * Method : * Based on @@ -31,20 +27,12 @@ static char rcsid[] = "$NetBSD: e_acosh.c,v 1.9 1995/05/12 04:57:18 jtc Exp $"; #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif one = 1.0L, ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */ -#ifdef __STDC__ - long double __ieee754_acoshl(long double x) -#else - long double __ieee754_acoshl(x) - long double x; -#endif +long double +__ieee754_acoshl(long double x) { long double t; int64_t hx; @@ -54,7 +42,7 @@ ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */ return (x-x)/(x-x); } else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */ if(hx >=0x7ff0000000000000LL) { /* x is inf of NaN */ - return x+x; + return x+x; } else return __ieee754_logl(x)+ln2; /* acosh(huge)=log(2x) */ } else if (((hx-0x3ff0000000000000LL)|(lx&0x7fffffffffffffffLL))==0) { @@ -67,3 +55,4 @@ ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */ return __log1p(t+__sqrtl(2.0*t+t*t)); } } +strong_alias (__ieee754_acoshl, __acoshl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c index 8823fd69b4..1b37c9220c 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_acosl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_acosl.c @@ -283,11 +283,11 @@ __ieee754_acosl (x) s = __ieee754_sqrtl (z); /* Compute an extended precision square root from the Newton iteration s -> 0.5 * (s + z / s). - The change w from s to the improved value is + The change w from s to the improved value is w = 0.5 * (s + z / s) - s = (s^2 + z)/2s - s = (z - s^2)/2s. - Express s = f1 + f2 where f1 * f1 is exactly representable. + Express s = f1 + f2 where f1 * f1 is exactly representable. w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s . - s + w has extended precision. */ + s + w has extended precision. */ u.value = s; u.parts32.w2 = 0; u.parts32.w3 = 0; @@ -326,3 +326,4 @@ __ieee754_acosl (x) return 2.0 * w; } } +strong_alias (__ieee754_acosl, __acosl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c index 3696694f78..6c61232c05 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_asinl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_asinl.c @@ -12,9 +12,9 @@ /* Long double expansions are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author - reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under the + and are incorporated herein by permission of the author. The author + reserves the right to distribute this material elsewhere under different + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -263,3 +263,4 @@ __ieee754_asinl (x) else return -t; } +strong_alias (__ieee754_asinl, __asinl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c b/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c index a4bb53df04..a5b6621006 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c @@ -17,7 +17,7 @@ * Method : * 1. Reduce y to positive by atan2l(y,x)=-atan2l(-y,x). * 2. Reduce x to positive by (if x and y are unexceptional): - * ARG (x+iy) = arctan(y/x) ... if x > 0, + * ARG (x+iy) = arctan(y/x) ... if x > 0, * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, * * Special cases: @@ -43,11 +43,7 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif tiny = 1.0e-300L, zero = 0.0, pi_o_4 = 7.85398163397448309615660845819875699e-01L, /* 3ffe921fb54442d18469898cc51701b8 */ @@ -55,12 +51,8 @@ pi_o_2 = 1.57079632679489661923132169163975140e+00L, /* 3fff921fb54442d18469898 pi = 3.14159265358979323846264338327950280e+00L, /* 4000921fb54442d18469898cc51701b8 */ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74020bbea64 */ -#ifdef __STDC__ - long double __ieee754_atan2l(long double y, long double x) -#else - long double __ieee754_atan2l(y,x) - long double y,x; -#endif +long double +__ieee754_atan2l(long double y, long double x) { long double z; int64_t k,m,hx,hy,ix,iy; @@ -80,7 +72,7 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74 if((iy|(ly&0x7fffffffffffffffLL))==0) { switch(m) { case 0: - case 1: return y; /* atan(+-0,+anything)=+-0 */ + case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi+tiny;/* atan(+0,-anything) = pi */ case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ } @@ -111,14 +103,15 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74 /* compute y/x */ k = (iy-ix)>>52; - if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */ - else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */ + if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */ + else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */ else z=__atanl(fabsl(y/x)); /* safe to do y/x */ switch (m) { case 0: return z ; /* atan(+,+) */ case 1: return -z ; /* atan(-,+) */ case 2: return pi-(z-pi_lo);/* atan(+,-) */ default: /* case 3 */ - return (z-pi_lo)-pi;/* atan(-,-) */ + return (z-pi_lo)-pi;/* atan(-,-) */ } } +strong_alias (__ieee754_atan2l, __atan2l_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c index a801bd6f74..c879e4518e 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c @@ -10,10 +10,6 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $"; -#endif - /* __ieee754_atanh(x) * Method : * 1.Reduced x to positive by atanh(-x) = -atanh(x) @@ -22,7 +18,7 @@ static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $"; * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) * 2 1 - x 1 - x * - * For x<0.5 + * For x<0.5 * atanh(x) = 0.5*log1p(2x+2x*x/(1-x)) * * Special cases: @@ -35,24 +31,12 @@ static char rcsid[] = "$NetBSD: e_atanh.c,v 1.8 1995/05/10 20:44:55 jtc Exp $"; #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0L, huge = 1e300L; -#else -static long double one = 1.0L, huge = 1e300L; -#endif -#ifdef __STDC__ static const long double zero = 0.0L; -#else -static long double zero = 0.0L; -#endif -#ifdef __STDC__ - long double __ieee754_atanhl(long double x) -#else - long double __ieee754_atanhl(x) - long double x; -#endif +long double +__ieee754_atanhl(long double x) { long double t; int64_t hx,ix; @@ -61,7 +45,7 @@ static long double zero = 0.0L; ix = hx&0x7fffffffffffffffLL; if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */ if (ix > 0x3ff0000000000000LL) - return (x-x)/(x-x); + return (x-x)/(x-x); t = fabsl (x); if (t > one) return (x-x)/(x-x); @@ -77,3 +61,4 @@ static long double zero = 0.0L; t = 0.5*__log1pl((x+x)/(one-x)); if(hx>=0) return t; else return -t; } +strong_alias (__ieee754_atanhl, __atanhl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_coshl.c b/sysdeps/ieee754/ldbl-128ibm/e_coshl.c index 73cb47892f..ebc9436396 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_coshl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_coshl.c @@ -10,22 +10,18 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $"; -#endif - /* __ieee754_cosh(x) * Method : * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2 * 1. Replace x by |x| (cosh(x) = cosh(-x)). * 2. - * [ exp(x) - 1 ]^2 + * [ exp(x) - 1 ]^2 * 0 <= x <= ln2/2 : cosh(x) := 1 + ------------------- - * 2*exp(x) + * 2*exp(x) * - * exp(x) + 1/exp(x) + * exp(x) + 1/exp(x) * ln2/2 <= x <= 22 : cosh(x) := ------------------- - * 2 + * 2 * 22 <= x <= lnovft : cosh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : cosh(x) := huge*huge (overflow) @@ -38,18 +34,10 @@ static char rcsid[] = "$NetBSD: e_cosh.c,v 1.7 1995/05/10 20:44:58 jtc Exp $"; #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0L, half=0.5L, huge = 1.0e300L; -#else -static long double one = 1.0L, half=0.5L, huge = 1.0e300L; -#endif -#ifdef __STDC__ - long double __ieee754_coshl(long double x) -#else - long double __ieee754_coshl(x) - long double x; -#endif +long double +__ieee754_coshl (long double x) { long double t,w; int64_t ix; @@ -79,7 +67,7 @@ static long double one = 1.0L, half=0.5L, huge = 1.0e300L; if (ix < 0x40862e42fefa39efLL) return half*__ieee754_expl(fabsl(x)); /* |x| in [log(maxdouble), overflowthresold] */ - if (ix < 0x408633ce8fb9f87dLL) { + if (ix < 0x408633ce8fb9f87dLL) { w = __ieee754_expl(half*fabsl(x)); t = half*w; return t*w; @@ -88,3 +76,4 @@ static long double one = 1.0L, half=0.5L, huge = 1.0e300L; /* |x| > overflowthresold, cosh(x) overflow */ return huge*huge; } +strong_alias (__ieee754_coshl, __coshl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c index e99b0bac34..4ad59a0916 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c @@ -22,18 +22,10 @@ #include "math_private.h" #include <ieee754.h> -#ifdef __STDC__ static const long double one = 1.0, Zero[] = {0.0, -0.0,}; -#else -static long double one = 1.0, Zero[] = {0.0, -0.0,}; -#endif -#ifdef __STDC__ - long double __ieee754_fmodl(long double x, long double y) -#else - long double __ieee754_fmodl(x,y) - long double x,y; -#endif +long double +__ieee754_fmodl (long double x, long double y) { int64_t n,hx,hy,hz,ix,iy,sx,i; u_int64_t lx,ly,lz; @@ -76,8 +68,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; /* Make the IBM extended format 105 bit mantissa look like the ieee854 112 bit mantissa so the following operatations will give the correct result. */ - ldbl_extract_mantissa(&hx, &lx, &temp, x); - ldbl_extract_mantissa(&hy, &ly, &temp, y); + ldbl_extract_mantissa(&hx, &lx, &temp, x); + ldbl_extract_mantissa(&hy, &ly, &temp, y); /* set up {hx,lx}, {hy,ly} and align y to x */ if(ix >= -1022) @@ -85,8 +77,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; else { /* subnormal x, shift x to normal */ n = -1022-ix; if(n<=63) { - hx = (hx<<n)|(lx>>(64-n)); - lx <<= n; + hx = (hx<<n)|(lx>>(64-n)); + lx <<= n; } else { hx = lx<<(n-64); lx = 0; @@ -97,8 +89,8 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; else { /* subnormal y, shift y to normal */ n = -1022-iy; if(n<=63) { - hy = (hy<<n)|(ly>>(64-n)); - ly <<= n; + hy = (hy<<n)|(ly>>(64-n)); + ly <<= n; } else { hy = ly<<(n-64); ly = 0; @@ -111,16 +103,16 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;} else { - if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */ + if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */ return Zero[(u_int64_t)sx>>63]; - hx = hz+hz+(lz>>63); lx = lz+lz; + hx = hz+hz+(lz>>63); lx = lz+lz; } } hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; if(hz>=0) {hx=hz;lx=lz;} /* convert back to floating value and restore the sign */ - if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */ + if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */ return Zero[(u_int64_t)sx>>63]; while(hx<0x0001000000000000LL) { /* normalize x */ hx = hx+hx+(lx>>63); lx = lx+lx; @@ -143,3 +135,4 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; } return x; /* exact output */ } +strong_alias (__ieee754_fmodl, __fmodl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c index 03bcb2129a..f20ea9e057 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c @@ -1,8 +1,8 @@ /* Implementation of gamma function according to ISO C. - Copyright (C) 1997,1999,2002,2004,2006 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2002,2004,2006,2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and - Jakub Jelinek <jj@ultra.linux.cz, 1999. + Jakub Jelinek <jj@ultra.linux.cz, 1999. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -56,3 +56,4 @@ __ieee754_gammal_r (long double x, int *signgamp) /* XXX FIXME. */ return __ieee754_expl (__ieee754_lgammal_r (x, signgamp)); } +strong_alias (__ieee754_gammal_r, __gammal_r_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c index 4330f28b93..4ef076741f 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c @@ -10,10 +10,6 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; -#endif - /* __ieee754_hypotl(x,y) * * Method : @@ -42,8 +38,8 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; * hypotl(x,y) is NAN if x or y is NAN. * * Accuracy: - * hypotl(x,y) returns sqrtl(x^2+y^2) with error less - * than 1 ulps (units in the last place) + * hypotl(x,y) returns sqrtl(x^2+y^2) with error less + * than 1 ulps (units in the last place) */ #include "math.h" @@ -52,12 +48,8 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; static const long double two600 = 0x1.0p+600L; static const long double two1022 = 0x1.0p+1022L; -#ifdef __STDC__ - long double __ieee754_hypotl(long double x, long double y) -#else - long double __ieee754_hypotl(x,y) - long double x, y; -#endif +long double +__ieee754_hypotl(long double x, long double y) { long double a,b,t1,t2,y1,y2,w,kld; int64_t j,k,ha,hb; @@ -93,7 +85,7 @@ static const long double two1022 = 0x1.0p+1022L; } if(hb < 0x20b0000000000000LL) { /* b < 2**-500 */ if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */ - u_int64_t low; + u_int64_t low; GET_LDOUBLE_LSW64(low,b); if((hb|(low&0x7fffffffffffffffLL))==0) return a; t1=two1022; /* t1=2^1022 */ @@ -102,7 +94,7 @@ static const long double two1022 = 0x1.0p+1022L; k -= 1022; kld = kld / two1022; } else { /* scale a and b by 2^600 */ - ha += 0x2580000000000000LL; /* a *= 2^600 */ + ha += 0x2580000000000000LL; /* a *= 2^600 */ hb += 0x2580000000000000LL; /* b *= 2^600 */ k -= 600; a *= two600; @@ -129,3 +121,4 @@ static const long double two1022 = 0x1.0p+1022L; else return w; } +strong_alias (__ieee754_hypotl, __hypotl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c index 27e2c71b8d..de57be39d9 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c @@ -179,8 +179,7 @@ deval (long double x, const long double *p, int n) long double -__ieee754_log10l (x) - long double x; +__ieee754_log10l (long double x) { long double z; long double y; @@ -256,3 +255,4 @@ done: z += e * L102A; return (z); } +strong_alias (__ieee754_log10l, __log10l_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c index fe8a8e1d6c..9737e13f0e 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c @@ -248,3 +248,4 @@ done: z += e; return (z); } +strong_alias (__ieee754_log2l, __log2l_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c index aa5fc3740f..6832608069 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c @@ -253,7 +253,7 @@ __ieee754_logl(long double x) /* log(u) = log( t u/t ) = log(t) + log(u/t) log(t) is tabulated in the lookup table. Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t. - cf. Cody & Waite. */ + cf. Cody & Waite. */ z = (u.value - t.value) / t.value; } /* Series expansion of log(1+z). */ @@ -279,3 +279,4 @@ __ieee754_logl(long double x) y += e * ln2a; return y; } +strong_alias (__ieee754_logl, __logl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_powl.c b/sysdeps/ieee754/ldbl-128ibm/e_powl.c index feeaa8ce21..9b1f2be1d0 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_powl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_powl.c @@ -144,14 +144,8 @@ static const long double cp_h = 9.6179669392597555432899980587535537779331E-1L, cp_l = 5.0577616648125906047157785230014751039424E-17L; -#ifdef __STDC__ long double __ieee754_powl (long double x, long double y) -#else -long double -__ieee754_powl (x, y) - long double x, y; -#endif { long double z, ax, z_h, z_l, p_h, p_l; long double y1, t1, t2, r, s, t, u, v, w; @@ -390,7 +384,7 @@ __ieee754_powl (x, y) { /* if z > 16384 */ if (((j - 0x40d00000) | o.parts32.w1 - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) + | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) return s * huge * huge; /* overflow */ else { @@ -402,7 +396,7 @@ __ieee754_powl (x, y) { /* z < -16495 */ if (((j - 0xc0d01bc0) | o.parts32.w1 - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) + | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) return s * tiny * tiny; /* underflow */ else { @@ -439,3 +433,4 @@ __ieee754_powl (x, y) z = __scalbnl (z, n); return s * z; } +strong_alias (__ieee754_powl, __powl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c index b7fa68f32a..d4a847dbed 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c @@ -14,8 +14,8 @@ /* __ieee754_remainderl(x,p) * Return : - * returns x REM p = x - [x/p]*p as if in infinite - * precise arithmetic, where [x/p] is the (infinite bit) + * returns x REM p = x - [x/p]*p as if in infinite + * precise arithmetic, where [x/p] is the (infinite bit) * integer nearest x/p (in half way case choose the even one). * Method : * Based on fmodl() return x-[x/p]chopped*p exactlp. @@ -24,19 +24,11 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double zero = 0.0L; -#else -static long double zero = 0.0L; -#endif -#ifdef __STDC__ - long double __ieee754_remainderl(long double x, long double p) -#else - long double __ieee754_remainderl(x,p) - long double x,p; -#endif +long double +__ieee754_remainderl(long double x, long double p) { int64_t hx,hp; u_int64_t sx,lx,lp; @@ -49,7 +41,7 @@ static long double zero = 0.0L; hx &= 0x7fffffffffffffffLL; /* purge off exception values */ - if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */ + if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */ if((hx>=0x7ff0000000000000LL)|| /* x not finite */ ((hp>=0x7ff0000000000000LL)&& /* p is NaN */ (((hp-0x7ff0000000000000LL)|lp)!=0))) @@ -76,3 +68,4 @@ static long double zero = 0.0L; SET_LDOUBLE_MSW64(x,hx^sx); return x; } +strong_alias (__ieee754_remainderl, __remainderl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c index 38ae71d4b7..b8e86b1a6b 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c @@ -10,18 +10,14 @@ */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $"; -#endif - /* __ieee754_sinh(x) * Method : * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2 * 1. Replace x by |x| (sinh(-x) = -sinh(x)). * 2. - * E + E/(E+1) + * E + E/(E+1) * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) - * 2 + * 2 * * 22 <= x <= lnovft : sinh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) @@ -35,18 +31,10 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $"; #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0, shuge = 1.0e307; -#else -static long double one = 1.0, shuge = 1.0e307; -#endif -#ifdef __STDC__ - long double __ieee754_sinhl(long double x) -#else - long double __ieee754_sinhl(x) - long double x; -#endif +long double +__ieee754_sinhl(long double x) { long double t,w,h; int64_t ix,jx; @@ -62,7 +50,7 @@ static long double one = 1.0, shuge = 1.0e307; if (jx<0) h = -h; /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ if (ix < 0x4036000000000000LL) { /* |x|<22 */ - if (ix<0x3e20000000000000LL) /* |x|<2**-29 */ + if (ix<0x3e20000000000000LL) /* |x|<2**-29 */ if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */ t = __expm1l(fabsl(x)); if(ix<0x3ff0000000000000LL) return h*(2.0*t-t*t/(t+one)); @@ -82,3 +70,4 @@ static long double one = 1.0, shuge = 1.0e307; /* |x| > overflowthresold, sinh(x) overflow */ return x*shuge; } +strong_alias (__ieee754_sinhl, __sinhl_finite) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c index fe6bb55b07..68aa18f554 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c @@ -1,7 +1,7 @@ /* * IBM Accurate Mathematical Library * written by International Business Machines Corp. - * Copyright (C) 2001, 2004, 2006 Free Software Foundation + * Copyright (C) 2001, 2004, 2006, 2011 Free Software Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -50,7 +50,7 @@ twom54 = 5.55111512312578270212e-17; /* 0x3C90000000000000 */ /* it computes the correctly rounded (to nearest) value of square */ /* root of x. */ /*********************************************************************/ -long double __ieee754_sqrtl(long double x) +long double __ieee754_sqrtl(long double x) { static const long double big = 134217728.0, big1 = 134217729.0; long double t,s,i; @@ -107,3 +107,4 @@ long double __ieee754_sqrtl(long double x) return tm256.x*__ieee754_sqrtl(x*t512.x); } } +strong_alias (__ieee754_sqrtl, __sqrtl_finite) |