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

Method gammaPSeries

JSAT/src/jsat/math/SpecialMath.java:657–673  ·  view source on GitHub ↗
(double a, double z)

Source from the content-addressed store, hash-verified

655 }
656
657 public static double gammaPSeries(double a, double z)
658 {
659 double ap = a;
660 double sum;
661 double del = sum = 1.0/a;
662
663 do
664 {
665 ap += 1.0;
666 del *= z/ap;
667 sum += del;
668 if(abs(del) < abs(sum)*1e-15)
669 return sum*exp(-z+a*log(z)-lnGamma(a));
670 }
671 while(true);
672
673 }
674
675 /**
676 * Returns the regularized gamma function P(a,z) = γ(a,z)/Γ(a). <br>

Callers 2

gammaQMethod · 0.95
gammaPMethod · 0.95

Calls 3

lnGammaMethod · 0.95
expMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected