Gamma Function (Not in Base Package)

Evaluates the gamma function for any real number x. Details

x is any real number.
gamma(x) has singularities for all nonpositive integers x.

Gamma Function Details

The gamma function of x is the generalization of the common factorial function n!. The relation between these two functions is

for all natural numbers n. The gamma function is defined by

for real and complex x, and has the property

The calculation of

is based on the Lanszos formula

with fixed and well calculated

The following diagram shows the graph of the gamma function in the interval (–4, 4).