Skip to content

Commit

Permalink
Rename in fdlibm: "gamma" => "tgamma".
Browse files Browse the repository at this point in the history
Since the libm function "gamma" has been deprecated
in favor of "tgamma" which unambiguously computes the
non-log gamma function.
  • Loading branch information
StefanKarpinski committed Jun 11, 2011
1 parent f2b3e45 commit 9d1009f
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 164 deletions.
8 changes: 4 additions & 4 deletions external/fdlibm/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ R fdlibm.h
F e_fmod.c
R fdlibm.h

F e_gamma.c
F e_tgamma.c
R fdlibm.h

F e_gamma_r.c
F e_tgamma_r.c
R fdlibm.h

F e_hypot.c
Expand Down Expand Up @@ -193,10 +193,10 @@ R fdlibm.h
F w_fmod.c
R fdlibm.h

F w_gamma.c
F w_tgamma.c
R fdlibm.h

F w_gamma_r.c
F w_tgamma_r.c
R fdlibm.h

F w_hypot.c
Expand Down
102 changes: 0 additions & 102 deletions external/fdlibm/MD5

This file was deleted.

4 changes: 2 additions & 2 deletions external/fdlibm/e_lgamma_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* Method:
* 1. Argument Reduction for 0 < x <= 8
* Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
* Since tgamma(1+s)=s*tgamma(s), for x in [0,8], we may
* reduce x to a number in [1.5,2.5] by
* lgamma(1+s) = log(s) + lgamma(s)
* for example,
Expand Down Expand Up @@ -59,7 +59,7 @@
* where
* |w - f(z)| < 2**-58.74
*
* 4. For negative x, since (G is gamma function)
* 4. For negative x, since (G is tgamma function)
* -x*G(-x)*G(x) = pi/sin(pi*x),
* we have
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
Expand Down
12 changes: 6 additions & 6 deletions external/fdlibm/e_gamma.c → external/fdlibm/e_tgamma.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* @(#)e_gamma.c 1.3 95/01/18 */
/* @(#)e_tgamma.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Expand All @@ -12,22 +12,22 @@
*
*/

/* __ieee754_gamma(x)
/* __ieee754_tgamma(x)
* Return the logarithm of the Gamma function of x.
*
* Method: call __ieee754_gamma_r
* Method: call __ieee754_tgamma_r
*/

#include "fdlibm.h"

extern int signgam;

#ifdef __STDC__
double __ieee754_gamma(double x)
double __ieee754_tgamma(double x)
#else
double __ieee754_gamma(x)
double __ieee754_tgamma(x)
double x;
#endif
{
return __ieee754_gamma_r(x,&signgam);
return __ieee754_tgamma_r(x,&signgam);
}
8 changes: 4 additions & 4 deletions external/fdlibm/e_gamma_r.c → external/fdlibm/e_tgamma_r.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* @(#)e_gamma_r.c 1.3 95/01/18 */
/* @(#)e_tgamma_r.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Expand All @@ -12,7 +12,7 @@
*
*/

/* __ieee754_gamma_r(x, signgamp)
/* __ieee754_tgamma_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
Expand All @@ -22,9 +22,9 @@
#include "fdlibm.h"

#ifdef __STDC__
double __ieee754_gamma_r(double x, int *signgamp)
double __ieee754_tgamma_r(double x, int *signgamp)
#else
double __ieee754_gamma_r(x,signgamp)
double __ieee754_tgamma_r(x,signgamp)
double x; int *signgamp;
#endif
{
Expand Down
10 changes: 5 additions & 5 deletions external/fdlibm/fdlibm.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extern double fmod __P((double, double));

extern double erf __P((double));
extern double erfc __P((double));
extern double gamma __P((double));
extern double tgamma __P((double));
extern double hypot __P((double, double));
extern int isnan __P((double));
extern int finite __P((double));
Expand Down Expand Up @@ -204,11 +204,11 @@ extern double expm1 __P((double));
extern double log1p __P((double));

/*
* Reentrant version of gamma & lgamma; passes signgam back by reference
* Reentrant version of tgamma & lgamma; passes signgam back by reference
* as the second argument; user must allocate space for signgam.
*/
#ifdef _REENTRANT
extern double gamma_r __P((double, int *));
extern double tgamma_r __P((double, int *));
extern double lgamma_r __P((double, int *));
#endif /* _REENTRANT */

Expand All @@ -225,9 +225,9 @@ extern double __ieee754_cosh __P((double));
extern double __ieee754_fmod __P((double,double));
extern double __ieee754_pow __P((double,double));
extern double __ieee754_lgamma_r __P((double,int *));
extern double __ieee754_gamma_r __P((double,int *));
extern double __ieee754_tgamma_r __P((double,int *));
extern double __ieee754_lgamma __P((double));
extern double __ieee754_gamma __P((double));
extern double __ieee754_tgamma __P((double));
extern double __ieee754_log10 __P((double));
extern double __ieee754_sinh __P((double));
extern double __ieee754_hypot __P((double,double));
Expand Down
8 changes: 4 additions & 4 deletions external/fdlibm/index
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ file fdlibm/e_exp.c

file fdlibm/e_fmod.c

file fdlibm/e_gamma.c
file fdlibm/e_tgamma.c

file fdlibm/e_gamma_r.c
file fdlibm/e_tgamma_r.c

file fdlibm/e_hypot.c

Expand Down Expand Up @@ -134,9 +134,9 @@ file fdlibm/w_exp.c

file fdlibm/w_fmod.c

file fdlibm/w_gamma.c
file fdlibm/w_tgamma.c

file fdlibm/w_gamma_r.c
file fdlibm/w_tgamma_r.c

file fdlibm/w_hypot.c

Expand Down
8 changes: 4 additions & 4 deletions external/fdlibm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ <h1>fdlibm</h1>

file <a href="e_fmod.c">e_fmod.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_fmod.c">e_fmod.c plus dependencies</a>

file <a href="e_gamma.c">e_gamma.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_gamma.c">e_gamma.c plus dependencies</a>
file <a href="e_tgamma.c">e_tgamma.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_tgamma.c">e_tgamma.c plus dependencies</a>

file <a href="e_gamma_r.c">e_gamma_r.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_gamma_r.c">e_gamma_r.c plus dependencies</a>
file <a href="e_tgamma_r.c">e_tgamma_r.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_tgamma_r.c">e_tgamma_r.c plus dependencies</a>

file <a href="e_hypot.c">e_hypot.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/e_hypot.c">e_hypot.c plus dependencies</a>

Expand Down Expand Up @@ -143,9 +143,9 @@ <h1>fdlibm</h1>

file <a href="w_fmod.c">w_fmod.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_fmod.c">w_fmod.c plus dependencies</a>

file <a href="w_gamma.c">w_gamma.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_gamma.c">w_gamma.c plus dependencies</a>
file <a href="w_tgamma.c">w_tgamma.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_tgamma.c">w_tgamma.c plus dependencies</a>

file <a href="w_gamma_r.c">w_gamma_r.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_gamma_r.c">w_gamma_r.c plus dependencies</a>
file <a href="w_tgamma_r.c">w_tgamma_r.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_tgamma_r.c">w_tgamma_r.c plus dependencies</a>

file <a href="w_hypot.c">w_hypot.c</a> <a href="/cgi-bin/netlibfiles.pl?filename=/fdlibm/w_hypot.c">w_hypot.c plus dependencies</a>

Expand Down
14 changes: 7 additions & 7 deletions external/fdlibm/k_standard.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ static double zero = 0.0; /* used as const */
* 37-- y1(x>X_TLOSS)
* 38-- jn(|x|>X_TLOSS, n)
* 39-- yn(x>X_TLOSS, n)
* 40-- gamma(finite) overflow
* 41-- gamma(-integer)
* 40-- tgamma(finite) overflow
* 41-- tgamma(-integer)
* 42-- pow(NaN,0.0)
*/

Expand Down Expand Up @@ -686,9 +686,9 @@ static double zero = 0.0; /* used as const */
}
break;
case 40:
/* gamma(finite) overflow */
/* tgamma(finite) overflow */
exc.type = OVERFLOW;
exc.name = "gamma";
exc.name = "tgamma";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
Expand All @@ -700,9 +700,9 @@ static double zero = 0.0; /* used as const */
}
break;
case 41:
/* gamma(-integer) or gamma(0) */
/* tgamma(-integer) or tgamma(0) */
exc.type = SING;
exc.name = "gamma";
exc.name = "tgamma";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
Expand All @@ -711,7 +711,7 @@ static double zero = 0.0; /* used as const */
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("gamma: SING error\n", 18);
(void) WRITE2("tgamma: SING error\n", 18);
}
errno = EDOM;
}
Expand Down
Binary file added external/fdlibm/libfdm.a
Binary file not shown.
6 changes: 3 additions & 3 deletions external/fdlibm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ src = k_standard.c k_rem_pio2.c \
k_cos.c k_sin.c k_tan.c \
e_acos.c e_acosh.c e_asin.c e_atan2.c \
e_atanh.c e_cosh.c e_exp.c e_fmod.c \
e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \
e_tgamma.c e_tgamma_r.c e_hypot.c e_j0.c \
e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \
e_log.c e_log10.c e_log2.c e_pow.c e_rem_pio2.c e_remainder.c \
e_scalb.c e_sinh.c e_sqrt.c \
w_acos.c w_acosh.c w_asin.c w_atan2.c \
w_atanh.c w_cosh.c w_exp.c w_fmod.c \
w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \
w_tgamma.c w_tgamma_r.c w_hypot.c w_j0.c \
w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
w_log.c w_log10.c w_pow.c w_remainder.c \
w_scalb.c w_sinh.c w_sqrt.c \
Expand All @@ -89,7 +89,7 @@ src = k_standard.c k_rem_pio2.c \
e_j1f.c s_asinhf.c s_tanhf.c \
e_jnf.c s_atanf.c s_truncf.c \
e_log10f.c s_cbrtf.c s_log1pf.c w_dremf.c \
e_log2f.c s_ceilf.c s_logbf.c w_gammaf.c \
e_log2f.c s_ceilf.c s_logbf.c w_tgammaf.c \
e_logf.c s_copysignf.c w_lgammaf.c s_finitef.c \
e_lgammaf_r.c

Expand Down
8 changes: 4 additions & 4 deletions external/fdlibm/makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ src = k_standard.c k_rem_pio2.c \
k_cos.c k_sin.c k_tan.c \
e_acos.c e_acosh.c e_asin.c e_atan2.c \
e_atanh.c e_cosh.c e_exp.c e_fmod.c \
e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \
e_tgamma.c e_tgamma_r.c e_hypot.c e_j0.c \
e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \
e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c \
e_scalb.c e_sinh.c e_sqrt.c \
w_acos.c w_acosh.c w_asin.c w_atan2.c \
w_atanh.c w_cosh.c w_exp.c w_fmod.c \
w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \
w_tgamma.c w_tgamma_r.c w_hypot.c w_j0.c \
w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
w_log.c w_log10.c w_pow.c w_remainder.c \
w_scalb.c w_sinh.c w_sqrt.c \
Expand All @@ -101,13 +101,13 @@ obj = k_standard.o k_rem_pio2.o \
k_cos.o k_sin.o k_tan.o \
e_acos.o e_acosh.o e_asin.o e_atan2.o \
e_atanh.o e_cosh.o e_exp.o e_fmod.o \
e_gamma.o e_gamma_r.o e_hypot.o e_j0.o \
e_tgamma.o e_tgamma_r.o e_hypot.o e_j0.o \
e_j1.o e_jn.o e_lgamma.o e_lgamma_r.o \
e_log.o e_log10.o e_pow.o e_rem_pio2.o e_remainder.o \
e_scalb.o e_sinh.o e_sqrt.o \
w_acos.o w_acosh.o w_asin.o w_atan2.o \
w_atanh.o w_cosh.o w_exp.o w_fmod.o \
w_gamma.o w_gamma_r.o w_hypot.o w_j0.o \
w_tgamma.o w_tgamma_r.o w_hypot.o w_j0.o \
w_j1.o w_jn.o w_lgamma.o w_lgamma_r.o \
w_log.o w_log10.o w_pow.o w_remainder.o \
w_scalb.o w_sinh.o w_sqrt.o \
Expand Down
Loading

0 comments on commit 9d1009f

Please sign in to comment.