11 Float attribute_hidden Rf_gamma_cody(Float x)
57 const static double sqrtpi = .9189385332046727417803297;
110 const static double xbig = 171.624;
119 const static double p[8] = {
120 -1.71618513886549492533811,
121 24.7656508055759199108314,-379.804256470945635097577,
122 629.331155312818442661052,866.966202790413211295064,
123 -31451.2729688483675254357,-36144.4134186911729807069,
124 66456.1438202405440627855 };
125 const static double q[8] = {
126 -30.8402300119738975254353,
127 315.350626979604161529144,-1015.15636749021914166146,
128 -3107.77167157231109440444,22538.1184209801510330112,
129 4755.84627752788110767815,-134659.959864969306392456,
130 -115132.259675553483497211 };
134 const static double c[7] = {
135 -.001910444077728,8.4171387781295e-4,
136 -5.952379913043012e-4,7.93650793500350248e-4,
137 -.002777777777777681622553,.08333333333333333331554247,
143 Float fact, xden, xnum, y, z, yi, res,
sum, ysq;
157 if (yi != trunc(yi * .5) * 2.)
159 fact = -M_PI / sinpi(res);
168 if (y < DBL_EPSILON) {
177 }
else if (y < 12.) {
189 n = (int) trunc(y) - 1;
198 for (i = 0; i < 8; ++i) {
199 xnum = (xnum + p[i]) * z;
200 xden = xden * z + q[i];
202 res = xnum / xden + 1.;
212 for (i = 0; i < n; ++i) {
224 for (i = 0; i < 6; ++i) {
225 sum = sum / ysq + c[i];
227 sum = sum / y - y + sqrtpi;
228 sum += (y - .5) * log(y);
Type sum(Vector< Type > x)