"Simpler" bigfloat and complex bigfloat arithmetic



Am Freitag, den 02.01.2009, 17:54 -0500 schrieb Raymond Toy:
> Barton Willis wrote:
> > -----maxima-bounces at math.utexas.edu wrote: -----
> >
> >   
> >> I think a long time ago, I talked with Barton about this, and have now
> >> finally gotten a round to implementing it.
> >>
> >> I've written a set of CLOS classes to make working with bigfloat and
> >> complex bigfloat numbers easier.  It's a new package "NUMERIC" where the
> >> standard Lisp operations have been shadowed to work with a new bigfloat
> >> and complex-bigfloat numbers.
> >>     
> >
> >
> > Great -- my version didn't use CLOS; I just had functions, such as fp+,
> > that
> > did complex float / bigfloat addition. I think I'll have a use for NUMERIC.
> > I'd
> > suggest starting a /contrib/numeric folder; eventually, I might have some
> > extensions.
> >
> >
> >   
> Actually, I was hoping it might be suitable for putting in src.  Why? 
> Take a look at gamma.lisp, and all of the routines Dieter had to write
> for double-float, bigfloat, complex bigfloat, etc.  They all look pretty
> much identical, except for the fact that he had to use different
> operation names for each case. 
> 
> With NUMERIC (I open for a different package name), he could have just
> used one routine to implement them all.  (I think.)  Yes, for speed, we
> may have wanted a separate routine for double-floats, but that could
> have waited until later when someone really needed the speed.   And the
> current routines aren't particularly fast anyway.  No offense to
> Dieter.  He just didn't declare any variable types to help the compiler
> generate fast double-float code. :-)

Hello Ray,

yes you are right. The routines are almost identical. Most things I had
to change because of different tests for zero or equivalence, etc ...

I have already finished the numerical routines for the Beta Incomplete
function. I will try to use your code.

By the way. I like the object oriented style very much. The time I
started to work on the code of Maxima I have tried to rewrite the parser
to use objects of a class structure. The first steps works fine and I
was able to integrate the code in the complete Maxima project.

One advantage can be to reduce the lots of cond and case for the
different types in the code. It would be very good to have a concept for
all Maxima numbers including rational, etc.

Dieter Kaiser