Boost logo

Boost :

Subject: Re: [boost] floating point FUD
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-01-24 11:03:44


Thomas Klimpel wrote:
>
> Good question. I think Java took that approach. But they also got flak,
> claiming that their overly restrictive floating point specification would
> be ruining performance. But on the positive side, most of the "usual"
> traps my test program highlighted don't exist in Java. The only one I'm
> not sure about is ((1-alpha)*a + alpha*b) != a for a==b.
>

Wouldn't requiring IEEE 754 FP arithmetic for a (known to be correct)
algorithm be enough?

On the other side, in my experience, it's not just the FP logic that causes
trouble, but also that FP precision usually isn't put in a (larger)
algorithm by design.

FP algorithms are all about accumulation of error, aren't they? Would be
nice to have some kind of debugging facility (integrated with the code),
that somehow keeps track of all kinds of error bounds/measures you're
interested in.

Cheers,

Rutger


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