continued fractions, was: Quality of share vs. src (WAS matrixexp problem (bug ?))
Subject: continued fractions, was: Quality of share vs. src (WAS matrixexp problem (bug ?))
From: Stavros Macrakis
Date: Fri, 27 Oct 2006 10:14:04 -0400
On 10/27/06, Barton Willis <willisb at unk.edu> wrote:
> Robert:
> >... how about if we rework the representation to be like other
> >Maxima objects?... How about if we represent them as ((%CF) ...) and
> >display them as either cf(...) or,
>
> Surely, the cleanest way to handle continued fractions would be to modify
> simplus and friends. Then, for example, cf(1,2) + cf(3,4) => cf(4,1,3).
> (Currently, cf([1,2] + [3,4]) => [4,1,3].) Reworking Maxima's arithmetic
> simplification functions would be a good thing (they are slow and
> inflexible), but it's a great deal of work.
Certainly making CF a special representation is the right thing to do.
The current scheme for arithmetic in particular (where cf evaluates
its arguments itself to avoid having meval/simplifya do the wrong
thing) is a horrible horrible hack.
Adding a special CF type to simplus, simptimes, simpexpt, and the
display formatter is not all that much work. It does seem a pity for
it to be so non-modular though. Let me think about a clean modular
way to do this.
-s