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

Bug 626

Summary: pow computes incorect result in complicated expressions
Product: UPPAAL Reporter: Marius Mikučionis <marius>
Component: EngineAssignee: Marius Mikučionis <marius>
Status: ASSIGNED ---    
Severity: normal CC: adavid
Priority: P5    
Version: 4.1.19   
Hardware: PC   
OS: All   
Architecture:
Attachments: queries computing wrong values

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).