MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / gammaIncLow

Method gammaIncLow

JSAT/src/jsat/math/SpecialMath.java:793–806  ·  view source on GitHub ↗

Computes the lower incomplete gamma function, γ(a,z). Returns Double#NaN for z ≤ 0 @param a any value (-∞, ∞) @param z any value > 0 @return γ(a,z)

(double a, double z)

Source from the content-addressed store, hash-verified

791 * @return γ(a,z)
792 */
793 public static double gammaIncLow(double a, double z)
794 {
795 if(z <= 0)
796 return Double.NaN;
797 /**
798 * On the range of x from 0.5 to 50
799 * a=0.15, see a=1
800 * a=0.5, see a=1
801 * a=1, max |rel error| is ~1.7e-13, rel error starts at 1e-15 and grows to the max as z increases
802 * a=5, max |rel error| is 3e-13, but only near x ~= 0. for x > epsilon error starts at 5e-15 and grows with z up to 1e-13
803 * a=10, max |rel error| is 2e-7, but only near x ~= 0, most is in the range 5e-15, grows to 5e-14 as z-> infinity
804 */
805 return exp(lnLowIncGamma(a, z));
806 }
807
808 private static double lnLowIncGamma(double a, double x)
809 {

Callers

nothing calls this directly

Calls 2

lnLowIncGammaMethod · 0.95
expMethod · 0.80

Tested by

no test coverage detected