Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-12-19 06:13:31


> What's this algorithm? Is it related to the Lenz's Law for
> electromagnetic physics? (That all I found on Google.)

No, the simplest explanation is that its a way of converting a continuous
fraction to a real number while avoiding overflow/underflow/devide by zero.

For instance given a function F(x,y,z), there is often a continued fraction
that expresses the result of the function exactly: we can calculate the
constants in the fraction [a1,b1 ... aN,bN] using some well known numerical
formula, but then we need to figure out how to convert these into a
real-number result. In particular you need to figure out how many terms to
evaluate to obtain an accurate result (because the fraction goes on forever,
albeit converging: well usually anyway!).

You can think of the continued fraction representation as a more powerful
version of a series approximation. It's used a lot for things like the
incomplete Beta and Gamma functions, Bessel function etc.

Getting back to the subject I mis-spelt the name! It's Lentz's algorithm,
and there are very few references available, although Numerical Recipies is
one source.

Anyway, this is probably getting you sidetracked, numerical evaluation of
continued fractions isn't really related to the manipulation of rationals,
which is where we started :-)

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk