No BSD License
Paul Godfrey (view profile)
06 Jun 2003
12 Jun 2003)
Compute a very accurate Gamma function over the entire complex plane.
Watch this File
A very accurate complex Gamma function valid over the entire complex plane. This function is more accurate than MATLAB's own real only Gamma function.
This file inspired Variable Order Derivatives.
Loss of accuracy in complex plane:
Using this routine:
gamma(-2-2e-7 i)=0.462366678321968 + 2499999.99999981i
Using backwards recursion:
gamma(0-2e-7 i)=-0.577215664901504 + 4999999.99999981i
gamma(-1-2e-7i)=gamma(-2e-7i)/(-1-2e-7i) =-0.577215664901504 + 4999999.99999981i
gamma(-2-2e-7i)=gamma(-1-2e-7i)/(-2-2e-7i)=0.461392167549202 + 2499999.99999982i
Note that the real part agree for only 2 digits. The second calculation based on backwards recursion agrees Mathematica and Fortran. Look for discussion on Google Groups by Krishna Myneni.
Is it possible to fix this issue?
Thanks. Very useful!
Its so lovely to see this function on the first search.
Please post some references as well for the theory.
Thank you. Excellent. It is a handy function to have around.