Package org.cicirello.math
Class MathFunctions
- java.lang.Object
-
- org.cicirello.math.MathFunctions
-
public final class MathFunctions extends Object
MathFunctions is a class of utility methods that implement various mathematical functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublelogGamma(double n)Implementation of the natural log of the absolute value of the gamma function.static doublepow(double a, int b)Computes ab, where the exponent b is an integer.
-
-
-
Method Detail
-
pow
public static double pow(double a, int b)Computes ab, where the exponent b is an integer. This is more efficient than usingMath.pow(double, double)since it exploits the integer type of the exponent.- Parameters:
a- The base.b- The exponent.- Returns:
- ab
-
logGamma
public static double logGamma(double n)
Implementation of the natural log of the absolute value of the gamma function.- Parameters:
n- input parameter to the function- Returns:
- ln(abs(gamma(n)))
-
-