Class LogGamma

java.lang.Object
org.apache.commons.numbers.gamma.LogGamma

public final class LogGamma extends Object
Natural logarithm of the absolute value of \( \Gamma(x) \).

\[ \operatorname{lgamma}(z) = \ln \lvert \Gamma(x) \rvert \]

This code has been adapted from the Boost c++ implementation <boost/math/special_functions/gamma.hpp>.

See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    value(double x)
    Computes the function \( \ln \lvert \Gamma(x) \rvert \), the natural logarithm of the absolute value of \( \Gamma(x) \).
    static double
    value(double x, int[] sign)
    Computes the function \( \ln \lvert \Gamma(x) \rvert \), the natural logarithm of the absolute value of \( \Gamma(x) \).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogGamma

      private LogGamma()
      Private constructor.
  • Method Details

    • value

      public static double value(double x)
      Computes the function \( \ln \lvert \Gamma(x) \rvert \), the natural logarithm of the absolute value of \( \Gamma(x) \).
      Parameters:
      x - Argument.
      Returns:
      \( \ln \lvert \Gamma(x) \rvert \), or NaN if x <= 0 and is an integer.
    • value

      public static double value(double x, int[] sign)
      Computes the function \( \ln \lvert \Gamma(x) \rvert \), the natural logarithm of the absolute value of \( \Gamma(x) \).

      The sign output is set to 1 if the sign of gamma(x) is positive or zero; otherwise it is set to -1.

      Parameters:
      x - Argument.
      sign - Sign output. If a non-zero length the first index sign[0] is set on output to the sign of gamma(z).
      Returns:
      \( \ln \lvert \Gamma(x) \rvert \), or NaN if x <= 0 and is an integer.
      Since:
      1.1