Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-07-05 11:54:45


At 12:18 PM 7/5/2003, Guillaume Melquiond wrote:

>On Sat, 5 Jul 2003, Beman Dawes wrote:
>
>> What is happening here? It seems to me that the error checking code
>> itself that computes the values to be checked (d1 and d2) introduces
one
>> to four possible additional rounding errors. (The error checking code
>> always does one subtraction, possibly one subtraction in an abs,
possibly
>> another subtraction in an abs, and possibly one division). That would
>> account for the observed behavior.
>
>Sorry, I don't see all the substractions you are speaking about, I only
>see these three floating-point operations in close_at_tolerance:
>
> FPT diff = detail::fpt_abs( left - right );
> FPT d1 = detail::safe_fpt_division( diff, detail::fpt_abs( right ) );
> FPT d2 = detail::safe_fpt_division( diff, detail::fpt_abs( left ) );

fpt_abs may do a unary "-" operation. I'm assuming, perhaps incorrectly,
that is essentially subtraction and subject to a possible rounding error.

--Beman


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