specfun update



Richard--

> I believe there is a GMP interval package.

That's part of the solution.  Another part is making its functionality
available via CL.  In the absence of a CL standard for this, this would
presumably best be done using a standard foreign function interface such
as UFFI, but unfortunately that is not yet implemented for GCL or CLisp.
Yet another part is integrating the functionality into Maxima.

On the Maxima end, we can do all sorts of neat stuff once we have a
framework for adding new kinds of numbers (or whatever you want to call
them).  I'd want a framework that could handle intervals (of various
kinds), complexes, complex intervals (of various kinds), perhaps
continued fractions, etc.

> Importing NaN, Undefined, Inf  from the IEEE float world is
> probably not a great idea.  It is a rathole which helps in
> the impoverished world where everything must fit into 32 or
> 64 bits,  but we have the world of symbols, lists, etc.

I certainly agree that we shouldn't import the IEEE float concepts
wholesale.  But  Maxima already has INF, MINF, INFINITY, IND, and UND,
though they're only supported in some places (notably Limit and Taylor).
IND is in fact a sort of vague interval....  And it turns out that in
the bowels of Maxima, there is even a sort of NaN defined (flounbound).

In most cases, I think using infinities and NaNs sensibly would be
better than the current Maxima approach of giving a DIVISION BY 0 error.
Of course, as you point out, in a symbolic system, there are other
alternatives as well.

> tradeoff of speed vs generality... the speedsters don't want to run
> slowly for stuff they don't use.

Agreed.  But if you look (for example) at the current code for
simplifying ((mplus) 2 3) to 5, I think you'll agree that making sure
that ((mplus) inf ((mtimes) -1 inf)) doesn't simplify to 0 is not really
that expensive.

> The web pages of Kahan ( http://www.cs.berkeley.ed/~wkahan )
> can tell you lots of things that can and do go wrong.

Yes, I've looked at them.

> A complete description of a perfect numeric system for a
> symbolic program may be more than a casual trapse through
> this. It may be more like a PhD dissertation.

"Le mieux est l'ennemi du bien." -- a perfect numeric system would
require a redesign and reimplementation of the whole Maxima system.
What I'm suggesting is something a bit more pragmatic than that!  But if
you have a willing sacrificial victimXXXX graduate student....

        -s