Computing the incomplete gamma function

The incomplete gamma function has a series expansion. This means that we're going to compute a sequence of values and then do a sum on those values. For more information, visit http://dlmf.nist.gov/8.

This series will have an infinite sequence of terms. Eventually, the values become too small to be relevant. We can establish a small value, ε, and stop the series when the next term is less than this value.

The calculation will yield alternating signs:

The sequence of terms looks like this with s=1 and ...

Get Functional Python Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.