Fix a bunch of warnings introduced by more flags to cc.
This commit is contained in:
parent
2959c0da1f
commit
04195f0e89
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mathimpl.h,v 1.1 1995/10/10 23:36:31 ragge Exp $ */
|
||||
/* $NetBSD: mathimpl.h,v 1.2 1997/10/20 14:11:35 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -91,8 +91,9 @@
|
||||
/*
|
||||
* Functions internal to the math package, yet not static.
|
||||
*/
|
||||
extern double __exp__E();
|
||||
extern double __log__L();
|
||||
extern double __exp__E __P((double, double));
|
||||
extern double __log__L __P((double));
|
||||
extern int infnan __P((int));
|
||||
|
||||
struct Double {double a, b;};
|
||||
double __exp__D __P((double, double));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_acosh.c,v 1.1 1995/10/10 23:36:33 ragge Exp $ */
|
||||
/* $NetBSD: n_acosh.c,v 1.2 1997/10/20 14:11:44 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)acosh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* ACOSH(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_asincos.c,v 1.1 1995/10/10 23:36:34 ragge Exp $ */
|
||||
/* $NetBSD: n_asincos.c,v 1.2 1997/10/20 14:11:49 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)asincos.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* ASIN(X)
|
||||
@ -94,7 +96,7 @@ double
|
||||
asin(x)
|
||||
double x;
|
||||
{
|
||||
double s,t,copysign(),atan2(),sqrt(),one=1.0;
|
||||
double s,t,one=1.0;
|
||||
#if !defined(vax)&&!defined(tahoe)
|
||||
if(x!=x) return(x); /* x is NaN */
|
||||
#endif /* !defined(vax)&&!defined(tahoe) */
|
||||
@ -162,7 +164,7 @@ double
|
||||
acos(x)
|
||||
double x;
|
||||
{
|
||||
double t,copysign(),atan2(),sqrt(),one=1.0;
|
||||
double t,one=1.0;
|
||||
#if !defined(vax)&&!defined(tahoe)
|
||||
if(x!=x) return(x);
|
||||
#endif /* !defined(vax)&&!defined(tahoe) */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_asinh.c,v 1.1 1995/10/10 23:36:35 ragge Exp $ */
|
||||
/* $NetBSD: n_asinh.c,v 1.2 1997/10/20 14:11:54 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)asinh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* ASINH(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_atan.c,v 1.1 1995/10/10 23:36:36 ragge Exp $ */
|
||||
/* $NetBSD: n_atan.c,v 1.2 1997/10/20 14:11:58 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)atan.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* ATAN(X)
|
||||
@ -79,10 +81,11 @@ static char sccsid[] = "@(#)atan.c 8.1 (Berkeley) 6/4/93";
|
||||
* maximum observed error in ulps (units in the last place) was
|
||||
* 0.85 ulps.
|
||||
*/
|
||||
#include "mathimpl.h"
|
||||
|
||||
double atan(x)
|
||||
double x;
|
||||
{
|
||||
double atan2(),one=1.0;
|
||||
double one=1.0;
|
||||
return(atan2(x,one));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_atanh.c,v 1.1 1995/10/10 23:36:38 ragge Exp $ */
|
||||
/* $NetBSD: n_atanh.c,v 1.2 1997/10/20 14:12:02 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)atanh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* ATANH(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_cosh.c,v 1.1 1995/10/10 23:36:42 ragge Exp $ */
|
||||
/* $NetBSD: n_cosh.c,v 1.2 1997/10/20 14:12:06 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cosh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* COSH(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_erf.c,v 1.1 1995/10/10 23:36:43 ragge Exp $ */
|
||||
/* $NetBSD: n_erf.c,v 1.2 1997/10/20 14:12:10 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "mathimpl.h"
|
||||
@ -148,7 +150,7 @@ static char sccsid[] = "@(#)erf.c 8.1 (Berkeley) 6/4/93";
|
||||
|
||||
#if defined(vax) || defined(tahoe)
|
||||
#define _IEEE 0
|
||||
#define TRUNC(x) (double) (float) (x)
|
||||
#define TRUNC(x) (double)(x) = (float)(x)
|
||||
#else
|
||||
#define _IEEE 1
|
||||
#define TRUNC(x) *(((int *) &x) + 1) &= 0xf8000000
|
||||
@ -267,7 +269,7 @@ rd13 = -1.42821001129434127360582351685e+007;
|
||||
double erf(x)
|
||||
double x;
|
||||
{
|
||||
double R,S,P,Q,ax,s,y,z,r,fabs(),exp();
|
||||
double R,S,P,Q,ax,s,y,z,r;
|
||||
if(!finite(x)) { /* erf(nan)=nan */
|
||||
if (isnan(x))
|
||||
return(x);
|
||||
@ -325,7 +327,7 @@ double erf(x)
|
||||
double erfc(x)
|
||||
double x;
|
||||
{
|
||||
double R,S,P,Q,s,ax,y,z,r,fabs(),__exp__D();
|
||||
double R,S,P,Q,s,ax,y,z,r;
|
||||
if (!finite(x)) {
|
||||
if (isnan(x)) /* erfc(NaN) = NaN */
|
||||
return(x);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_exp.c,v 1.1 1995/10/10 23:36:44 ragge Exp $ */
|
||||
/* $NetBSD: n_exp.c,v 1.2 1997/10/20 14:12:17 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* EXP(X)
|
||||
@ -163,7 +165,7 @@ double x;
|
||||
double __exp__D(x, c)
|
||||
double x, c;
|
||||
{
|
||||
double z,hi,lo, t;
|
||||
double z,hi,lo;
|
||||
int k;
|
||||
|
||||
#if !defined(vax)&&!defined(tahoe)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_exp__E.c,v 1.1 1995/10/10 23:36:45 ragge Exp $ */
|
||||
/* $NetBSD: n_exp__E.c,v 1.2 1997/10/20 14:12:21 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exp__E.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* exp__E(x,c)
|
||||
@ -131,7 +133,7 @@ double x,c;
|
||||
/* end of |x| > small */
|
||||
|
||||
else {
|
||||
if(x!=zero) one+small; /* raise the inexact flag */
|
||||
if(x!=zero) w=one+small; /* raise the inexact flag ??? -ragge */
|
||||
return(copysign(zero,x));
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_expm1.c,v 1.1 1995/10/10 23:36:46 ragge Exp $ */
|
||||
/* $NetBSD: n_expm1.c,v 1.2 1997/10/20 14:12:26 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)expm1.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* EXPM1(X)
|
||||
@ -155,7 +157,7 @@ double x;
|
||||
else
|
||||
/* expm1(-big#) rounded to -1 (inexact) */
|
||||
if(finite(x))
|
||||
{ ln2hi+ln2lo; return(-one);}
|
||||
{ c=ln2hi+ln2lo; return(-one);} /* ??? -ragge */
|
||||
|
||||
/* expm1(-INF) is -1 */
|
||||
else return(-one);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_floor.c,v 1.1 1995/10/10 23:36:48 ragge Exp $ */
|
||||
/* $NetBSD: n_floor.c,v 1.2 1997/10/20 14:12:30 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)floor.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "mathimpl.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_fmod.c,v 1.1 1995/10/10 23:36:49 ragge Exp $ */
|
||||
/* $NetBSD: n_fmod.c,v 1.2 1997/10/20 14:12:34 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)fmod.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include "mathimpl.h"
|
||||
@ -67,7 +69,6 @@ static char sccsid[] = "@(#)fmod.c 8.1 (Berkeley) 6/4/93";
|
||||
#if !defined(vax) && !defined(tahoe)
|
||||
extern int isnan(),finite();
|
||||
#endif /* !defined(vax) && !defined(tahoe) */
|
||||
extern double frexp(),ldexp(),fabs();
|
||||
|
||||
#ifdef TEST_FMOD
|
||||
static double
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_gamma.c,v 1.1 1995/10/10 23:36:50 ragge Exp $ */
|
||||
/* $NetBSD: n_gamma.c,v 1.2 1997/10/20 14:12:39 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)gamma.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -140,6 +142,7 @@ double
|
||||
gamma(x)
|
||||
double x;
|
||||
{
|
||||
double b;
|
||||
struct Double u;
|
||||
endian = (*(int *) &one) ? 1 : 0;
|
||||
|
||||
@ -156,7 +159,7 @@ gamma(x)
|
||||
if (x == 0.0)
|
||||
if (!_IEEE) return (infnan(ERANGE));
|
||||
else return (one/x);
|
||||
one+1e-20; /* Raise inexact flag. */
|
||||
b =one+1e-20; /* Raise inexact flag. ??? -ragge */
|
||||
return (one/x);
|
||||
} else if (!finite(x)) {
|
||||
if (_IEEE) /* x = NaN, -Inf */
|
||||
@ -174,7 +177,6 @@ large_gam(x)
|
||||
double x;
|
||||
{
|
||||
double z, p;
|
||||
int i;
|
||||
struct Double t, u, v;
|
||||
|
||||
z = one/(x*x);
|
||||
@ -203,7 +205,7 @@ static double
|
||||
small_gam(x)
|
||||
double x;
|
||||
{
|
||||
double y, ym1, t, x1;
|
||||
double y, ym1, t;
|
||||
struct Double yy, r;
|
||||
y = x - one;
|
||||
ym1 = y - one;
|
||||
@ -266,7 +268,6 @@ static struct Double
|
||||
ratfun_gam(z, c)
|
||||
double z, c;
|
||||
{
|
||||
int i;
|
||||
double p, q;
|
||||
struct Double r, t;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_j0.c,v 1.1 1995/10/10 23:36:52 ragge Exp $ */
|
||||
/* $NetBSD: n_j0.c,v 1.2 1997/10/20 14:12:44 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)j0.c 8.2 (Berkeley) 11/30/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -111,7 +113,7 @@ static char sccsid[] = "@(#)j0.c 8.2 (Berkeley) 11/30/93";
|
||||
* 3. Special cases: y0(0)=-inf, y0(x<0)=NaN, y0(inf)=0.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "mathimpl.h"
|
||||
#include <float.h>
|
||||
#include <errno.h>
|
||||
|
||||
@ -342,7 +344,7 @@ static double pzero(x)
|
||||
if (x >= 8.00) {p = pr8; q= ps8;}
|
||||
else if (x >= 4.54545211791992188) {p = pr5; q= ps5;}
|
||||
else if (x >= 2.85714149475097656) {p = pr3; q= ps3;}
|
||||
else if (x >= 2.00) {p = pr2; q= ps2;}
|
||||
else /* if (x >= 2.00) */ {p = pr2; q= ps2;}
|
||||
z = one/(x*x);
|
||||
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
|
||||
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
|
||||
@ -434,7 +436,7 @@ static double qzero(x)
|
||||
if (x >= 8.00) {p = qr8; q= qs8;}
|
||||
else if (x >= 4.54545211791992188) {p = qr5; q= qs5;}
|
||||
else if (x >= 2.85714149475097656) {p = qr3; q= qs3;}
|
||||
else if (x >= 2.00) {p = qr2; q= qs2;}
|
||||
else /* if (x >= 2.00) */ {p = qr2; q= qs2;}
|
||||
z = one/(x*x);
|
||||
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
|
||||
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_j1.c,v 1.1 1995/10/10 23:36:53 ragge Exp $ */
|
||||
/* $NetBSD: n_j1.c,v 1.2 1997/10/20 14:12:50 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -111,7 +113,7 @@ static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93";
|
||||
* by method mentioned above.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "mathimpl.h"
|
||||
#include <float.h>
|
||||
#include <errno.h>
|
||||
|
||||
@ -122,7 +124,7 @@ static char sccsid[] = "@(#)j1.c 8.2 (Berkeley) 11/30/93";
|
||||
#define infnan(x) (0.0)
|
||||
#endif
|
||||
|
||||
static double pone(), qone();
|
||||
static double pone __P((double)), qone __P((double));
|
||||
|
||||
static double
|
||||
huge = 1e300,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_jn.c,v 1.1 1995/10/10 23:36:54 ragge Exp $ */
|
||||
/* $NetBSD: n_jn.c,v 1.2 1997/10/20 14:12:54 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)jn.c 8.2 (Berkeley) 11/30/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -92,7 +94,7 @@ static char sccsid[] = "@(#)jn.c 8.2 (Berkeley) 11/30/93";
|
||||
*
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "mathimpl.h"
|
||||
#include <float.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_lgamma.c,v 1.1 1995/10/10 23:36:56 ragge Exp $ */
|
||||
/* $NetBSD: n_lgamma.c,v 1.2 1997/10/20 14:12:59 ragge Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lgamma.c 8.2 (Berkeley) 11/30/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -84,7 +86,7 @@ static int endian;
|
||||
static double small_lgam(double);
|
||||
static double large_lgam(double);
|
||||
static double neg_lgam(double);
|
||||
static double zero = 0.0, one = 1.0;
|
||||
static double one = 1.0;
|
||||
int signgam;
|
||||
|
||||
#define UNDERFL (1e-1020 * 1e-1020)
|
||||
@ -92,7 +94,7 @@ int signgam;
|
||||
#define LEFT (1.0 - (x0 + .25))
|
||||
#define RIGHT (x0 - .218)
|
||||
/*
|
||||
/* Constants for approximation in [1.244,1.712]
|
||||
* Constants for approximation in [1.244,1.712]
|
||||
*/
|
||||
#define x0 0.461632144968362356785
|
||||
#define x0_lo -.000000000000000015522348162858676890521
|
||||
@ -169,7 +171,6 @@ static double
|
||||
large_lgam(double x)
|
||||
{
|
||||
double z, p, x1;
|
||||
int i;
|
||||
struct Double t, u, v;
|
||||
u = __log__D(x);
|
||||
u.a -= 1.0;
|
||||
@ -271,7 +272,6 @@ neg_lgam(double x)
|
||||
{
|
||||
int xi;
|
||||
double y, z, one = 1.0, zero = 0.0;
|
||||
extern double gamma();
|
||||
|
||||
/* avoid destructive cancellation as much as possible */
|
||||
if (x > -170) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_log.c,v 1.1 1995/10/10 23:36:57 ragge Exp $ */
|
||||
/* $NetBSD: n_log.c,v 1.2 1997/10/20 14:13:05 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)log.c 8.2 (Berkeley) 11/30/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <math.h>
|
||||
@ -449,7 +451,7 @@ __log__D(x) double x;
|
||||
#endif
|
||||
{
|
||||
int m, j;
|
||||
double F, f, g, q, u, v, u2, one = 1.0;
|
||||
double F, f, g, q, u, v, u2;
|
||||
volatile double u1;
|
||||
struct Double r;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_log10.c,v 1.1 1995/10/10 23:36:58 ragge Exp $ */
|
||||
/* $NetBSD: n_log10.c,v 1.2 1997/10/20 14:13:10 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)log10.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* LOG10(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_log1p.c,v 1.1 1995/10/10 23:37:00 ragge Exp $ */
|
||||
/* $NetBSD: n_log1p.c,v 1.2 1997/10/20 14:13:15 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)log1p.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* LOG1P(x)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_log__L.c,v 1.1 1995/10/10 23:37:01 ragge Exp $ */
|
||||
/* $NetBSD: n_log__L.c,v 1.2 1997/10/20 14:13:19 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)log__L.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* log__L(Z)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_pow.c,v 1.1 1995/10/10 23:37:02 ragge Exp $ */
|
||||
/* $NetBSD: n_pow.c,v 1.2 1997/10/20 14:13:23 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pow.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* POW(X,Y)
|
||||
@ -174,8 +176,8 @@ pow_P(double x, double y)
|
||||
pow_P(x, y) double x, y;
|
||||
#endif
|
||||
{
|
||||
struct Double s, t, __log__D();
|
||||
double __exp__D(), huge = 1e300, tiny = 1e-300;
|
||||
struct Double s, t;
|
||||
double huge = 1e300, tiny = 1e-300;
|
||||
|
||||
if (x == zero)
|
||||
if (y > zero)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_sinh.c,v 1.1 1995/10/10 23:37:05 ragge Exp $ */
|
||||
/* $NetBSD: n_sinh.c,v 1.2 1997/10/20 14:13:27 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sinh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* SINH(X)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: n_tanh.c,v 1.1 1995/10/10 23:37:08 ragge Exp $ */
|
||||
/* $NetBSD: n_tanh.c,v 1.2 1997/10/20 14:13:32 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1985, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@ -33,7 +33,9 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tanh.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/* TANH(X)
|
||||
@ -73,12 +75,13 @@ static char sccsid[] = "@(#)tanh.c 8.1 (Berkeley) 6/4/93";
|
||||
* observed error was 2.22 ulps (units in the last place).
|
||||
*/
|
||||
|
||||
#include "mathimpl.h"
|
||||
|
||||
double tanh(x)
|
||||
double x;
|
||||
{
|
||||
static double one=1.0, two=2.0, small = 1.0e-10, big = 1.0e10;
|
||||
double expm1(), t, copysign(), sign;
|
||||
int finite();
|
||||
double t, sign;
|
||||
|
||||
#if !defined(vax)&&!defined(tahoe)
|
||||
if(x!=x) return(x); /* x is NaN */
|
||||
@ -92,7 +95,7 @@ double x;
|
||||
else if ( x > small )
|
||||
{t= -expm1(-(x+x)); return(copysign(t/(two-t),sign));}
|
||||
else /* raise the INEXACT flag for non-zero x */
|
||||
{big+x; return(copysign(x,sign));}
|
||||
{ t = big+x; return(copysign(x,sign));} /* ??? -ragge */
|
||||
else if(finite(x))
|
||||
return (sign+1.0E-37); /* raise the INEXACT flag */
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user