From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 4B552398E453 for ; Fri, 19 Feb 2021 21:15:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B552398E453 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: MiwBYinFF2irSbdy2JDHOIvkebDSTwsShgV7GSfwnrKdVcdoPs4/Wbbu7Rka6i1gJnVVETGGKj lmLgj82CeHtXaBJxYMSQmBUqFSlN1qDSbJi20WWpWrhqH/JwhKVvovB9UYzM31LrmzfBRVGUzu Kg0KqCPSDnrDDXgPNq2JtuAkLoaRBsTnUtX6d+d1Cg9oMyUtcziSOKbFU7mP+RmdYcTWIZhU4x D+tl4H7qg7LEqL4n7lSYfl7iON/cInTrHmhhSRVt7PLdkfJ/emIPUd+kERhz6Vk4fXsjSzh/JF nnU= X-IronPort-AV: E=Sophos;i="5.81,191,1610438400"; d="scan'208";a="58291690" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Feb 2021 13:15:37 -0800 IronPort-SDR: 0dYlcPzPlwQl6Yk8W7Jw0Yt0oXj8H3AjzWEQYGc48PJyg6OwAxUQJAC3wFuY5ewgV88+Fz/HO4 kkueBow703YhCc/s8NM0MvKACENG8DoKygc0q69vtPQQV+nmF//t11Jp5p3saS08/rvGppoBMD 9hbrGr1y9QsLLw5vxWRe0EyvSNS4kpTlduHkckPXWjnpfMbf7Drl2Y9SkpcE0lkTqviY2p2Gvh 3bhIpIb9nTu3OaYMRcYpEfGgykrliyd8xg7HDDWQXYXngjNRYC/RtuJ3RwcJsRgo/QahqQ7DeV IrU= Date: Fri, 19 Feb 2021 21:15:31 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Michael Morrell CC: "libc-alpha@sourceware.org" Subject: RE: Fix the inaccuracy of j0f/y0f/j1f/y1f In-Reply-To: <6cf8704bcd9a45ac82cf23f05aab68a6@tachyum.com> Message-ID: References: <6cf8704bcd9a45ac82cf23f05aab68a6@tachyum.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3123.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 21:15:39 -0000 On Fri, 19 Feb 2021, Michael Morrell wrote: > I'm curious about something. Where is it specified what the required > accuracy is for a given math function? Before I discovered the If the relevant standards bind a function to an IEEE 754 operation (e.g. sqrt and fma) then, for IEEE formats, it needs to be correctly rounded (including correct exceptions, including being correct about whether "inexact" is raised or not, including being correct about the architecture-specific choice of whether tininess is detected before or after rounding; it may or may not always be correct regarding whether the underflow exception is signaled in the case of exact underflow, which does not raise the underflow flag and so can only be detected with traps enabled). If the relevant standards do not bind a function to an IEEE 754 operation (most functions), glibc's accuracy goals are described in the manual ("Errors in Math Functions"). The specific numerical limits on errors in ulps that are accepted in libm-test-ulps files - such that errors above those bounds are considered to be bugs in glibc - may be found in libm-test-support.c:init_max_error. (Those are empirical bounds in that they were based on errors actually observed with glibc implementations and the glibc testsuite some time ago. It would be reasonable to reduce them if we improve the implementations in glibc so that the largest error is smaller. I expect a reduction of the bounds to 1 or 2 ulps for IEEE formats could be achieved without harming performance, although with significant effort involved to reduce error accumulation in various functions.) -- Joseph S. Myers joseph@codesourcery.com