From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B8473846078; Wed, 10 Apr 2024 16:41:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B8473846078 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712767313; bh=LIMsZf5Yanf/IMYn/u4moyxFpA8k4JudRuZBe99ZdKo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CRLXqZXtGANEaTSNPuDTxssq7FJIj5/0x1c+Bel64fO0dfsDYai1K7A6hldr/iH21 iXncXsKd8OOqklnOFUUslFY/YiKV4ZwgkoxdxLqlfFEOkL/T7OQb2TgwgIuVevZ3ok E1/M8nTbuxE9zNTFy7LasxlqvmvRt7QPgPTO6yMg= From: "g.peterhoff@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/77776] C++17 std::hypot implementation is poor Date: Wed, 10 Apr 2024 16:41:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: g.peterhoff@t-online.de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: emsr at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D77776 --- Comment #27 from g.peterhoff@t-online.de --- Hi Matthias, thanks for your benchmark. I still have 2 questions: 1) Accuracy The frexp/ldexp variant seems to be the most accurate; is that correct? Then other constants would have to be used in hypot_gp: scale_up =3D std::exp2(Type(limits::max_exponent-1)) scale_down =3D std::exp2(Type(limits::min_exponent-1)) 2) Speed Your benchmark outputs several columns (=CE=94)Latency/(=CE=94)Throughput/S= peedup. What exactly do the values stand for; what should be optimized for? thx Gero=