LogGammaD function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Math

Package: Microsoft.Quantum.Standard

Returns the natural logarithm of the gamma function (aka the log-gamma function).

function LogGammaD (x : Double) : Double

Description

The gamma function $\Gamma(x)$ generalizes the factorial function to the positive real numbers and is defined as $$ \begin{align} \Gamma(x) \mathrel{:=} \int_0^{\infty} t^{x - 1} e^{-t} dt. \end{align} $$

The gamma function has the property that for all positive real numbers $x$, $\Gamma(x + 1) = x \Gamma(x)$, such that the factorial function is a special case of $\Gamma$, $n! = \Gamma(n + 1)$ for all natural numbers $n$.

Input

x : Double

The point $x$ at which the log-gamma function is to be evaluated.

Output : Double

The value $\ln \Gamma(x)$.