75 static double neg_gam(
double);
76 static double small_gam(
double);
77 static double smaller_gam(
double);
78 static struct Double large_gam(double);
79 static struct Double ratfun_gam(double, double);
85 #define LEFT -.3955078125 86 #define x0 .461632144968362356785 88 #define a0_hi 0.88560319441088874992 89 #define a0_lo -.00000000000000004996427036469019695 90 #define P0 6.21389571821820863029017800727e-01 91 #define P1 2.65757198651533466104979197553e-01 92 #define P2 5.53859446429917461063308081748e-03 93 #define P3 1.38456698304096573887145282811e-03 94 #define P4 2.40659950032711365819348969808e-03 95 #define Q0 1.45019531250000000000000000000e+00 96 #define Q1 1.06258521948016171343454061571e+00 97 #define Q2 -2.07474561943859936441469926649e-01 98 #define Q3 -1.46734131782005422506287573015e-01 99 #define Q4 3.07878176156175520361557573779e-02 100 #define Q5 5.12449347980666221336054633184e-03 101 #define Q6 -1.76012741431666995019222898833e-03 102 #define Q7 9.35021023573788935372153030556e-05 103 #define Q8 6.13275507472443958924745652239e-06 108 #define lns2pi_hi 0.418945312500000 109 #define lns2pi_lo -.000006779295327258219670263595 110 #define Pa0 8.33333333333333148296162562474e-02 111 #define Pa1 -2.77777777774548123579378966497e-03 112 #define Pa2 7.93650778754435631476282786423e-04 113 #define Pa3 -5.95235082566672847950717262222e-04 114 #define Pa4 8.41428560346653702135821806252e-04 115 #define Pa5 -1.89773526463879200348872089421e-03 116 #define Pa6 5.69394463439411649408050664078e-03 117 #define Pa7 -1.44705562421428915453880392761e-02 119 static const double zero = 0.,
one = 1.0, tiny = 1e-300;
131 }
else if (x >= 1.0 +
LEFT +
x0)
132 return (small_gam(x));
134 return (smaller_gam(x));
135 else if (x > -1.e-17) {
178 t.b = v.b*u.a + x*u.b;
199 if (y <= 1.0 + (
LEFT +
x0)) {
200 yy = ratfun_gam(y -
x0, 0);
201 return (yy.a + yy.b);
207 yy.b = r.b = y - yy.a;
209 for (ym1 = y-
one; ym1 >
LEFT +
x0; y = ym1--, yy.a--) {
211 r.b = r.a*yy.b + y*r.b;
217 yy = ratfun_gam(y -
x0, 0);
218 y = r.b*(yy.a + yy.b) + r.a*yy.b;
228 smaller_gam(
double x)
239 xx.b = x - xx.a; xx.b += t; xx.b += d;
240 t = (
one-
x0); t += x;
241 d = (
one-
x0); d -= t; d += x;
248 d = (-
x0 -t); d += x;
250 r = ratfun_gam(t, d);
253 r.a -= d*xx.a; r.a -= d*xx.b; r.a += r.b;
262 ratfun_gam(double z, double
c)
282 t.b = t.b*p + t.a*r.b +
a0_lo;
286 r.b = ((
a0_hi-r.a) + t.a) + t.b;
299 return ((x - x) / zero);
313 return ((
double)sgn*tiny*tiny);
320 z = (y + lg.a) + lg.b;
331 return (
M_PI / (y*z));
struct Double __log__D(double x)
double __exp__D(double x, double c)