[comp.theory] Wanted: Good alg for log...

JXS118@psuvm.psu.edu (Jeff Siegel) (12/06/90)

Most e-mail replies I received about my question on algorithm sources
suggested a book by Cody & Waite. Naturally, since this is the book
I need, Penn State doesn't have it. I did find a good algorithm to
compute the natural log however. It goes like this:

Write x as:   (2 raised to the k) times q

              where k is rigged to make q fall between 1 and 2

Uses the taylor series expansion about 1.5 to compute the ln(q)
Converges very quicky.

Store the log of 2 as a constant, the ln(2 raised to k) = k * ln(2)

The answer is then k*ln(2) + ln(q)   for the ln(x)

***************** Next question: *********************************

Can anyone give me a good algorithm to generate pi?
If possible, I would like one that generates a digit at a time.

Jeff