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

--- Comment #13 from g.peterh...@t-online.de ---
Thanks for the suggestions:
template <typename _Tp>
constexpr _Tp __hypot3(_Tp __x, _Tp __y, _Tp __z)       noexcept
{
        if (std::isinf(__x) | std::isinf(__y) | std::isinf(__z))
[[__unlikely__]]
                return _Tp(INFINITY);
        __x = std::fabs(__x);
        __y = std::fabs(__y);
        __z = std::fabs(__z);
        const _Tp __max = std::fmax(std::fmax(__x, __y), __z);
        if (__max == _Tp{}) [[__unlikely__]]
                return __max;
        __x /= __max;
        __y /= __max;
        __z /= __max;
        return std::sqrt(__x*__x + __y*__y + __z*__z) * __max;
}

The functions are then set to constexpr/noexcept.

regards
Gero

Reply via email to