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 Details

    • pow

      public static double pow(double a, int b)
      Computes ab, where the exponent b is an integer. This is more efficient than using Math.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)))