Package org.apache.commons.numbers.gamma
Class GammaRatio
java.lang.Object
org.apache.commons.numbers.gamma.GammaRatio
Ratio of Gamma
functions.
\[ \frac{\Gamma(a)}{\Gamma(b)} \]
This code has been adapted from:
- The Boost
c++
implementation<boost/math/special_functions/gamma.hpp>
.
- Since:
- 1.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GammaRatio
private GammaRatio()Private constructor.
-
-
Method Details
-
value
public static double value(double a, double b) Computes the ratio of gamma functions of two values.\[ \frac{\Gamma(a)}{\Gamma(b)} \]
If either argument is
<= 0
or infinite then the result is NaN.- Parameters:
a
- Argument a (must be positive finite).b
- Argument b (must be positive finite).- Returns:
- \( \Gamma(a) / \Gamma(b) \)
-
delta
public static double delta(double a, double delta) Computes the ratio of gamma functions of a value and an offset value.\[ \frac{\Gamma(a)}{\Gamma(a + delta)} \]
Note that the result is calculated accurately even when
delta
is small compared toa
: indeed even ifa+delta ~ a
. The function is typically used whena
is large anddelta
is very small.- Parameters:
a
- Argument.delta
- Argument.- Returns:
- \( \Gamma(a) / \Gamma(a + delta) \)
-