OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
gammln.c
Go to the documentation of this file.
1 #include <math.h>
2 
3 float gammln(float xx) {
4  double x, y, tmp, ser;
5  static double cof[6] = {76.18009172947146, -86.50532032941677,
6  24.01409824083091, -1.231739572450155,
7  0.1208650973866179e-2, -0.5395239384953e-5};
8  int j;
9 
10  y = x = xx;
11  tmp = x + 5.5;
12  tmp -= (x + 0.5) * log(tmp);
13  ser = 1.000000000190015;
14  for (j = 0; j <= 5; j++) ser += cof[j] / ++y;
15  return -tmp + log(2.5066282746310005 * ser / x);
16 }
int j
Definition: decode_rs.h:73
data_t tmp
Definition: decode_rs.h:74
float gammln(float xx)
Definition: gammln.c:3