Subject: Re: screamer and floating point overflow

From: haible (Bruno Haible)
Date: Mon, 17 Apr 95 23:59:29 +0200

Nico Swart <[email-masked]> 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
                    [email-masked]