1 /* dlgams.f -- translated by f2c (version 20041007).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11 */
12
13 #define V3P_NETLIB_SRC
14 #include "v3p_netlib.h"
15
16 /* Table of constant values */
17
18 static doublereal c_b2 = 2.;
19
20 /* DECK DLGAMS */
dlgams_(doublereal * x,doublereal * dlgam,doublereal * sgngam)21 /* Subroutine */ int dlgams_(doublereal *x, doublereal *dlgam, doublereal *
22 sgngam)
23 {
24 /* System generated locals */
25 doublereal d__1;
26
27 /* Builtin functions */
28 double d_int(doublereal *), d_mod(doublereal *, doublereal *);
29
30 /* Local variables */
31 integer int__;
32 extern doublereal dlngam_(doublereal *);
33
34 /* ***BEGIN PROLOGUE DLGAMS */
35 /* ***PURPOSE Compute the logarithm of the absolute value of the Gamma */
36 /* function. */
37 /* ***LIBRARY SLATEC (FNLIB) */
38 /* ***CATEGORY C7A */
39 /* ***TYPE DOUBLE PRECISION (ALGAMS-S, DLGAMS-D) */
40 /* ***KEYWORDS ABSOLUTE VALUE OF THE LOGARITHM OF THE GAMMA FUNCTION, */
41 /* FNLIB, SPECIAL FUNCTIONS */
42 /* ***AUTHOR Fullerton, W., (LANL) */
43 /* ***DESCRIPTION */
44
45 /* DLGAMS(X,DLGAM,SGNGAM) calculates the double precision natural */
46 /* logarithm of the absolute value of the Gamma function for */
47 /* double precision argument X and stores the result in double */
48 /* precision argument DLGAM. */
49
50 /* ***REFERENCES (NONE) */
51 /* ***ROUTINES CALLED DLNGAM */
52 /* ***REVISION HISTORY (YYMMDD) */
53 /* 770701 DATE WRITTEN */
54 /* 890531 Changed all specific intrinsics to generic. (WRB) */
55 /* 890531 REVISION DATE from Version 3.2 */
56 /* 891214 Prologue converted to Version 4.0 format. (BAB) */
57 /* ***END PROLOGUE DLGAMS */
58 /* ***FIRST EXECUTABLE STATEMENT DLGAMS */
59 *dlgam = dlngam_(x);
60 *sgngam = 1.;
61 if (*x > 0.) {
62 return 0;
63 }
64
65 d__1 = -d_int(x);
66 int__ = (integer) (d_mod(&d__1, &c_b2) + .1);
67 if (int__ == 0) {
68 *sgngam = -1.;
69 }
70
71 return 0;
72 } /* dlgams_ */
73
74