It comes up again and again, so maybe it is worth more than a superficial
glance and an "it's too hard to do right" and "here's how to start hacking".
How can one introduce intervals into Maxima/Macsyma in a sensible way?
Here's my suggestion:
1. It doesn't make much sense to talk about intervals with symbolic
endpoints because it almost immediately descends to uselessness. e.g. [a,b]
op [c,d] = [ min(a op c, a op d, b op c, b op d), max(...)] if op is
monotonic, and worse if it is not.
2. It also does not make much sense to take intervals as a full participant
in simplification with symbols, e.g. x+[-1,1], although this is not subject
to the combinatorial explosion of paragraph 1.
Here's a proposal.
There are several rather fully-formed interval arithmetic packages, using
standard hardware IEEE arithmetic, and
even for arbitrary precision e.g. mpfi
http://perso.ens-lyon.fr/nathalie.revol/software.html
(I have such a system, less complete, in a "generic arithmetic" system
written entirely in lisp...)
For Maxima, consider a new evaluator that has the following features.
a. It has essentially the same arithmetic and control structures as "meval"
syntactically. In fact, the same parser is used.
b. It works only on interval or numeric constant objects. (a numeric
constant 1.234 is equivalent to the interval [1.234,1.234].
c. It has a few additional operations like subset, overlap,
absolutely-lessthan, maybe-lessthan ... that make sense for intervals. And
a few "advanced" operations like "evaluate a polynomial at an interval
point".
Then to do interval arithmetic, we do something like
f(x,y,z):=IEVAL(x^2+y-3+....).
Note that every symbol in the expression x^2+y-3+ ... MUST be resolvable to
a numeric constant or an interval.
If not, it is an error, e.g. Error: IEVAL, unbound variable ....
Advantages: off the shelf interval arithmetic (written by people who care
about it); we don't spend time doing essentially useless generalizations of
interval arithmetic "because we can".
Disadvantages: There appears to be more or less constant turmoil in the
interval arithmetic community, even regarding such basic issues as notation.
Where do we take the off-the-shelf implementation, and if it is in C or C++,
how to build the interface. (Oh, it also turns out that respect for IEEE
rounding may matter, and some lisp systems pretty much disrespect this..)
Comments?
RJF