continued fractions for nth degree roots



On 2/6/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> Some examples of the difference in computation cost below.  Tracing ratsimp
> shows that it is doing very big and expensive algebraic calculations.

OK, if you'd like to post or commit some new code for cf,
that would be great. I don't know a lot about continued fractions,
so I'm not in the best position to devise something myself.

The code for continued fractions for square roots appears to
compute everything with integer arithmetic. It would be ideal if
other roots could be handled so nicely; I don't know how to go
about that. Be that as it may, cf should handle special cases
for which it knows particular algorithms, and fall back on something
like cf(bfloat(expr)) in the general case.

Robert