Stat { public static double ix(double x, int a, int b) { double result = 0; for (int j = a; j <= a + b - 1; j++) { double m = Math.exp(logNfactExact(a + b - 1) - logNfactExact(j) - logNfactExact(a + b - 1 - j)); double n = Math.pow(x, j) * Math.pow(1 - x, a + b - 1 - j); result += m * n; } return result; }  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 testIx() { testIxOrBeta_CDF(); }