https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77776

--- Comment #10 from Matthias Kretz <kretz at kde dot org> ---
Experience from testing my simd implementation:

I had failures (2 ULP deviation from long double result) when using 

        auto __xx = abs(__x);
        auto __yy = abs(__y);
        auto __zz = abs(__z);
        auto __hi = max(max(__xx, __yy), __zz);
        auto __l0 = min(__zz, max(__xx, __yy));
        auto __l1 = min(__yy, __xx);
        __l0 /= __hi;
        __l1 /= __hi;
        auto __lo = __l0 * __l0 + __l1 * __l1;
        return __hi * sqrt(1 + __lo);

Where the failures occur depends on wether FMA instructions are used. I have
observed only 1 ULP deviation from long double with my algorithm (independent
of FMAs).

Here are two data points that seem challenging:

hypot(0x1.965372p+125f, 0x1.795c92p+126f, 0x1.d0fc96p+125f) -> 0x1.e79366p+126f

hypot(0x1.235f24p+125f, 0x1.5b88f4p+125f, 0x1.d57828p+124f) -> 0x1.feaa26p+125f

Reply via email to