This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Define 3-argument overloads of std::hypot for C++17 (P0030R1)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 Sep 2016 23:28:26 +0000
- Subject: Re: [PATCH] Define 3-argument overloads of std::hypot for C++17 (P0030R1)
- Authentication-results: sourceware.org; auth=none
- References: <20160927151158.GA6188@redhat.com>
On Tue, 27 Sep 2016, Jonathan Wakely wrote:
> This adds the new 3D std::hypot() functions. This implementation seems
> to be faster than the naïve sqrt(x*x + y*y + z*z) implementation, or
> hypot(hypot(x, y), z), and should be a bit more accurate at very large
> or very small values due to reducing the arguments by the largest one.
> Improvements welcome though, as this is not my forte.
Should I take it from this implementation that C++ is not concerned by
certain considerations that would arise for C: spurious underflow
exceptions from the scaling when some arguments much larger than others;
spurious "invalid" exceptions from the comparisons when any argument is
(quiet) NaN; handling of mixed (quiet) NaN and Inf arguments (where ISO C
Annex F has Inf returned, not NaN)?
--
Joseph S. Myers
joseph@codesourcery.com