xn = n + 1; xk = k + 1; xnk = n - k + 1;
xn = (double) n + 1; xk = (double) k + 1; xnk = (double) n - (double) k + 1;
slatec_dbinom(unsigned n, unsigned m){  unsigned i, k;  double result, xn, xk, xnk, corr;  static const double sq2pil = 0.91893853320467274178032973640562;  static int first  = 1;  static double bilnmx;  static double fintmx;  if (first) {    first = 0;    bilnmx = log(d1mach(2)) - 0.0001;    fintmx = 0.9/d1mach(3);  }  if (n < m) {    xermsg("slatec", "dbinom",      "n lt m", 2, 2);    return 1.0;  }  k = n-m;  if (k > m) k = m;  if (k <= 20) {    if (k*log((double)(n > 1 ? n : 1)) <= bilnmx) {      result = 1;      if (k == 0) return result;      for(i=1;i<=k;i++) {        xn = n - i + 1;        xk = i;        result = result * (xn/xk);      }      if (result < fintmx) result = floor(result+0.5);      return result;    }  }  if (k < 9){ /* approx is not valid and answer is close to the overflow lim */    xermsg("slatec", "dbinom",      "result overflows because n and/or m too big", 3, 2);    return 1.0;  }  xn = n + 1;  xk = k + 1;  xnk = n - k + 1;  corr = d9lgmc(xn) - d9lgmc(xk) - d9lgmc(xnk);  result = xk*log(xnk/xk) - xn*slatec_dlnrel(-(xk-1)/xn)    -0.5*log(xn*xnk/xk) + 1 - sq2pil + corr;  if (result > bilnmx) {    xermsg("slatec", "dbinom",      "result overflows because n and/or m too big", 3, 2);    return 1.0;  }  result = exp(result);  if (result < fintmx) result = floor(result+0.5);  return result;}