Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-04-24 12:41:44

"Paul A. Bristow" wrote:
> I am sure there is a BIG cost in using intervals rather
> than single values, and for SOME applications it isn't worth it.

With current processors, the performance cost for simple arithmetic
operations is usually much higher than just having to do every arithmetic
operation twice (once for the lower and once for the upper bound, simply

Usual implementations (mine, too) switch the rounding mode so that
computations of the lower bound are always rounded downwards and
computations of the upper bound are always rounded upwards. However,
switching the rounding mode is rather costly on most processors,
because those rounding mode switches often require that the internal
instruction pipeline be completely empty --- with modern pipelines
with at least 10 stages, that's a long time considering that the
switches happen after each arithmetic operation.

Additionally, most compilers do not have a grasp of rounding mode
changes, so you can only tell your compiler not to reorder
instructions around (black-box assembly) rounding mode changes.
This disables common optimization techniques such as common
subexpression elimination or moving invariants out of loops.

Jens Maurer

Boost list run by bdawes at, gregod at, cpdaniel at, john at