Article 6NRVE Computing Γ(z) for complex z with tables

Computing Γ(z) for complex z with tables

by
John
from John D. Cook on (#6NRVE)

In the previous post I mentioned that the general strategy for computing a mathematical function using tables is to first reduce the function argument to be within the range of the tabulated values, and then to use interpolation to compute the function at values that are not directly tabulated.

The second step is always the same, applying Lagrange interpolation with enough points to get the accuracy you need. But the first step, range reduction, depends on the function being evaluated. And as the previous post concluded, evaluating more advanced functions generally requires more advanced range reduction.

Real argument

For the gamma function, the identity

gamma_addition_simple.svg

can be used to reduce the problem of computing (x) for any real x to the problem of computing (x) for x in the interval [1, 2]. If x is large, the identity will have to be applied many times and so this would be a lot of work. However, the larger x is, the more accurate Stirling's approximation becomes.

Complex argument

Computing (x + iy) is more complex, pardon the pun. We can still use the identity above to reduce the real part x of the argument to lie in the interval [1, 2], but what about the complex part y?

Abramowitz and Stegun, Table 6.7, tabulates the principal branch of log (x + iy) forx from 1 to 2 and for y from 0 to 10, both in increments of 0.1. Generally the logarithm of the gamma function is more useful in computation than the gamma function itself. It is also easier to interpolate, which I imagine is the main reason A&S tabulate it rather than the gamma function per se. A note below Table 6.7 says that linear interpolation gives about 3 significant figures, and eight-point interpolation gives about 8 figures.

By the Schwarz reflection principle,

gamma_conjugate.svg

and with this we can extend our range on y to [-10, 10].

Large imaginary part

What about larger y? We have two options: the duplication formula and Stirling's approximation.

The duplication formula

gamma_multiplication_simple.svg

lets us compute (2z) if we can compute (z) and (z + ).

Stirling's approximation for (z) is accurate when |z| is large, and |x + iy| is large when |y| is large.

More posts on using tablesThe post Computing (z) for complex z with tables first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments