Skip to content

Floating-point precision in simple arithmetic #306

@mikucionisaau

Description

@mikucionisaau

Describe the bug
When using simple arithmetic over double type the values below 1e-9 behave strangely.

Consider the following model:
Image

The larger number drops and recovers as a step function:
Image

But the smaller displays erratic behavior:

Image

I have tried forcing parameters for resolution (-R) and time sampling (-F) but the erratice trajectory remains.

The threshold for erratic behavior seems to be below 2e-9:

Image

which hints to some precision constant, but there should not be any restrictions on a simple arithmetic.

To Reproduce
Steps to reproduce the behavior:

  1. open the model uppaal_example-mm.zip
  2. go to verifier
  3. check both properties
  4. see the trajectories

Expected behavior
The small number should have similar step function over time.

Version(s) of UPPAAL tested
UPPAAL-5.0.0
UPPAAL-5.1.0-beta5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions