IEEE floats and maxima



There's more to all this.
e.g.
Should maxima's infinity be the same as the rational
number 1/0? e.g.   internally,  ((rat) 1 0)
and how is the "exact" infinity related to the "approximate"
floating-point IEEE infinity?

Remember that the IEEE format was restricting all numbers
to a fixed field, e.g. 64 bits.  We have the ability to
code up any number of bits in a field.

Can we build a CAS entirely with the "NaN" fields?  e.g.
code x+y  as a particular NaN.

I've thought about this, and written some papers,
but the reality is that it is hard to write Lisp programs
unless you do have "appropriate flags".
I have found that in Allegro CL on some platforms, I
can get the "right" IEEE behavior only by compiling programs
with full optimization (so lisp doesn't check for division by
zero, etc.) and also, sometimes, using unadvertised flag
settings depending on the actual hardware (Intel, Sun, HP, Apple].

RJF


  Robert Dodier wrote:

> --- Raymond Toy  wrote:
> 
> 
>>Robert> I find CMUCL and GCL both have :IEEE-FLOATING-POINT in
>>Robert> *FEATURES*, although they both barf on computations which
>>Robert> would yield not-a-number or infinity. 
>>
>>If you have an example of this barfing, please show it. 
> 
> 
> What I mean is that (/ 1.0 0.0), (/ 0.0 0.0), (* 1e300 1e300)
> all yield error messages instead of a IEEE 754 result.
> 
> 
>>By default, in CMUCL, things that would produce NaN or infinity
>>signal errors. But you can change that so it does return NaN or 
>>infinity.
> 
> 
> Excellent. Maxima should set the appropriate flags to 
> return NaN and infinity. 
> 
> 
>>Of course, all computations after that are likely to be useless.
> 
> 
> Whether the result is useful can't be determined at
> the level of the floating point computation itself.
> 
> 
>>And it's likely maxima doesn't know what to do with NaN or infinity.
> 
> 
> If Maxima could just step aside and let the cpu figure
> out the result, that would be an improvement.
> This applies to floating point comparisons as well
> as arithmetic results.
> 
> We might want Maxima to make a correspondence between
> floating point infinity and NaN and symbolic inf and,
> I hope, symbolic nan. This implies a certain amount
> of work.
> 
> 
>>Robert> Maxima probably should try to work around the underlying
>>Robert> Lisp's prohibition of special values.
>>
>>Which special values?  NaN and infinity?  CMUCL handles them fine.
> 
> 
> Great. Presumably SBCL inherits CMUCL's floating point
> mechanisms. Maybe someone can tell us what is possible 
> with Clisp and GCL.
> 
> Robert Dodier
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima