From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id BC1A1385B834 for ; Tue, 24 Mar 2020 23:15:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BC1A1385B834 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: fPrg4BeMHgy7/IQqElkM5SIhMfIXnZXzV+S2Kakrah4rb9jWvWr4h0wVVpAAwcWpzC2HVJLg5y 1kV9rJGFl9f3dy2WTRZUwaPQrJ4OOKrziQIIAp+xrvzpGED8ovDPedERrF0vi2NH3buUYh8VTS LKzmyQF2TJ/SBDwUjbfum3dqW75f/Irs5MM6lvAfyF/9F9EvKmGiThLTJ8sUyjO0ZK+DTaA2C2 ThMY0tyY/awLRkJSTboqcziIOKUXY1a8lEkzezc8/IF+c4AnkQnn/T6wP4priq6CejLdLLa/J/ 1Aw= X-IronPort-AV: E=Sophos;i="5.72,302,1580803200"; d="scan'208";a="47113552" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 24 Mar 2020 15:15:13 -0800 IronPort-SDR: bPcb1uoXbYMcpJ8otBjuKi0LGm6+b1Ank/6HrGBnRUCK7Ed7bZgfYKRHEZ2XP9UD/0KLY3gR/h R7HyylNmSPxqfm2Xlf8/JLsdWevuMKRBDlHs87XwNUn+PRoXSQ5gy/d6VgLwmkXl6b4p/JEaNm RS+ahakqaSXbjc7sDO4tDpJ2NUwYHcaFPYz67XUiyqmYB20MqRxGOECJxQUDQyXWOPQaMBjd5Z CDxY6xdUikKge1v4PXF+Y/Cc2XUNBlJIBAj/yYb/aor3GO07nHhp3CupV4v1UnzUEe1mss0DWe doA= Date: Tue, 24 Mar 2020 23:15:08 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Szabolcs Nagy CC: Anssi Hannula , "libc-alpha@sourceware.org" , nd Subject: Re: [PATCH 1/2] ieee754: Remove slow paths from asin and acos In-Reply-To: <714b667d-7345-bcd4-ca30-7ecbb7098bbc@arm.com> Message-ID: References: <20200127104511.16618-1-anssi.hannula@bitwise.fi> <714b667d-7345-bcd4-ca30-7ecbb7098bbc@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, 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: Tue, 24 Mar 2020 23:15:16 -0000 On Mon, 27 Jan 2020, Szabolcs Nagy wrote: > On 27/01/2020 10:45, Anssi Hannula wrote: > > asin and acos have slow paths for rounding the last bit that cause some > > calls to be 500-1500x slower than average calls. > > > > These slow paths are rare, a test of a trillion (1.000.000.000.000) > > random inputs between -1 and 1 showed 32870 slow calls for acos and 4473 > > for asin, with most occurrences between -1.0 .. -0.9 and 0.9 .. 1.0. > > > > The slow paths claim correct rounding and use __sin32() and __cos32() > > (which compare two result candidates and return the closest one) as the > > final step, with the second result candidate (res1) having a small offset > > applied from res. This suggests that res and res1 are intended to be 1 > > ULP apart (which makes sense for rounding), barring bugs, allowing us to > > pick either one and still remain within 1 ULP of the exact result. > > > > Remove the slow paths as the accuracy is better than 1 ULP even without > > them, which is enough for glibc. > > > > Also remove code comments claiming correctly rounded results. > > the patch looks good to me. Yes, please commit. -- Joseph S. Myers joseph@codesourcery.com