The NCBI required a fast way of calculating the gamma function that could be used in public domain software. The precision approximation developed corrects Stirling's approximation with contributions from the first few poles of the gamma function in the left complex plane. Sequence analysis naturally gives rise to combinatorial problems. The gamma (or factorial) function is heavily used to compute answers to these problems. Since the factorial function, n!, equals 1x2x...xn, straightforward calculation of n! for large n can be quite slow. The precision approximation reduces the calculation to 2 exponentiations and about 30 additions, multiplications, or divisions, regardless of the size of n. The approximation can also calculate n! for fractional n, which is necessary in other applied mathematical applications. The digamma and trigamma functions are the logarithmic derivatives of the gamma function, and arise in Bayesian estimates of the information in an alignment of protein or DNA sequences. The precision approximation for the gamma can be manipulated to provide approximations for the digamma and trigamma functions.

Agency
National Institute of Health (NIH)
Institute
National Library of Medicine (NLM)
Type
Intramural Research (Z01)
Project #
1Z01LM000002-01
Application #
3845093
Study Section
Project Start
Project End
Budget Start
Budget End
Support Year
1
Fiscal Year
1992
Total Cost
Indirect Cost
Name
National Library of Medicine
Department
Type
DUNS #
City
State
Country
United States
Zip Code