Subject: Re: [boost] floating point FUD
From: Barend Gehrels (barend_at_[hidden])
Date: 2010-01-24 13:56:29
> This looks like fixed-point support will really become "mainstream" soon. How is this related to C++ and the idea of a Boost fixed-point library?
John Maddock wrote:
>> 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.
> I've experimented with that - a "dual precision" type - basically a
> class that evaluates every expression it's subject to at two different
> precisions - say double and with an arbitrary precision type, and then
> optionally prints out the accumulated error. The idea is one can then
> step through code, or else set a break when the accumulated error
> reaches some threshold, and see where the error is coming from in the
> algorithm. That's the theory anyway, in practice I've found good old
> fashioned pen and paper analysis of the algorithm is often as good...
I encountered the TTMath library recently, http://www.ttmath.org/ttmath.
Is it already discussed within the context of Boost? It is a templated
library, head-only where mantissa and exponent of a big-number-library
can be set as template parameters, it is almost like a Boost library...
I used TTmath figuring out a problem within segment intersection, all
numeric types gave me different results, including Excel and spatial
databases, and I didn't have any clue of what the real real result
should look like (even GMP and CLN differed...). But this library helped me.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk