Stat { public static double hgapprox(long D, long gt, int S) { double dgt = logNfact(D - gt); double ds = logNfact(D - S); double dgts = logNfact(D - gt - S); double d = logNfact(D); double P = Math.exp(dgt + ds - dgts - d); return P; }  static double hg(long D, long gt, long S); static double hgapprox(long D, long gt, int S); static double beta_CDF(double x, int a, int b); static double incompleteBeta(double x, int a, int b); static double beta(int a, int b); static double ix(double x, int a, int b); static double logNfact(long n); static long nFactExact(long n); static double binom(int n, int i); static double logBinom(int n, int i); static double logoggs(double p); static double logit(double logodds); static void main(String[] args);  }
@Test public final void testHgapprox() { System.out.println(Stat.hgapprox(10, 10, 10)); }