Boost logo

Boost :

Subject: Re: [boost] [review][constrained_value] Review of Constrained Value Library begins today
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-12-10 04:15:23


John Phillips skrev:

> Ideas that force the floating point value out of the register and into
> cache will, on average cost more than an order of magnitude in time
> increase for the comparison (forcing to main memory is far, far worse).
> This isn't acceptable for anyone who needs performance from the comparison.
>
> Reducing the bits used in the mantissa for the registers can be far
> worse. Most accuracy guarantees made for the calculations assume the
> existence of guard bits in the register. Without them, the calculation
> loses significance faster than expected. This is not acceptable for
> anyone who needs high precision.
>
> In general, these are difficult and subtle problems you are
> approaching when you try to compare close floating point numbers. The
> past is littered with examples of how not to do it, and doing it well is
> very fiddly. It is possible to find all of the details for this, but it
> should only be done if someone wants to put in the time and effort to
> find out the best available methods. "This is probably good enough"
> ideas almost never are in this setting.

Well, problem one would be to find one that has the knowledge to find
the datails.

John Maddock gave two examples: one where we accapted wrong values and
one where we rejected correct values. I found the latter somewhat better
(because the invariant of bounded_float would be preserved), and if we
are able to get that behavior consistently, I would be quite happy.

So maybe most of our problems will be fixed by using >= and <= instead
of < and >?

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk