This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 626 - pow computes incorect result in complicated expressions
Summary: pow computes incorect result in complicated expressions
Status: ASSIGNED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: 4.1.19
Hardware: PC All
: P5 normal
Assignee: Marius Mikučionis
URL:
Depends on:
Blocks:
 
Reported: 2016-11-08 16:05 CET by Marius Mikučionis
Modified: 2017-03-15 16:13 CET (History)
1 user (show)

See Also:
Architecture:


Attachments
queries computing wrong values (1.49 KB, text/xml)
2016-11-08 16:05 CET, Marius Mikučionis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marius Mikučionis 2016-11-08 16:05:08 CET
Created attachment 305 [details]
queries computing wrong values

The model has two variables always set to zero:
int i=0;
double d=0.0;

Then the following queries:

simulate 1 [<=10] {
  i,
  pow(0.5*i, 2.0) + 2.0,
  2.0 + pow(i*0.5, 2.0),
  2.0 + pow(0.5*i, 2.0)
}

simulate 1 [<=10] {
  d,
  pow(0.5*d, 2.0) + 2.0,
  2.0 + pow(d*0.5, 2.0),
  2.0 + pow(0.5*d, 2.0)
}

should compute   {0, 2,    2,   2} 
but both compute {0, 2, 0.25, 0.5}

There is some strange interaction with variables and pow function.

Wrong values are also computed when these expressions are used in the model (where it is even more difficult to find).