I think I finally (sorry about that) understand the point youâ€™re making, and itâ€™s valid. Each operation, e.g., + , must be properly rounded before proceeding. Internally:

```
?- [X,Y]::real(100.0,101.0),{T==X+Y,Z== -T}.
X = _62238{real(99.99999999999997,101.00000000000003)},
Y = _62400{real(99.99999999999997,101.00000000000003)},
T = _62906{real(199.9999999999999,202.0000000000001)},
Z = _63942{real(-202.0000000000001,-199.9999999999999)}.
```

So all is good if the rounding is done at each step. As you noted, some donâ€™t require rounding at all, e.g., unary `-`

. But all this is hidden from the user, he just writes:

```
?- [X,Y]::real(100.0,101.0),{Z== -(X+Y)}.
X = _67084{real(99.99999999999997,101.00000000000003)},
Y = _67246{real(99.99999999999997,101.00000000000003)},
Z = _67914{real(-202.0000000000001,-199.9999999999999)}.
```

Where the rounding mode is helpful is on each bounds calculation, e.g., for a `Z==X+Y`

then `lb(Z) isL lb(X)+lb(Y)`

and `ub(Z) isH ub(X)+ub(Y)`

.

For `Z== -T`

then `lb(Z) is -ub(T)`

and `ub(Z) is -lb(T)`

(note no rounding).

Itâ€™s all in Prolog (SWI-Prolog to be precise), so no platform specific code (one of my original objectives). Itâ€™s a SWIP package, so it should install from the package manager (use `pack_install/2`

). But you can download from github directly if thatâ€™s more convenient. Instructions are at https://github.com/ridgeworks/clpBNR_pl#getting-started ; let me know if theyâ€™re not clear.

Although it all seems to be fairly stable, itâ€™s still an alpha release as far as Iâ€™m concerned and documentation is even more alpha.

Quite right, or the `ic`

library in Eclipse. Interval arithmetic (i.e., `breal`

's) is just the foundation. (In this world `pi`

is like any other floating point constant which must be fuzzed when constructing a constraint.)

BTW, none of this is particularly new. Some 20-30 years ago I worked on the original CLP(BNR) which was a Unix based Prolog. Also CLIP (Hickey et. al) and Numerica (Van Hentenryck et.al), a DSL focusing on global optimization problems using relational interval arithmetic. But none of these seem to be still available in working form.

And interval arithmetic goes back to the 60â€™s (R.E. Moore).