diff options
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128')
21 files changed, 123 insertions, 192 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c b/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c index 62170d4c2..2a74e9cd7 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_acoshl.c @@ -30,20 +30,12 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif one = 1.0, ln2 = 0.6931471805599453094172321214581766L; -#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; u_int64_t lx; @@ -53,7 +45,7 @@ ln2 = 0.6931471805599453094172321214581766L; return (x-x)/(x-x); } else if(hx >=0x4035000000000000LL) { /* x > 2**54 */ if(hx >=0x7fff000000000000LL) { /* x is inf of NaN */ - return x+x; + return x+x; } else return __ieee754_logl(x)+ln2; /* acoshl(huge)=logl(2x) */ } else if(((hx-0x3fff000000000000LL)|lx)==0) { @@ -66,3 +58,4 @@ ln2 = 0.6931471805599453094172321214581766L; return __log1pl(t+__sqrtl(2.0L*t+t*t)); } } +strong_alias (__ieee754_acoshl, __acoshl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_acosl.c b/libc/sysdeps/ieee754/ldbl-128/e_acosl.c index 284e86a52..a7503695c 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_acosl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_acosl.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 + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -57,11 +57,7 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif one = 1.0L, pio2_hi = 1.5707963267948966192313216916397514420986L, pio2_lo = 4.3359050650618905123985220130216759843812E-35L, @@ -152,14 +148,8 @@ static long double qS8 = -4.175375777334867025769346564600396877176E1L; /* 1.000000000000000000000000000000000000000E0 */ -#ifdef __STDC__ long double __ieee754_acosl (long double x) -#else -long double -__ieee754_acosl (x) - long double x; -#endif { long double z, r, w, p, q, s, t, f2; int32_t ix, sign; @@ -283,11 +273,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 +316,4 @@ __ieee754_acosl (x) return 2.0 * w; } } +strong_alias (__ieee754_acosl, __acosl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c b/libc/sysdeps/ieee754/ldbl-128/e_asinl.c index 89f5d7958..e82b03f6a 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_asinl.c +++ b/libc/sysdeps/ieee754/ldbl-128/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/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c b/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c index 2bbb3b8f4..bba3c9bcf 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_atan2l.c +++ b/libc/sysdeps/ieee754/ldbl-128/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-4900L, 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)==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,19 +103,20 @@ pi_lo = 8.67181013012378102479704402604335225e-35L; /* 3f8dcd129024e088a67cc74 /* compute y/x */ k = (iy-ix)>>48; - if(k > 120) z=pi_o_2+0.5L*pi_lo; /* |y/x| > 2**120 */ - else if(hx<0&&k<-120) z=0.0L; /* |y|/x < -2**120 */ + if(k > 120) z=pi_o_2+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: { - u_int64_t zh; + u_int64_t zh; GET_LDOUBLE_MSW64(zh,z); SET_LDOUBLE_MSW64(z,zh ^ 0x8000000000000000ULL); } 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/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c b/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c index dd681c847..334c4bd70 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_atanhl.c @@ -14,10 +14,6 @@ * ==================================================== */ -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - /* __ieee754_atanhl(x) * Method : * 1.Reduced x to positive by atanh(-x) = -atanh(x) @@ -26,7 +22,7 @@ static char rcsid[] = "$NetBSD: $"; * atanhl(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) * 2 1 - x 1 - x * - * For x<0.5 + * For x<0.5 * atanhl(x) = 0.5*log1pl(2x+2x*x/(1-x)) * * Special cases: @@ -39,24 +35,12 @@ static char rcsid[] = "$NetBSD: $"; #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0L, huge = 1e4900L; -#else -static long double one = 1.0L, huge = 1e4900L; -#endif -#ifdef __STDC__ static const long double zero = 0.0L; -#else -static double long 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; u_int32_t jx, ix; @@ -82,3 +66,4 @@ static double long zero = 0.0L; t = 0.5*__log1pl((u.value+u.value)/(one-u.value)); if(jx & 0x80000000) return -t; else return t; } +strong_alias (__ieee754_atanhl, __atanhl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_coshl.c b/libc/sysdeps/ieee754/ldbl-128/e_coshl.c index 3913e3479..dfe8d47f9 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_coshl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_coshl.c @@ -11,9 +11,9 @@ /* Changes for 128-bit long double are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -54,22 +54,11 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0, half = 0.5, huge = 1.0e4900L, ovf_thresh = 1.1357216553474703894801348310092223067821E4L; -#else -static long double one = 1.0, half = 0.5, huge = 1.0e4900L, -ovf_thresh = 1.1357216553474703894801348310092223067821E4L; -#endif -#ifdef __STDC__ long double __ieee754_coshl (long double x) -#else -long double -__ieee754_coshl (x) - long double x; -#endif { long double t, w; int32_t ex; @@ -118,3 +107,4 @@ __ieee754_coshl (x) /* |x| > overflowthresold, cosh(x) overflow */ return huge * huge; } +strong_alias (__ieee754_coshl, __coshl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_expl.c b/libc/sysdeps/ieee754/ldbl-128/e_expl.c index 31ff16f8c..0279e777e 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_expl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_expl.c @@ -1,5 +1,5 @@ /* Quad-precision floating point e^x. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jj@ultra.linux.cz> Partly based on double-precision code @@ -73,7 +73,7 @@ static const long double C[] = { /* Smallest integer x for which e^x overflows. */ #define himark C[0] 11356.523406294143949491931077970765L, - + /* Largest integer x for which e^x underflows. */ #define lomark C[1] -11433.4627433362978788372438434526231L, @@ -247,3 +247,4 @@ __ieee754_expl (long double x) /* Return x, if x is a NaN or Inf; or overflow, otherwise. */ return TWO16383*x; } +strong_alias (__ieee754_expl, __expl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c b/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c index 1043f69cb..05665a9c8 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_fmodl.c @@ -3,16 +3,16 @@ */ /* * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * Copyright (C) 1993, 2011 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 + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ -/* +/* * __ieee754_fmodl(x,y) * Return x mod y in exact arithmetic * Method: shift and subtract @@ -21,18 +21,10 @@ #include "math.h" #include "math_private.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; @@ -49,7 +41,7 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; return (x*y)/(x*y); if(hx<=hy) { if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */ - if(lx==ly) + if(lx==ly) return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/ } @@ -72,25 +64,25 @@ static long double one = 1.0, Zero[] = {0.0, -0.0,}; } else iy = (hy>>48)-0x3fff; /* set up {hx,lx}, {hy,ly} and align y to x */ - if(ix >= -16382) + if(ix >= -16382) hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx); else { /* subnormal x, shift x to normal */ n = -16382-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; } } - if(iy >= -16382) + if(iy >= -16382) hy = 0x0001000000000000LL|(0x0000ffffffffffffLL&hy); else { /* subnormal y, shift y to normal */ n = -16382-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; @@ -103,17 +95,17 @@ 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)==0) /* return sign(x)*0 */ + if((hz|lz)==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)==0) /* return sign(x)*0 */ - return Zero[(u_int64_t)sx>>63]; + if((hx|lx)==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; iy -= 1; @@ -136,3 +128,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/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c index 36f5d4588..2dbe6acff 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_gammal_r.c @@ -1,8 +1,8 @@ /* Implementation of gamma function according to ISO C. - Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2002, 2004, 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/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c b/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c index 6834eac59..dad78fef1 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_hypotl.c @@ -13,10 +13,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 : @@ -45,19 +41,15 @@ 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" #include "math_private.h" -#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; int64_t j,k,ha,hb; @@ -89,7 +81,7 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; } if(hb < 0x20bf000000000000LL) { /* b < 2**-8000 */ if(hb <= 0x0000ffffffffffffLL) { /* subnormal b or 0 */ - u_int64_t low; + u_int64_t low; GET_LDOUBLE_LSW64(low,b); if((hb|low)==0) return a; t1=0; @@ -98,7 +90,7 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; a *= t1; k -= 16382; } else { /* scale a and b by 2^9600 */ - ha += 0x2580000000000000LL; /* a *= 2^9600 */ + ha += 0x2580000000000000LL; /* a *= 2^9600 */ hb += 0x2580000000000000LL; /* b *= 2^9600 */ k -= 9600; SET_LDOUBLE_MSW64(a,ha); @@ -130,3 +122,4 @@ static char rcsid[] = "$NetBSD: e_hypotl.c,v 1.9 1995/05/12 04:57:27 jtc Exp $"; return t1*w; } else return w; } +strong_alias (__ieee754_hypotl, __hypotl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c index bcd57e2b0..ef718b9d7 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c @@ -779,6 +779,7 @@ __ieee754_j0l (long double x) z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx); return z; } +strong_alias (__ieee754_j0l, __j0l_finite) /* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2) @@ -918,3 +919,4 @@ long double z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x); return z; } +strong_alias (__ieee754_y0l, __y0l_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c index 7b73e2e79..8d92b4f08 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -786,6 +786,7 @@ __ieee754_j1l (long double x) z = -z; return z; } +strong_alias (__ieee754_j1l, __j1l_finite) /* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2) @@ -925,3 +926,4 @@ __ieee754_y1l (long double x) z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx); return z; } +strong_alias (__ieee754_y1l, __y1l_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c index a4a4e24cf..81591634b 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_jnl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_jnl.c @@ -11,9 +11,9 @@ /* Modifications for 128-bit long double are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -59,26 +59,15 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double -#else -static long double -#endif invsqrtpi = 5.6418958354775628694807945156077258584405E-1L, two = 2.0e0L, one = 1.0e0L, zero = 0.0L; -#ifdef __STDC__ long double __ieee754_jnl (int n, long double x) -#else -long double -__ieee754_jnl (n, x) - int n; - long double x; -#endif { u_int32_t se; int32_t i, ix, sgn; @@ -285,7 +274,16 @@ __ieee754_jnl (n, x) } } } - b = (t * __ieee754_j0l (x) / b); + /* j0() and j1() suffer enormous loss of precision at and + * near zero; however, we know that their zero points never + * coincide, so just choose the one further away from zero. + */ + z = __ieee754_j0l (x); + w = __ieee754_j1l (x); + if (fabsl (z) >= fabsl (w)) + b = (t * z / b); + else + b = (t * w / a); } } if (sgn == 1) @@ -293,16 +291,10 @@ __ieee754_jnl (n, x) else return b; } +strong_alias (__ieee754_jnl, __jnl_finite) -#ifdef __STDC__ long double __ieee754_ynl (int n, long double x) -#else -long double -__ieee754_ynl (n, x) - int n; - long double x; -#endif { u_int32_t se; int32_t i, ix; @@ -398,3 +390,4 @@ __ieee754_ynl (n, x) else return -b; } +strong_alias (__ieee754_ynl, __ynl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c index d08044847..2482296ac 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_lgammal_r.c @@ -754,15 +754,8 @@ deval (long double x, const long double *p, int n) } -#ifdef __STDC__ long double __ieee754_lgammal_r (long double x, int *signgamp) -#else -long double -__ieee754_lgammal_r (x, signgamp) - long double x; - int *signgamp; -#endif { long double p, q, w, z, nx; int i, nn; @@ -775,7 +768,7 @@ __ieee754_lgammal_r (x, signgamp) if (x == 0.0L) { if (__signbitl (x)) - *signgamp = -1; + *signgamp = -1; } if (x < 0.0L) @@ -863,7 +856,7 @@ __ieee754_lgammal_r (x, signgamp) { z = x - 0.75L; p = z * neval (z, RN1r75, NRN1r75) - / deval (z, RD1r75, NRD1r75); + / deval (z, RD1r75, NRD1r75); p += lgam1r75b; p += lgam1r75a; } @@ -1040,3 +1033,4 @@ __ieee754_lgammal_r (x, signgamp) q += neval (p, RASY, NRASY) / x; return (q); } +strong_alias (__ieee754_lgammal_r, __lgammal_r_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_log10l.c b/libc/sysdeps/ieee754/ldbl-128/e_log10l.c index 1213177a8..6e69bbd7b 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_log10l.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_log10l.c @@ -58,7 +58,7 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -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/libc/sysdeps/ieee754/ldbl-128/e_log2l.c b/libc/sysdeps/ieee754/ldbl-128/e_log2l.c index 8663d78b3..9a02394ee 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_log2l.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_log2l.c @@ -57,7 +57,7 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "math.h" @@ -248,3 +248,4 @@ done: z += e; return (z); } +strong_alias (__ieee754_log2l, __log2l_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_logl.c b/libc/sysdeps/ieee754/ldbl-128/e_logl.c index b9e17f8f9..6d532874c 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_logl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_logl.c @@ -42,7 +42,7 @@ * */ -/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov> +/* Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -251,7 +251,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). */ @@ -277,3 +277,4 @@ __ieee754_logl(long double x) y += e * ln2a; return y; } +strong_alias (__ieee754_logl, __logl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_powl.c b/libc/sysdeps/ieee754/ldbl-128/e_powl.c index ba7e27b7d..d8e1af03c 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_powl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_powl.c @@ -11,9 +11,9 @@ /* Expansions and modifications for 128-bit long double are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -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; @@ -445,3 +439,4 @@ __ieee754_powl (x, y) } return s * z; } +strong_alias (__ieee754_powl, __powl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c b/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c index 81af247b3..84233808e 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_remainderl.c @@ -7,36 +7,28 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ /* __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) + * Return : + * 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 : + * Method : * Based on fmodl() return x-[x/p]chopped*p exactlp. */ #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)==0) return (x*p)/(x*p); /* p = 0 */ + if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */ if((hx>=0x7fff000000000000LL)|| /* x not finite */ ((hp>=0x7fff000000000000LL)&& /* p is NaN */ (((hp-0x7fff000000000000LL)|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/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c b/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c index 93f4179c6..ac36cac5c 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_sinhl.c @@ -16,9 +16,9 @@ /* Changes for 128-bit long double are Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov> - and are incorporated herein by permission of the author. The author + and are incorporated herein by permission of the author. The author reserves the right to distribute this material elsewhere under different - copying permissions. These modifications are distributed here under + copying permissions. These modifications are distributed here under the following terms: This library is free software; you can redistribute it and/or @@ -56,22 +56,11 @@ #include "math.h" #include "math_private.h" -#ifdef __STDC__ static const long double one = 1.0, shuge = 1.0e4931L, ovf_thresh = 1.1357216553474703894801348310092223067821E4L; -#else -static long double one = 1.0, shuge = 1.0e4931L, -ovf_thresh = 1.1357216553474703894801348310092223067821E4L; -#endif -#ifdef __STDC__ long double __ieee754_sinhl (long double x) -#else -long double -__ieee754_sinhl (x) - long double x; -#endif { long double t, w, h; u_int32_t jx, ix; @@ -121,3 +110,4 @@ __ieee754_sinhl (x) /* |x| > overflowthreshold, sinhl(x) overflow */ return x * shuge; } +strong_alias (__ieee754_sinhl, __sinhl_finite) diff --git a/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c b/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c new file mode 100644 index 000000000..1ebc1accb --- /dev/null +++ b/libc/sysdeps/ieee754/ldbl-128/s_isinf_nsl.c @@ -0,0 +1,19 @@ +/* + * Written by Ulrich Drepper <drepper@gmail.com> + */ + +/* + * __isinf_nsl(x) returns != 0 if x is ±inf, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int +__isinf_nsl (long double x) +{ + int64_t hx,lx; + GET_LDOUBLE_WORDS64(hx,lx,x); + return !(lx | ((hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL)); +} |