[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:


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

frame binding variables (~ = dynamically):
- -1.0E30
- -1.0E30
- -1.0E30
- -1.0E30
- [10 real]

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