git: 99843eb89954 - main - Clean up libm use of the __ieee754_ prefix
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 03 Aug 2023 19:52:35 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=99843eb89954dac76afe7cf18d962eddfe7a7987 commit 99843eb89954dac76afe7cf18d962eddfe7a7987 Author: Steve Kargl <kargl@FreeBSD.org> AuthorDate: 2023-08-03 19:51:17 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-08-03 19:51:53 +0000 Clean up libm use of the __ieee754_ prefix This removes the __ieee754_ prefix from a number of the math functions. msun/src/math_private.h contains the statement that /* * ieee style elementary functions * * We rename functions here to improve other sources' diffability * against fdlibm. */ #define __ieee754_sqrt sqrt ... Here, fdlibm refers to https://netlib.org/fdlibm. It is seen from https://netlib.org/fdlibm/readme that this prefix was used to differentiate between different standards: Wrapper functions will twist the result of the ieee754 function to comply to the standard specified by the value of _LIB_VERSION if _LIB_VERSION = _IEEE_, return the ieee754 result; if _LIB_VERSION = _SVID_, return SVID result; if _LIB_VERSION = _XOPEN_, return XOPEN result; if _LIB_VERSION = _POSIX_, return POSIX/ANSI result. (These are macros, see fdlibm.h for their definition.) AFAICT, FreeBSD has never supported these wrappers. In addition, as C99, principally the long double, functions were added to libm, this convention was not maintained. Given that only 148 of 324 files under lib/msun contain a "Copyright (C) 1993 by Sun Microsystems" statement, the removal of the __ieee754_ prefix provides consistency across all source files. The last time someone compared lib/msun to fdlibm appears to be commit 3f70824172feb82ea3dcdb3866b54fe0eb7cd890 Author: David Schultz <das@FreeBSD.org> Date: Fri Feb 4 18:26:06 2005 +0000 Reduce diffs against vendor source (Sun fdlibm 5.3). The most recent fdlibm RCS string that appears in a Sun Microsystem copyrighted file is date "95/01/18". With Oracle Corporation's acquisition of Sun Microsystems in 2009, it is unlikely that fdlibm will ever be updated. A search for fdlibm at https://opensource.oracle.com/ yields no hits. Finally, OpenBSD removed the use of this prefix over 21 years ago. pSee revision 1.6 of OpenBSD's math_private.h. Note: this does not drop the __ieee754_ prefix from the trigonometric argument reduction functions, e.g., __ieee754_rem_pio2. These functions are internal to the libm and exported through Symbol.map; and thus, reserved for the implementation. PR: 272783 MFC after: 1 week --- lib/msun/src/e_acos.c | 4 +-- lib/msun/src/e_acosf.c | 2 +- lib/msun/src/e_acosh.c | 8 +++--- lib/msun/src/e_acoshf.c | 8 +++--- lib/msun/src/e_asin.c | 4 +-- lib/msun/src/e_asinf.c | 2 +- lib/msun/src/e_atan2.c | 4 +-- lib/msun/src/e_atan2f.c | 2 +- lib/msun/src/e_atanh.c | 4 +-- lib/msun/src/e_atanhf.c | 2 +- lib/msun/src/e_cosh.c | 8 +++--- lib/msun/src/e_coshf.c | 6 ++--- lib/msun/src/e_exp.c | 4 +-- lib/msun/src/e_expf.c | 2 +- lib/msun/src/e_fmod.c | 4 +-- lib/msun/src/e_fmodf.c | 4 +-- lib/msun/src/e_gamma.c | 8 +++--- lib/msun/src/e_gamma_r.c | 8 +++--- lib/msun/src/e_gammaf.c | 8 +++--- lib/msun/src/e_gammaf_r.c | 8 +++--- lib/msun/src/e_hypot.c | 4 +-- lib/msun/src/e_hypotf.c | 6 ++--- lib/msun/src/e_j0.c | 10 +++---- lib/msun/src/e_j0f.c | 8 +++--- lib/msun/src/e_j1.c | 8 +++--- lib/msun/src/e_j1f.c | 6 ++--- lib/msun/src/e_jn.c | 28 ++++++++++---------- lib/msun/src/e_jnf.c | 26 +++++++++--------- lib/msun/src/e_lgamma.c | 8 +++--- lib/msun/src/e_lgamma_r.c | 16 ++++++------ lib/msun/src/e_lgammaf.c | 8 +++--- lib/msun/src/e_lgammaf_r.c | 14 +++++----- lib/msun/src/e_log.c | 4 +-- lib/msun/src/e_log10.c | 2 +- lib/msun/src/e_log10f.c | 2 +- lib/msun/src/e_log2.c | 2 +- lib/msun/src/e_log2f.c | 2 +- lib/msun/src/e_logf.c | 2 +- lib/msun/src/e_pow.c | 4 +-- lib/msun/src/e_powf.c | 4 +-- lib/msun/src/e_remainder.c | 6 ++--- lib/msun/src/e_remainderf.c | 4 +-- lib/msun/src/e_scalb.c | 6 ++--- lib/msun/src/e_scalbf.c | 4 +-- lib/msun/src/e_sinh.c | 6 ++--- lib/msun/src/e_sinhf.c | 4 +-- lib/msun/src/e_sqrt.c | 6 ++--- lib/msun/src/e_sqrtf.c | 4 +-- lib/msun/src/math_private.h | 61 ------------------------------------------- lib/msun/src/s_asinh.c | 6 ++--- lib/msun/src/s_asinhf.c | 6 ++--- lib/msun/src/s_erf.c | 4 +-- lib/msun/src/s_significand.c | 2 +- lib/msun/src/s_significandf.c | 2 +- 54 files changed, 162 insertions(+), 223 deletions(-) diff --git a/lib/msun/src/e_acos.c b/lib/msun/src/e_acos.c index 1f6dca5bb5cb..6623355baa7c 100644 --- a/lib/msun/src/e_acos.c +++ b/lib/msun/src/e_acos.c @@ -14,7 +14,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_acos(x) +/* acos(x) * Method : * acos(x) = pi/2 - asin(x) * acos(-x) = pi/2 + asin(x) @@ -62,7 +62,7 @@ qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ double -__ieee754_acos(double x) +acos(double x) { double z,p,q,r,w,s,c,df; int32_t hx,ix; diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index c9f62cc40f5c..64f1c5afb182 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -32,7 +32,7 @@ pS2 = -8.6563630030e-03, qS1 = -7.0662963390e-01; float -__ieee754_acosf(float x) +acosf(float x) { float z,p,q,r,w,s,c,df; int32_t hx,ix; diff --git a/lib/msun/src/e_acosh.c b/lib/msun/src/e_acosh.c index 358c8bd6a636..7947995820d0 100644 --- a/lib/msun/src/e_acosh.c +++ b/lib/msun/src/e_acosh.c @@ -15,7 +15,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_acosh(x) +/* acosh(x) * Method : * Based on * acosh(x) = log [ x + sqrt(x*x-1) ] @@ -39,7 +39,7 @@ one = 1.0, ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ double -__ieee754_acosh(double x) +acosh(double x) { double t; int32_t hx; @@ -51,12 +51,12 @@ __ieee754_acosh(double x) if(hx >=0x7ff00000) { /* x is inf of NaN */ return x+x; } else - return __ieee754_log(x)+ln2; /* acosh(huge)=log(2x) */ + return log(x)+ln2; /* acosh(huge)=log(2x) */ } else if(((hx-0x3ff00000)|lx)==0) { return 0.0; /* acosh(1) = 0 */ } else if (hx > 0x40000000) { /* 2**28 > x > 2 */ t=x*x; - return __ieee754_log(2.0*x-one/(x+sqrt(t-one))); + return log(2.0*x-one/(x+sqrt(t-one))); } else { /* 1<x<2 */ t = x-one; return log1p(t+sqrt(2.0*t+t*t)); diff --git a/lib/msun/src/e_acoshf.c b/lib/msun/src/e_acoshf.c index f529b20d1219..781ccf2a1151 100644 --- a/lib/msun/src/e_acoshf.c +++ b/lib/msun/src/e_acoshf.c @@ -24,7 +24,7 @@ one = 1.0, ln2 = 6.9314718246e-01; /* 0x3f317218 */ float -__ieee754_acoshf(float x) +acoshf(float x) { float t; int32_t hx; @@ -35,14 +35,14 @@ __ieee754_acoshf(float x) if(hx >=0x7f800000) { /* x is inf of NaN */ return x+x; } else - return __ieee754_logf(x)+ln2; /* acosh(huge)=log(2x) */ + return logf(x)+ln2; /* acosh(huge)=log(2x) */ } else if (hx==0x3f800000) { return 0.0; /* acosh(1) = 0 */ } else if (hx > 0x40000000) { /* 2**28 > x > 2 */ t=x*x; - return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one))); + return logf((float)2.0*x-one/(x+sqrtf(t-one))); } else { /* 1<x<2 */ t = x-one; - return log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t)); + return log1pf(t+sqrtf((float)2.0*t+t*t)); } } diff --git a/lib/msun/src/e_asin.c b/lib/msun/src/e_asin.c index 931b270498e6..fa180ab5701b 100644 --- a/lib/msun/src/e_asin.c +++ b/lib/msun/src/e_asin.c @@ -14,7 +14,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_asin(x) +/* asin(x) * Method : * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ... * we approximate asin(x) on [0,0.5] by @@ -68,7 +68,7 @@ qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ double -__ieee754_asin(double x) +asin(double x) { double t=0.0,w,p,q,c,r,s; int32_t hx,ix; diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index deaabb6a326e..db4b9b6034f7 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -32,7 +32,7 @@ static const double pio2 = 1.570796326794896558e+00; float -__ieee754_asinf(float x) +asinf(float x) { double s; float t,w,p,q; diff --git a/lib/msun/src/e_atan2.c b/lib/msun/src/e_atan2.c index 231a1611ee12..0b2e72102edb 100644 --- a/lib/msun/src/e_atan2.c +++ b/lib/msun/src/e_atan2.c @@ -15,7 +15,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_atan2(y,x) +/* atan2(y,x) * Method : * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). * 2. Reduce x to positive by (if x and y are unexceptional): @@ -58,7 +58,7 @@ static volatile double pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ double -__ieee754_atan2(double y, double x) +atan2(double y, double x) { double z; int32_t k,m,hx,hy,ix,iy; diff --git a/lib/msun/src/e_atan2f.c b/lib/msun/src/e_atan2f.c index 346d76746c05..4ea001df974a 100644 --- a/lib/msun/src/e_atan2f.c +++ b/lib/msun/src/e_atan2f.c @@ -30,7 +30,7 @@ static volatile float pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ float -__ieee754_atan2f(float y, float x) +atan2f(float y, float x) { float z; int32_t k,m,hx,hy,ix,iy; diff --git a/lib/msun/src/e_atanh.c b/lib/msun/src/e_atanh.c index 422ff2698067..41f3bcaca26d 100644 --- a/lib/msun/src/e_atanh.c +++ b/lib/msun/src/e_atanh.c @@ -15,7 +15,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_atanh(x) +/* atanh(x) * Method : * 1.Reduced x to positive by atanh(-x) = -atanh(x) * 2.For x>=0.5 @@ -42,7 +42,7 @@ static const double one = 1.0, huge = 1e300; static const double zero = 0.0; double -__ieee754_atanh(double x) +atanh(double x) { double t; int32_t hx,ix; diff --git a/lib/msun/src/e_atanhf.c b/lib/msun/src/e_atanhf.c index 4bd6a8f9b9c6..46643beb5ab0 100644 --- a/lib/msun/src/e_atanhf.c +++ b/lib/msun/src/e_atanhf.c @@ -24,7 +24,7 @@ static const float one = 1.0, huge = 1e30; static const float zero = 0.0; float -__ieee754_atanhf(float x) +atanhf(float x) { float t; int32_t hx,ix; diff --git a/lib/msun/src/e_cosh.c b/lib/msun/src/e_cosh.c index 246b5fbec860..071663eb4e15 100644 --- a/lib/msun/src/e_cosh.c +++ b/lib/msun/src/e_cosh.c @@ -14,7 +14,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_cosh(x) +/* cosh(x) * Method : * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2 * 1. Replace x by |x| (cosh(x) = cosh(-x)). @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, half=0.5, huge = 1.0e300; double -__ieee754_cosh(double x) +cosh(double x) { double t,w; int32_t ix; @@ -65,12 +65,12 @@ __ieee754_cosh(double x) /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */ if (ix < 0x40360000) { - t = __ieee754_exp(fabs(x)); + t = exp(fabs(x)); return half*t+half/t; } /* |x| in [22, log(maxdouble)] return half*exp(|x|) */ - if (ix < 0x40862E42) return half*__ieee754_exp(fabs(x)); + if (ix < 0x40862E42) return half*exp(fabs(x)); /* |x| in [log(maxdouble), overflowthresold] */ if (ix<=0x408633CE) diff --git a/lib/msun/src/e_coshf.c b/lib/msun/src/e_coshf.c index 95a0d6ee68ba..1673315d7b31 100644 --- a/lib/msun/src/e_coshf.c +++ b/lib/msun/src/e_coshf.c @@ -22,7 +22,7 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, half=0.5, huge = 1.0e30; float -__ieee754_coshf(float x) +coshf(float x) { float t,w; int32_t ix; @@ -43,12 +43,12 @@ __ieee754_coshf(float x) /* |x| in [0.5*ln2,9], return (exp(|x|)+1/exp(|x|))/2; */ if (ix < 0x41100000) { - t = __ieee754_expf(fabsf(x)); + t = expf(fabsf(x)); return half*t+half/t; } /* |x| in [9, log(maxfloat)] return half*exp(|x|) */ - if (ix < 0x42b17217) return half*__ieee754_expf(fabsf(x)); + if (ix < 0x42b17217) return half*expf(fabsf(x)); /* |x| in [log(maxfloat), overflowthresold] */ if (ix<=0x42b2d4fc) diff --git a/lib/msun/src/e_exp.c b/lib/msun/src/e_exp.c index dd04d8e839d5..59da39217391 100644 --- a/lib/msun/src/e_exp.c +++ b/lib/msun/src/e_exp.c @@ -13,7 +13,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_exp(x) +/* exp(x) * Returns the exponential of x. * * Method @@ -102,7 +102,7 @@ huge = 1.0e+300, twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ double -__ieee754_exp(double x) /* default IEEE double exp */ +exp(double x) /* default IEEE double exp */ { double y,hi=0.0,lo=0.0,c,t,twopk; int32_t k=0,xsb; diff --git a/lib/msun/src/e_expf.c b/lib/msun/src/e_expf.c index 4903d55c5ab3..620d341be274 100644 --- a/lib/msun/src/e_expf.c +++ b/lib/msun/src/e_expf.c @@ -43,7 +43,7 @@ huge = 1.0e+30, twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ float -__ieee754_expf(float x) +expf(float x) { float y,hi=0.0,lo=0.0,c,t,twopk; int32_t k=0,xsb; diff --git a/lib/msun/src/e_fmod.c b/lib/msun/src/e_fmod.c index 3a28dc4ff1f3..6d5f5332cb85 100644 --- a/lib/msun/src/e_fmod.c +++ b/lib/msun/src/e_fmod.c @@ -15,7 +15,7 @@ __FBSDID("$FreeBSD$"); /* - * __ieee754_fmod(x,y) + * fmod(x,y) * Return x mod y in exact arithmetic * Method: shift and subtract */ @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); static const double one = 1.0, Zero[] = {0.0, -0.0,}; double -__ieee754_fmod(double x, double y) +fmod(double x, double y) { int32_t n,hx,hy,hz,ix,iy,sx,i; u_int32_t lx,ly,lz; diff --git a/lib/msun/src/e_fmodf.c b/lib/msun/src/e_fmodf.c index 1b6bf36f9cba..3cef9213c1e5 100644 --- a/lib/msun/src/e_fmodf.c +++ b/lib/msun/src/e_fmodf.c @@ -17,7 +17,7 @@ __FBSDID("$FreeBSD$"); /* - * __ieee754_fmodf(x,y) + * fmodf(x,y) * Return x mod y in exact arithmetic * Method: shift and subtract */ @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); static const float one = 1.0, Zero[] = {0.0, -0.0,}; float -__ieee754_fmodf(float x, float y) +fmodf(float x, float y) { int32_t n,hx,hy,hz,ix,iy,sx,i; diff --git a/lib/msun/src/e_gamma.c b/lib/msun/src/e_gamma.c index 28fb5ccba6d6..a13f3e22c08b 100644 --- a/lib/msun/src/e_gamma.c +++ b/lib/msun/src/e_gamma.c @@ -15,10 +15,10 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_gamma(x) +/* gamma(x) * Return the logarithm of the Gamma function of x. * - * Method: call __ieee754_gamma_r + * Method: call gamma_r */ #include "math.h" @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); extern int signgam; double -__ieee754_gamma(double x) +gamma(double x) { - return __ieee754_gamma_r(x,&signgam); + return gamma_r(x,&signgam); } diff --git a/lib/msun/src/e_gamma_r.c b/lib/msun/src/e_gamma_r.c index 2c423dce8558..2d996cabca20 100644 --- a/lib/msun/src/e_gamma_r.c +++ b/lib/msun/src/e_gamma_r.c @@ -15,18 +15,18 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_gamma_r(x, signgamp) +/* gamma_r(x, signgamp) * Reentrant version of the logarithm of the Gamma function * with user provide pointer for the sign of Gamma(x). * - * Method: See __ieee754_lgamma_r + * Method: See lgamma_r */ #include "math.h" #include "math_private.h" double -__ieee754_gamma_r(double x, int *signgamp) +gamma_r(double x, int *signgamp) { - return __ieee754_lgamma_r(x,signgamp); + return lgamma_r(x,signgamp); } diff --git a/lib/msun/src/e_gammaf.c b/lib/msun/src/e_gammaf.c index c1b1668df975..563c1482282d 100644 --- a/lib/msun/src/e_gammaf.c +++ b/lib/msun/src/e_gammaf.c @@ -16,10 +16,10 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_gammaf(x) +/* gammaf(x) * Return the logarithm of the Gamma function of x. * - * Method: call __ieee754_gammaf_r + * Method: call gammaf_r */ #include "math.h" @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); extern int signgam; float -__ieee754_gammaf(float x) +gammaf(float x) { - return __ieee754_gammaf_r(x,&signgam); + return gammaf_r(x,&signgam); } diff --git a/lib/msun/src/e_gammaf_r.c b/lib/msun/src/e_gammaf_r.c index 9d7831b5501b..d7fc2db1e96c 100644 --- a/lib/msun/src/e_gammaf_r.c +++ b/lib/msun/src/e_gammaf_r.c @@ -16,18 +16,18 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_gammaf_r(x, signgamp) +/* gammaf_r(x, signgamp) * Reentrant version of the logarithm of the Gamma function * with user provide pointer for the sign of Gamma(x). * - * Method: See __ieee754_lgammaf_r + * Method: See lgammaf_r */ #include "math.h" #include "math_private.h" float -__ieee754_gammaf_r(float x, int *signgamp) +gammaf_r(float x, int *signgamp) { - return __ieee754_lgammaf_r(x,signgamp); + return lgammaf_r(x,signgamp); } diff --git a/lib/msun/src/e_hypot.c b/lib/msun/src/e_hypot.c index 7c455bb6652f..8e3f9317b3a6 100644 --- a/lib/msun/src/e_hypot.c +++ b/lib/msun/src/e_hypot.c @@ -14,7 +14,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_hypot(x,y) +/* hypot(x,y) * * Method : * If (assume round-to-nearest) z=x*x+y*y @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "math_private.h" double -__ieee754_hypot(double x, double y) +hypot(double x, double y) { double a,b,t1,t2,y1,y2,w; int32_t j,k,ha,hb; diff --git a/lib/msun/src/e_hypotf.c b/lib/msun/src/e_hypotf.c index 00610268fafb..a3b8c866697b 100644 --- a/lib/msun/src/e_hypotf.c +++ b/lib/msun/src/e_hypotf.c @@ -20,7 +20,7 @@ __FBSDID("$FreeBSD$"); #include "math_private.h" float -__ieee754_hypotf(float x, float y) +hypotf(float x, float y) { float a,b,t1,t2,y1,y2,w; int32_t j,k,ha,hb; @@ -67,14 +67,14 @@ __ieee754_hypotf(float x, float y) if (w>b) { SET_FLOAT_WORD(t1,ha&0xfffff000); t2 = a-t1; - w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1))); + w = sqrtf(t1*t1-(b*(-b)-t2*(a+t1))); } else { a = a+a; SET_FLOAT_WORD(y1,hb&0xfffff000); y2 = b - y1; SET_FLOAT_WORD(t1,(ha+0x00800000)&0xfffff000); t2 = a - t1; - w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); + w = sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); } if(k!=0) { SET_FLOAT_WORD(t1,(127+k)<<23); diff --git a/lib/msun/src/e_j0.c b/lib/msun/src/e_j0.c index 5d862b6f834d..c43ab6996b4a 100644 --- a/lib/msun/src/e_j0.c +++ b/lib/msun/src/e_j0.c @@ -13,7 +13,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_j0(x), __ieee754_y0(x) +/* j0(x), y0(x) * Bessel function of the first and second kinds of order zero. * Method -- j0(x): * 1. For tiny x, we use j0(x) = 1 - x^2/4 + x^4/64 - ... @@ -83,7 +83,7 @@ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ static const double zero = 0, qrtr = 0.25; double -__ieee754_j0(double x) +j0(double x) { double z, s,c,ss,cc,r,u,v; int32_t hx,ix; @@ -143,7 +143,7 @@ v03 = 2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */ v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */ double -__ieee754_y0(double x) +y0(double x) { double z, s,c,ss,cc,u,v; int32_t hx,ix,lx; @@ -192,12 +192,12 @@ __ieee754_y0(double x) return z; } if(ix<=0x3e400000) { /* x < 2**-27 */ - return(u00 + tpi*__ieee754_log(x)); + return(u00 + tpi*log(x)); } z = x*x; u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06))))); v = one+z*(v01+z*(v02+z*(v03+z*v04))); - return(u/v + tpi*(__ieee754_j0(x)*__ieee754_log(x))); + return(u/v + tpi*(j0(x)*log(x))); } /* The asymptotic expansions of pzero is diff --git a/lib/msun/src/e_j0f.c b/lib/msun/src/e_j0f.c index 1c5ef4da1b49..290be04fc900 100644 --- a/lib/msun/src/e_j0f.c +++ b/lib/msun/src/e_j0f.c @@ -45,7 +45,7 @@ S04 = 1.1661400734e-09; /* 0x30a045e8 */ static const float zero = 0, qrtr = 0.25; float -__ieee754_j0f(float x) +j0f(float x) { float z, s,c,ss,cc,r,u,v; int32_t hx,ix; @@ -105,7 +105,7 @@ v03 = 2.5915085189e-07, /* 0x348b216c */ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ float -__ieee754_y0f(float x) +y0f(float x) { float z, s,c,ss,cc,u,v; int32_t hx,ix; @@ -147,12 +147,12 @@ __ieee754_y0f(float x) return z; } if(ix<=0x39000000) { /* x < 2**-13 */ - return(u00 + tpi*__ieee754_logf(x)); + return(u00 + tpi*logf(x)); } z = x*x; u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06))))); v = one+z*(v01+z*(v02+z*(v03+z*v04))); - return(u/v + tpi*(__ieee754_j0f(x)*__ieee754_logf(x))); + return(u/v + tpi*(j0f(x)*logf(x))); } /* The asymptotic expansions of pzero is diff --git a/lib/msun/src/e_j1.c b/lib/msun/src/e_j1.c index fb4462738368..ee3f6fcc69d4 100644 --- a/lib/msun/src/e_j1.c +++ b/lib/msun/src/e_j1.c @@ -13,7 +13,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_j1(x), __ieee754_y1(x) +/* j1(x), y1(x) * Bessel function of the first and second kinds of order zero. * Method -- j1(x): * 1. For tiny x, we use j1(x) = x/2 - x^3/16 + x^5/384 - ... @@ -84,7 +84,7 @@ s05 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */ static const double zero = 0.0; double -__ieee754_j1(double x) +j1(double x) { double z, s,c,ss,cc,r,u,v,y; int32_t hx,ix; @@ -140,7 +140,7 @@ static const double V0[5] = { }; double -__ieee754_y1(double x) +y1(double x) { double z, s,c,ss,cc,u,v; int32_t hx,ix,lx; @@ -190,7 +190,7 @@ __ieee754_y1(double x) z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); - return(x*(u/v) + tpi*(__ieee754_j1(x)*__ieee754_log(x)-one/x)); + return(x*(u/v) + tpi*(j1(x)*log(x)-one/x)); } /* For x >= 8, the asymptotic expansions of pone is diff --git a/lib/msun/src/e_j1f.c b/lib/msun/src/e_j1f.c index c6c45c107afa..e1f4498b71af 100644 --- a/lib/msun/src/e_j1f.c +++ b/lib/msun/src/e_j1f.c @@ -46,7 +46,7 @@ s05 = 1.2354227016e-11; /* 0x2d59567e */ static const float zero = 0.0; float -__ieee754_j1f(float x) +j1f(float x) { float z, s,c,ss,cc,r,u,v,y; int32_t hx,ix; @@ -102,7 +102,7 @@ static const float V0[5] = { }; float -__ieee754_y1f(float x) +y1f(float x) { float z, s,c,ss,cc,u,v; int32_t hx,ix; @@ -145,7 +145,7 @@ __ieee754_y1f(float x) z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); - return(x*(u/v) + tpi*(__ieee754_j1f(x)*__ieee754_logf(x)-one/x)); + return(x*(u/v) + tpi*(j1f(x)*logf(x)-one/x)); } /* For x >= 8, the asymptotic expansions of pone is diff --git a/lib/msun/src/e_jn.c b/lib/msun/src/e_jn.c index 5aaebd400065..6b876ce69554 100644 --- a/lib/msun/src/e_jn.c +++ b/lib/msun/src/e_jn.c @@ -14,7 +14,7 @@ __FBSDID("$FreeBSD$"); /* - * __ieee754_jn(n, x), __ieee754_yn(n, x) + * jn(n, x), yn(n, x) * floating point Bessel's function of the 1st and 2nd kind * of order n * @@ -51,7 +51,7 @@ one = 1.00000000000000000000e+00; /* 0x3FF00000, 0x00000000 */ static const double zero = 0.00000000000000000000e+00; double -__ieee754_jn(int n, double x) +jn(int n, double x) { int32_t i,hx,ix,lx, sgn; double a, b, c, s, temp, di; @@ -69,8 +69,8 @@ __ieee754_jn(int n, double x) x = -x; hx ^= 0x80000000; } - if(n==0) return(__ieee754_j0(x)); - if(n==1) return(__ieee754_j1(x)); + if(n==0) return(j0(x)); + if(n==1) return(j1(x)); sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */ x = fabs(x); if((ix|lx)==0||ix>=0x7ff00000) /* if x is 0 or inf */ @@ -100,8 +100,8 @@ __ieee754_jn(int n, double x) } b = invsqrtpi*temp/sqrt(x); } else { - a = __ieee754_j0(x); - b = __ieee754_j1(x); + a = j0(x); + b = j1(x); for(i=1;i<n;i++){ temp = b; b = b*((double)(i+i)/x) - a; /* avoid underflow */ @@ -177,7 +177,7 @@ __ieee754_jn(int n, double x) */ tmp = n; v = two/x; - tmp = tmp*__ieee754_log(fabs(v*tmp)); + tmp = tmp*log(fabs(v*tmp)); if(tmp<7.09782712893383973096e+02) { for(i=n-1,di=(double)(i+i);i>0;i--){ temp = b; @@ -201,8 +201,8 @@ __ieee754_jn(int n, double x) } } } - z = __ieee754_j0(x); - w = __ieee754_j1(x); + z = j0(x); + w = j1(x); if (fabs(z) >= fabs(w)) b = (t*z/b); else @@ -213,7 +213,7 @@ __ieee754_jn(int n, double x) } double -__ieee754_yn(int n, double x) +yn(int n, double x) { int32_t i,hx,ix,lx; int32_t sign; @@ -232,8 +232,8 @@ __ieee754_yn(int n, double x) n = -n; sign = 1 - ((n&1)<<1); } - if(n==0) return(__ieee754_y0(x)); - if(n==1) return(sign*__ieee754_y1(x)); + if(n==0) return(y0(x)); + if(n==1) return(sign*y1(x)); if(ix==0x7ff00000) return zero; if(ix>=0x52D00000) { /* x > 2**302 */ /* (x >> n**2) @@ -259,8 +259,8 @@ __ieee754_yn(int n, double x) b = invsqrtpi*temp/sqrt(x); } else { u_int32_t high; - a = __ieee754_y0(x); - b = __ieee754_y1(x); + a = y0(x); + b = y1(x); /* quit if b is -inf */ GET_HIGH_WORD(high,b); for(i=1;i<n&&high!=0xfff00000;i++){ diff --git a/lib/msun/src/e_jnf.c b/lib/msun/src/e_jnf.c index 965feeb666d4..ba586226dae5 100644 --- a/lib/msun/src/e_jnf.c +++ b/lib/msun/src/e_jnf.c @@ -32,7 +32,7 @@ one = 1.0000000000e+00; /* 0x3F800000 */ static const float zero = 0.0000000000e+00; float -__ieee754_jnf(int n, float x) +jnf(int n, float x) { int32_t i,hx,ix, sgn; float a, b, temp, di; @@ -50,16 +50,16 @@ __ieee754_jnf(int n, float x) x = -x; hx ^= 0x80000000; } - if(n==0) return(__ieee754_j0f(x)); - if(n==1) return(__ieee754_j1f(x)); + if(n==0) return(j0f(x)); + if(n==1) return(j1f(x)); sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */ x = fabsf(x); if(ix==0||ix>=0x7f800000) /* if x is 0 or inf */ b = zero; else if((float)n<=x) { /* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */ - a = __ieee754_j0f(x); - b = __ieee754_j1f(x); + a = j0f(x); + b = j1f(x); for(i=1;i<n;i++){ temp = b; b = b*((float)(i+i)/x) - a; /* avoid underflow */ @@ -134,7 +134,7 @@ __ieee754_jnf(int n, float x) */ tmp = n; v = two/x; - tmp = tmp*__ieee754_logf(fabsf(v*tmp)); + tmp = tmp*logf(fabsf(v*tmp)); if(tmp<(float)8.8721679688e+01) { for(i=n-1,di=(float)(i+i);i>0;i--){ temp = b; @@ -158,8 +158,8 @@ __ieee754_jnf(int n, float x) } } } - z = __ieee754_j0f(x); - w = __ieee754_j1f(x); + z = j0f(x); + w = j1f(x); if (fabsf(z) >= fabsf(w)) b = (t*z/b); else @@ -170,7 +170,7 @@ __ieee754_jnf(int n, float x) } float -__ieee754_ynf(int n, float x) +ynf(int n, float x) { int32_t i,hx,ix,ib; int32_t sign; @@ -186,12 +186,12 @@ __ieee754_ynf(int n, float x) n = -n; sign = 1 - ((n&1)<<1); } - if(n==0) return(__ieee754_y0f(x)); - if(n==1) return(sign*__ieee754_y1f(x)); + if(n==0) return(y0f(x)); + if(n==1) return(sign*y1f(x)); if(ix==0x7f800000) return zero; - a = __ieee754_y0f(x); - b = __ieee754_y1f(x); + a = y0f(x); + b = y1f(x); /* quit if b is -inf */ GET_FLOAT_WORD(ib,b); for(i=1;i<n&&ib!=0xff800000;i++){ diff --git a/lib/msun/src/e_lgamma.c b/lib/msun/src/e_lgamma.c index 43f5175603ec..9c4a30e6e135 100644 --- a/lib/msun/src/e_lgamma.c +++ b/lib/msun/src/e_lgamma.c @@ -15,10 +15,10 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -/* __ieee754_lgamma(x) +/* lgamma(x) * Return the logarithm of the Gamma function of x. * - * Method: call __ieee754_lgamma_r + * Method: call lgamma_r */ #include <float.h> @@ -29,9 +29,9 @@ __FBSDID("$FreeBSD$"); extern int signgam; double *** 656 LINES SKIPPED ***