Gamma function


I've found a C# version of code that appears to be used by e.g. Apple to compute the Gamma function, together with evidence that it's been around the web since the 1980s.  It needed some adaptation as the code appeared to be optimized for a smaller floating-point type than the 64 bits one typically sees today.  My adapted version produces exact answers at integers, which was a motivation for the change, and is within a factor of 10^-12 of the existing implementation elsewhere.

See the discussion here for background:

https://github.com/mathnet/mathnet-numerics/issues/196