[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: screamer and floating point overflow



Nico Swart <nicswart@cis.co.za> writes:

> When I tested some of the code in the
> Screamer package I got floating point (overflow) errors. This happened
> when a function related to a numeric constraint was invoked. The function
> 'nonlinear' in the file screams.lsp is an example of this.

Look at the backtrace:

> (SCREAMS::NONLINEAR)

*** - floating point overflow
1. Break> backtrace-1

- NIL
- #<SYSTEM::SIMPLE-FLOATING-POINT-OVERFLOW #x000000>
frame binding variables (~ = dynamically):
  | ~ SYSTEM::*PRIN-STREAM* <--> #<UNBOUND>
- #<SYSTEM::SIMPLE-FLOATING-POINT-OVERFLOW #x000000>
- -1.0E30
- -1.0E30
- #<COMPILED-CLOSURE SCREAMER::INFINITY-*>
- -1.0E30
- -1.0E30
- [10 real]
- #<COMPILED-CLOSURE SCREAMER::*-RULE-UP>

Apparently the error occurred when clisp tried to multiply (* -1.0E30 -1.0E30).
The result 1E60 is outside the range of representable IEEE single floats.
To overcome this, you can try to
- set *infinity* in equations.lsp to a smaller value than 1e30, or
- set *read-default-float-format* to DOUBLE-FLOAT before compiling
  Screamer. The range of IEEE double floats goes up to 1e308.


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de