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)
| 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 | { |
nothing calls this directly
no test coverage detected