Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
- Fix for default mtree style
- Update libelf
- Importing libexecinfo
- Resynchronize GCC, mpc, gmp, mpfr
- build.sh: Replace params with show-params.
This has been done as the make target has been renamed in the same
way, while a new target named params has been added. This new
target generates a file containing all the parameters, instead of
printing it on the console.
- Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
get getservbyport() out of the inner loop
Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mathimpl.h,v 1.9 2008/05/01 15:33:15 christos Exp $ */
|
||||
/* $NetBSD: mathimpl.h,v 1.10 2011/11/02 02:34:56 christos Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -99,6 +99,17 @@
|
||||
|
||||
#endif /* defined(__vax__)||defined(tahoe) */
|
||||
|
||||
#ifdef __vax__
|
||||
#include <machine/float.h>
|
||||
#define _TINY DBL_EPSILON
|
||||
#define _TINYER DBL_EPSILON
|
||||
#define _HUGE DBL_MAX
|
||||
#else
|
||||
#define _TINY 1e-300
|
||||
#define _TINYER 1e-308
|
||||
#define _HUGE 1e+300
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Functions internal to the math package, yet not static.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_asincos.c,v 1.7 2003/08/07 16:44:50 agc Exp $ */
|
||||
/* $NetBSD: n_asincos.c,v 1.8 2013/11/24 14:41:53 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -103,6 +103,12 @@ asin(double x)
|
||||
|
||||
}
|
||||
|
||||
float
|
||||
asinf(float x)
|
||||
{
|
||||
return (float)asin(x);
|
||||
}
|
||||
|
||||
/* ACOS(X)
|
||||
* RETURNS ARC COS OF X
|
||||
* DOUBLE PRECISION (IEEE DOUBLE 53 bits, VAX D FORMAT 56 bits)
|
||||
@@ -168,3 +174,9 @@ acos(double x)
|
||||
t=atan2(one,0.0); /* t = PI/2 */
|
||||
return(t+t);
|
||||
}
|
||||
|
||||
float
|
||||
acosf(float x)
|
||||
{
|
||||
return (float)acos(x);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_atan.c,v 1.5 2003/08/07 16:44:50 agc Exp $ */
|
||||
/* $NetBSD: n_atan.c,v 1.6 2013/11/24 14:41:53 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -85,3 +85,11 @@ atan(double x)
|
||||
double one=1.0;
|
||||
return(atan2(x,one));
|
||||
}
|
||||
|
||||
float
|
||||
atanf(float x)
|
||||
{
|
||||
float one=1.0;
|
||||
return (float)atan2(x,one);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_cbrt.c,v 1.5 2003/08/07 16:44:50 agc Exp $ */
|
||||
/* $NetBSD: n_cbrt.c,v 1.6 2013/11/24 14:49:00 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -62,6 +62,18 @@ static const double
|
||||
F= 45./28.,
|
||||
G= 5./14.;
|
||||
|
||||
float
|
||||
cbrtf(float x)
|
||||
{
|
||||
return (float)cbrt(x);
|
||||
}
|
||||
|
||||
long double
|
||||
cbrtl(long double x)
|
||||
{
|
||||
return cbrt((double)x);
|
||||
}
|
||||
|
||||
double
|
||||
cbrt(double x)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_erf.c,v 1.7 2005/05/03 04:18:32 matt Exp $ */
|
||||
/* $NetBSD: n_erf.c,v 1.9 2013/11/24 15:16:49 martin Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -161,7 +161,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
|
||||
static const double
|
||||
tiny = 1e-300,
|
||||
tiny = _TINY,
|
||||
half = 0.5,
|
||||
one = 1.0,
|
||||
two = 2.0,
|
||||
@@ -275,7 +275,7 @@ erf(double x)
|
||||
ax = - ax;
|
||||
if (ax < .84375) {
|
||||
if (ax < 3.7e-09) {
|
||||
if (ax < 1.0e-308)
|
||||
if (ax < _TINYER)
|
||||
return 0.125*(8.0*x+p0t8*x); /*avoid underflow */
|
||||
return x + p0*x;
|
||||
}
|
||||
@@ -320,6 +320,12 @@ erf(double x)
|
||||
return (z-one);
|
||||
}
|
||||
|
||||
float
|
||||
erff(float x)
|
||||
{
|
||||
return (float)erf(x);
|
||||
}
|
||||
|
||||
double
|
||||
erfc(double x)
|
||||
{
|
||||
@@ -396,3 +402,11 @@ erfc(double x)
|
||||
else
|
||||
return two-r;
|
||||
}
|
||||
|
||||
float
|
||||
erfcf(float x)
|
||||
{
|
||||
return (float)erfc(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_expm1.c,v 1.7 2008/04/29 15:10:02 uwe Exp $ */
|
||||
/* $NetBSD: n_expm1.c,v 1.8 2013/11/24 18:50:58 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -111,6 +111,12 @@ ic(invln2, 1.4426950408889633870E0, 0, 1.71547652B82FE)
|
||||
#define PREC 53
|
||||
#endif /* defined(__vax__)||defined(tahoe) */
|
||||
|
||||
float
|
||||
expm1f(float x)
|
||||
{
|
||||
return (float)expm1(x);
|
||||
}
|
||||
|
||||
double
|
||||
expm1(double x)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_fmod.c,v 1.5 2003/08/07 16:44:51 agc Exp $ */
|
||||
/* $NetBSD: n_fmod.c,v 1.7 2013/11/22 10:59:31 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -66,6 +66,13 @@ static char sccsid[] = "@(#)fmod.c 8.1 (Berkeley) 6/4/93";
|
||||
extern int isnan(),finite();
|
||||
#endif /* !defined(__vax__) && !defined(tahoe) */
|
||||
|
||||
#if DBL_MANT_DIG == LDBL_MANT_DIG && DBL_MIN_EXP == LDBL_MIN_EXP \
|
||||
&& DBL_MIN_EXP == LDBL_MIN_EXP
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(fmodl, fmod);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef TEST_FMOD
|
||||
static double
|
||||
_fmod(double x, double y)
|
||||
@@ -95,6 +102,12 @@ fmod(double x, double y)
|
||||
return x >= (double)0 ? r : -r;
|
||||
}
|
||||
|
||||
float
|
||||
fmodf(float x, float y)
|
||||
{
|
||||
return fmod(x, y);
|
||||
}
|
||||
|
||||
#ifdef TEST_FMOD
|
||||
extern long random();
|
||||
extern double fmod();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_gamma.c,v 1.6 2006/11/24 21:15:54 wiz Exp $ */
|
||||
/* $NetBSD: n_gamma.c,v 1.9 2013/11/09 21:41:03 christos Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -119,7 +119,7 @@ static struct Double ratfun_gam (double, double);
|
||||
#define Pa6 5.69394463439411649408050664078e-03
|
||||
#define Pa7 -1.44705562421428915453880392761e-02
|
||||
|
||||
static const double zero = 0., one = 1.0, tiny = 1e-300;
|
||||
static const double zero = 0., one = 1.0, tiny = _TINY;
|
||||
/*
|
||||
* TRUNC sets trailing bits in a floating-point number to zero.
|
||||
* is a temporary variable.
|
||||
@@ -135,8 +135,7 @@ static int endian;
|
||||
#endif
|
||||
|
||||
double
|
||||
gamma(x)
|
||||
double x;
|
||||
gamma(double x)
|
||||
{
|
||||
double b;
|
||||
struct Double u;
|
||||
@@ -159,6 +158,7 @@ gamma(x)
|
||||
else return (one/x);
|
||||
}
|
||||
b =one+1e-20; /* Raise inexact flag. ??? -ragge */
|
||||
__USE(b);
|
||||
return (one/x);
|
||||
} else if (!finite(x)) {
|
||||
if (_IEEE) /* x = NaN, -Inf */
|
||||
|
||||
+30
-14
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_j0.c,v 1.6 2003/08/07 16:44:51 agc Exp $ */
|
||||
/* $NetBSD: n_j0.c,v 1.7 2011/11/02 02:34:56 christos Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -123,7 +123,7 @@ static char sccsid[] = "@(#)j0.c 8.2 (Berkeley) 11/30/93";
|
||||
static double pzero (double), qzero (double);
|
||||
|
||||
static const double
|
||||
huge = 1e300,
|
||||
huge = _HUGE,
|
||||
zero = 0.0,
|
||||
one = 1.0,
|
||||
invsqrtpi= 5.641895835477562869480794515607725858441e-0001,
|
||||
@@ -144,8 +144,11 @@ j0(double x)
|
||||
double z, s,c,ss,cc,r,u,v;
|
||||
|
||||
if (!finite(x)) {
|
||||
if (_IEEE) return one/(x*x);
|
||||
else return (0);
|
||||
#if _IEEE
|
||||
return one/(x*x);
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
x = fabs(x);
|
||||
if (x >= 2.0) { /* |x| >= 2.0 */
|
||||
@@ -162,9 +165,12 @@ j0(double x)
|
||||
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
|
||||
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
|
||||
*/
|
||||
if (_IEEE && x> 6.80564733841876927e+38) /* 2^129 */
|
||||
#if _IEEE
|
||||
if (x > 6.80564733841876927e+38) /* 2^129 */
|
||||
z = (invsqrtpi*cc)/sqrt(x);
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
u = pzero(x); v = qzero(x);
|
||||
z = invsqrtpi*(u*cc-v*ss)/sqrt(x);
|
||||
}
|
||||
@@ -207,18 +213,25 @@ y0(double x)
|
||||
double z, s, c, ss, cc, u, v;
|
||||
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */
|
||||
if (!finite(x)) {
|
||||
if (_IEEE)
|
||||
#if _IEEE
|
||||
return (one/(x+x*x));
|
||||
else
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
if (x == 0) {
|
||||
if (_IEEE) return (-one/zero);
|
||||
else return(infnan(-ERANGE));
|
||||
#if _IEEE
|
||||
return (-one/zero);
|
||||
#else
|
||||
return(infnan(-ERANGE));
|
||||
#endif
|
||||
}
|
||||
if (x<0) {
|
||||
if (_IEEE) return (zero/zero);
|
||||
else return (infnan(EDOM));
|
||||
#if _IEEE
|
||||
return (zero/zero);
|
||||
#else
|
||||
return (infnan(EDOM));
|
||||
#endif
|
||||
}
|
||||
if (x >= 2.00) { /* |x| >= 2.0 */
|
||||
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
|
||||
@@ -245,9 +258,12 @@ y0(double x)
|
||||
if ((s*c)<zero) cc = z/ss;
|
||||
else ss = z/cc;
|
||||
}
|
||||
if (_IEEE && x > 6.80564733841876927e+38) /* > 2^129 */
|
||||
#if _IEEE
|
||||
if (x > 6.80564733841876927e+38) /* > 2^129 */
|
||||
z = (invsqrtpi*ss)/sqrt(x);
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
u = pzero(x); v = qzero(x);
|
||||
z = invsqrtpi*(u*ss+v*cc)/sqrt(x);
|
||||
}
|
||||
|
||||
+24
-11
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_j1.c,v 1.6 2003/08/07 16:44:51 agc Exp $ */
|
||||
/* $NetBSD: n_j1.c,v 1.7 2011/11/02 02:34:56 christos Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -123,7 +123,7 @@ static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93";
|
||||
static double pone (double), qone (double);
|
||||
|
||||
static const double
|
||||
huge = 1e300,
|
||||
huge = _HUGE,
|
||||
zero = 0.0,
|
||||
one = 1.0,
|
||||
invsqrtpi= 5.641895835477562869480794515607725858441e-0001,
|
||||
@@ -149,9 +149,11 @@ j1(double x)
|
||||
double z, s,c,ss,cc,r,u,v,y;
|
||||
y = fabs(x);
|
||||
if (!finite(x)) { /* Inf or NaN */
|
||||
if (_IEEE && x != x)
|
||||
#if _IEEE
|
||||
if (x != x)
|
||||
return(x);
|
||||
else
|
||||
#endif
|
||||
return (copysign(x, zero));
|
||||
}
|
||||
y = fabs(x);
|
||||
@@ -212,19 +214,27 @@ y1(double x)
|
||||
double z, s, c, ss, cc, u, v;
|
||||
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
|
||||
if (!finite(x)) {
|
||||
if (!_IEEE) return (infnan(EDOM));
|
||||
else if (x < 0)
|
||||
#if _IEEE
|
||||
if (x < 0)
|
||||
return(zero/zero);
|
||||
else if (x > 0)
|
||||
return (0);
|
||||
else
|
||||
return(x);
|
||||
#else
|
||||
return (infnan(EDOM));
|
||||
#endif
|
||||
}
|
||||
if (x <= 0) {
|
||||
if (_IEEE && x == 0) return -one/zero;
|
||||
else if(x == 0) return(infnan(-ERANGE));
|
||||
else if(_IEEE) return (zero/zero);
|
||||
else return(infnan(EDOM));
|
||||
#if _IEEE
|
||||
if (x == 0) return -one/zero;
|
||||
#endif
|
||||
if(x == 0) return(infnan(-ERANGE));
|
||||
#if _IEEE
|
||||
return (zero/zero);
|
||||
#else
|
||||
return(infnan(EDOM));
|
||||
#endif
|
||||
}
|
||||
if (x >= 2) { /* |x| >= 2.0 */
|
||||
s = sin(x);
|
||||
@@ -247,9 +257,12 @@ y1(double x)
|
||||
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
|
||||
* to compute the worse one.
|
||||
*/
|
||||
if (_IEEE && x>two_129) {
|
||||
#if _IEEE
|
||||
if (x>two_129) {
|
||||
z = (invsqrtpi*ss)/sqrt(x);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
u = pone(x); v = qone(x);
|
||||
z = invsqrtpi*(u*ss+v*cc)/sqrt(x);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_jn.c,v 1.6 2003/08/07 16:44:51 agc Exp $ */
|
||||
/* $NetBSD: n_jn.c,v 1.7 2011/11/02 02:34:56 christos Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -118,7 +118,9 @@ jn(int n, double x)
|
||||
* Thus, J(-n,x) = J(n,-x)
|
||||
*/
|
||||
/* if J(n,NaN) is NaN */
|
||||
if (_IEEE && isnan(x)) return x+x;
|
||||
#if _IEEE
|
||||
if (snan(x)) return x+x;
|
||||
#endif
|
||||
if (n<0){
|
||||
n = -n;
|
||||
x = -x;
|
||||
@@ -131,7 +133,8 @@ jn(int n, double x)
|
||||
b = zero;
|
||||
else if ((double) n <= x) {
|
||||
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
|
||||
if (_IEEE && x >= 8.148143905337944345e+090) {
|
||||
#if _IEEE
|
||||
if (x >= 8.148143905337944345e+090) {
|
||||
/* x >= 2**302 */
|
||||
/* (x >> n**2)
|
||||
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
@@ -153,7 +156,9 @@ jn(int n, double x)
|
||||
case 3: temp = cos(x)-sin(x); break;
|
||||
}
|
||||
b = invsqrtpi*temp/sqrt(x);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
a = j0(x);
|
||||
b = j1(x);
|
||||
for(i=1;i<n;i++){
|
||||
@@ -274,7 +279,8 @@ yn(int n, double x)
|
||||
}
|
||||
if (n == 0) return(y0(x));
|
||||
if (n == 1) return(sign*y1(x));
|
||||
if(_IEEE && x >= 8.148143905337944345e+090) { /* x > 2**302 */
|
||||
#if _IEEE
|
||||
if(x >= 8.148143905337944345e+090) { /* x > 2**302 */
|
||||
/* (x >> n**2)
|
||||
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
* Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
|
||||
@@ -295,7 +301,9 @@ yn(int n, double x)
|
||||
case 3: temp = sin(x)+cos(x); break;
|
||||
}
|
||||
b = invsqrtpi*temp/sqrt(x);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
a = y0(x);
|
||||
b = y1(x);
|
||||
/* quit if b is -inf */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_pow.c,v 1.7 2003/08/07 16:44:52 agc Exp $ */
|
||||
/* $NetBSD: n_pow.c,v 1.9 2013/11/24 14:46:18 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -128,6 +128,12 @@ powf(float x, float y)
|
||||
return pow((double) x, (double) (y));
|
||||
}
|
||||
|
||||
long double
|
||||
powl(long double x, long double y)
|
||||
{
|
||||
return pow((double) x, (double) (y));
|
||||
}
|
||||
|
||||
double
|
||||
pow(double x, double y)
|
||||
{
|
||||
@@ -176,7 +182,7 @@ static double
|
||||
pow_P(double x, double y)
|
||||
{
|
||||
struct Double s, t;
|
||||
double huge = 1e300, tiny = 1e-300;
|
||||
double huge = _HUGE, tiny = _TINY;
|
||||
|
||||
if (x == zero) {
|
||||
if (y > zero)
|
||||
|
||||
Reference in New Issue
Block a user