double-precision vensim dies with single-precision overflow

Use this forum to post Vensim related questions.
Post Reply
tfhavel
Junior Member
Posts: 11
Joined: Wed Jan 30, 2008 9:41 pm

double-precision vensim dies with single-precision overflow

Post by tfhavel »

I'm doing an optimization with the double precision version of vensim, and it sometimes (not always) dies with "ERROR: The computed value (3.60256e+038) for - xyz - out of bounds. Truncated. ERROR: Floating point error preparing data for storage Trying to save results anyway." And it gets this single-precision overflow in the middle of a simulation. Why?
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

This is basically a floating point overflow but that shows up not as an overflow during computation but during the conversion of the result back to single precision. In general there can be some differences between single and double precision behavior. For example

normal number = (big number 1 * big number 2)/(big number 3 * big number 4)

might not cause any trouble in double precision, but generate a floating point exception in single precision. Your example is more like

too big number = big number 1 * big number 2

in single precision the multiplication causes the error. In double precision the multiplication is OK (double can handle bigger numbers) but the resulting number can't be stored as a result so the error message is thrown. The fix is the same for both - keep big number 1 and big number 2 smaller (or if a/b use ZIDZ or XIDZ).
Post Reply