@Test public void testIncompleteGamma() { System.out.println("incompleteGamma"); assertEquals(0.7807, Gamma.regularizedIncompleteGamma(2.1, 3), 1E-4); assertEquals(0.3504, Gamma.regularizedIncompleteGamma(3, 2.1), 1E-4); }
public static double regularizedIncompleteGamma(double s, double x) { if (s < 0.0) { throw new IllegalArgumentException("Invalid s: " + s); } if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } double igf = 0.0; if (x < s + 1.0) { igf = regularizedIncompleteGammaSeries(s, x); } else { igf = regularizedIncompleteGammaFraction(s, x); } return igf; }
Gamma { public static double regularizedIncompleteGamma(double s, double x) { if (s < 0.0) { throw new IllegalArgumentException("Invalid s: " + s); } if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } double igf = 0.0; if (x < s + 1.0) { igf = regularizedIncompleteGammaSeries(s, x); } else { igf = regularizedIncompleteGammaFraction(s, x); } return igf; } }
Gamma { public static double regularizedIncompleteGamma(double s, double x) { if (s < 0.0) { throw new IllegalArgumentException("Invalid s: " + s); } if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } double igf = 0.0; if (x < s + 1.0) { igf = regularizedIncompleteGammaSeries(s, x); } else { igf = regularizedIncompleteGammaFraction(s, x); } return igf; } private  Gamma(); }
Gamma { public static double regularizedIncompleteGamma(double s, double x) { if (s < 0.0) { throw new IllegalArgumentException("Invalid s: " + s); } if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } double igf = 0.0; if (x < s + 1.0) { igf = regularizedIncompleteGammaSeries(s, x); } else { igf = regularizedIncompleteGammaFraction(s, x); } return igf; } private  Gamma(); static double gamma(double x); static double lgamma(double x); static double regularizedIncompleteGamma(double s, double x); static double regularizedUpperIncompleteGamma(double s, double x); static double digamma(double x); static double inverseRegularizedIncompleteGamma(double a, double p); }
Gamma { public static double regularizedIncompleteGamma(double s, double x) { if (s < 0.0) { throw new IllegalArgumentException("Invalid s: " + s); } if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } double igf = 0.0; if (x < s + 1.0) { igf = regularizedIncompleteGammaSeries(s, x); } else { igf = regularizedIncompleteGammaFraction(s, x); } return igf; } private  Gamma(); static double gamma(double x); static double lgamma(double x); static double regularizedIncompleteGamma(double s, double x); static double regularizedUpperIncompleteGamma(double s, double x); static double digamma(double x); static double inverseRegularizedIncompleteGamma(double a, double p);  }