Re: specfun and bigfloats



This requires a longer answer, but here are some items.  (I'm
going to be away from my office for 6 weeks; probably with OK
email, but not guaranteed...)

Stavros Macrakis wrote:
>>for every library polynomial add to the computation a secondary
>>computation which is the error in computing the value by whatever
>>method is being used
> 
> 
>>Mathematica's version of arithmetic, at least
>>for the higher precisions, is to implicitly return an interval, which
>>is essentially 2 or maybe 3 quantities.
> 
> 
> What is not "respectable"?: interval arithmetic in general, or
> Mathematica's way of doing it? 

Interval arithmetic is respectable. Mathematica has a good 
implementation of RealInterval.  But it also has an 
implicit-in-every-bigfloat interval-like arithmetic. It makes
it impossible to (for example) write a convergent Newton iteration,
because as the arithmetic converges, the (bogus) accuracy seems
to get worse instead of better. The solution is supposedly to
diddle with the accuracy at each iteration.

  I know that interval arithmetic can be
> pessimistic, but is the Horner's rule calculation you mention better?
> (This is not a rhetorical question.) 
One can almost always do better than interval arithmetic with a little
thought. Any time the same value comes into the computation more than
once, it should be the SAME error in the same direction.  Offhand, I'm
not sure this Horner's rule is much tighter, since it includes no
errors in the variable x. But it uses considerably less arithmetic.

  Are there better approaches to
> precision estimation than classic worst-case interval arithmetic?
> 
Sure, but the best require numerical analysis smarts. The commonsense
and usually OK way is to re-do the calculation of interest in a
precision that is twice the previous precision. If it comes out
the same, believe it.  (This is of course NOT a proof that the answer
is correct, and examples can be devised to contradict this kind
of belief).
   A plausible approach is then to have a quad-precision implementation
of everything. (doubled double-precision.).  There are very fast software
implementations, taking maybe 4X or so time per operation.


> The advantage of interval arithmetic is that it can be applied to any
> calculation.

yes

> 
> Ideally, we'd rework Maxima so that it generalizes its notion of number
> to include not just integers, rats, and bigfloats, but also complexes,
> intervals, etc.  Not trivial, but....
> 
Some of these require no more than using the underlying Lisp numbers.

>         -s
>