# HP Forums

Full Version: HP15c continued fraction for Ln(Gamma)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi all,

In the "Advanced functions handbook" for the HP-15C, pages 65ff, there is a continued-fraction approximation for the function Ln(Gamma(x)). The first five terms of the expansion are given as fractions, the last two as decimal fractions.

I've managed to track down the fractions that these decimals represent:

a5 = 22,999/22,737 ~= 1.011523068126842

a6 = 29,944,523/19,733,142 ~= 1.517473649153287

I'm also struck by an oddity in the program. 6 is stored in the indirect register, and before the loop, a6 is recalled. As a result, the innermost fraction is a6/(x+a6). I'm not terribly familiar with continued fractions, but it looks suspicious to me. However, changing the initial value of the indirect register to 5 (meaning that the innermost fraction becomes a5/(x+a6) and the continued fraction one level smaller) changes the last digit in the real example -- Ln(Gamma(4.2)) -- and the value produced by the version in the book is correctly rounded in the last digit, when letting the WP-34S serve as reference.

So, my question is: Is the example correct, and if so: why? A shout of "RTFM" is acceptable, if it is accompanied with a suggestion of how to find a version of the FM that explains how the CF can be evaluated, i.e. how one should begin.

Thanks,

--T