module MoreMath::Functions

def gamma(x)

Returns the value of the gamma function, extended to a negative domain.
def gamma(x)
  if x < 0.0
    return PI / (sin(PI * x) * exp(log_gamma(1 - x)))
  else
    exp(log_gamma(x))
  end
end