Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2005-09-12 12:01:07

On Sep 7, 2005, at 2:41 PM, Marshall Clow wrote:

> At 3:41 PM -0500 9/6/05, Doug Gregor wrote:
>> On Sep 5, 2005, at 12:11 PM, Daryle Walker wrote:
>>> On 9/3/05 1:00 PM, "Douglas Gregor" <dgregor_at_[hidden]> wrote:
>>>> Boost regression test failures
>>>> ------------------------------
>>>> Report time: 2005-09-03T05:00:17Z
>>> [SNIP]
>>>> Detailed report:
>>>> developer/
>>>> ml
>>> [SNIP]
>>>> |math|
>>>> octonion_test: gcc-4_0-darwin gcc-4_0-darwin
>>>> quaternion_test: gcc-4_0-darwin gcc-4_0-darwin
>>>> special_functions_test: gcc-4_0-darwin gcc-4_0-darwin
>>> It looks like some code isn't handling the improved "long double"
>>> type very
>>> well.... (With Mac OS X Tiger 10.4 and GCC 4, the "long double"
>>> type is
>>> finally distinct and bigger than "double". The pre-Tiger warnings
>>> about not
>>> using "long double" are obviously removed. But it looks like the
>>> "double"
>>> version of "exp" is being used. Taking a quick look at a system
>>> "math.h"...
>>> I'm not sure there is a "long double" overload of "exp", just
>>> "expl".)
>> Sounds like we need to do some specializing for Tiger's GCC 4.0. Would
>> you submit a patch to fix these problems?
> in <cmath>, rather than <math.h>, there is:
> long double exp(long double __x);

I've traced through this, and the right "exp" is getting called. The
machine epsilon for long double is:


There's no *way* we'll get that much accuracy out of the C library's
sin/atan/cos/etc. Here's the result of a little program that prints out
atan(1), 4*atan(1), and sin(4*atan(1)). There isn't a large enough
improvement in precision from "double" to "long double":

        atan(1) with float = 0.785398185253143310546875
        4*atan(1) with float = 3.1415927410125732421875
        sin(4*atan(1)) with float =
        atan(1) with double =
        4*atan(1) with double =
        sin(4*atan(1)) with double =
        atan(1) with long double =
        4*atan(1) with long double =
        sin(4*atan(1)) with long double =

I don't even think that we can call this a platform bug; we just can't
expect the C library routines to have that kind of precision. I think
we should consider long double tests on this platform bogus and disable


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