import { default } from "https://deno.land/x/simplestatistics@v7.8.3/src/gamma.js";
Compute the gamma function of a value using Nemes' approximation. The gamma of n is equivalent to (n-1)!, but unlike the factorial function, gamma is defined for all real n except zero and negative integers (where NaN is returned). Note, the gamma function is also well-defined for complex numbers, though this implementation currently does not handle complex numbers as input values. Nemes' approximation is defined here as Theorem 2.2. Negative values use Euler's reflection formula for computation.
Examples
gamma(11.5); // 11899423.084037038
gamma(-11.5); // 2.29575810481609e-8
gamma(5); // 24
gamma(11.5); // 11899423.084037038 gamma(-11.5); // 2.29575810481609e-8 gamma(5); // 24