From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15418 invoked by alias); 12 Mar 2018 21:13:20 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 15407 invoked by uid 89); 12 Mar 2018 21:13:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=first-level, firstlevel X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com From: Wilco Dijkstra To: Joseph Myers CC: Steve Ellcey , Zack Weinberg , =?iso-8859-2?Q?Ond=F8ej_B=EDlka?= , Siddhesh Poyarekar , "libc-alpha@sourceware.org" , nd Subject: Re: [PATCH 2/6] Remove slow paths from sin/cos Date: Mon, 12 Mar 2018 21:13:00 -0000 Message-ID: References: <1520636722.6774.157.camel@cavium.com>, , In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB6PR0801MB2040;7:Ai78uU23Hn/Cj78wWDcDJk7Mx6Ls7WZahv1jrQnvHaxvukSlBbq5RPP09mRc7hJRdgspRddwXO1G3xGgupZqoGGQMVfsWBAxJ+B5dvA6S8mIIBk6XAmh//BzBkXQ/qIId38Io2rviJ2kcECaZEXt5KrbUWL9adVNUPSjhlZs3hg9u7GOLh2DN/k9n9261UpmxL0v5/49MfXT7LHzK9ZFqdmLh0zAJhD1AkGkA5b1VHhBQaxSRc0jxRUy3X9xFhFo x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4b33d32d-8600-4c49-f476-08d5885e10eb x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DB6PR0801MB2040; x-ms-traffictypediagnostic: DB6PR0801MB2040: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DB6PR0801MB2040;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB2040; x-forefront-prvs: 06098A2863 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39380400002)(366004)(346002)(396003)(376002)(39860400002)(199004)(189003)(74316002)(305945005)(316002)(105586002)(6246003)(106356001)(8656006)(59450400001)(5660300001)(26005)(6506007)(102836004)(93886005)(186003)(5250100002)(7736002)(86362001)(8936002)(81156014)(81166006)(8676002)(68736007)(72206003)(2906002)(229853002)(54906003)(33656002)(3280700002)(6116002)(2950100002)(6916009)(25786009)(53936002)(76176011)(4326008)(3660700001)(66066001)(478600001)(14454004)(2900100001)(9686003)(3846002)(7696005)(97736004)(6436002)(55016002)(99286004);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0801MB2040;H:DB6PR0801MB2053.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kK1Du10RPoG+262qAiJfAiWtLe5P2R2whDyVjo5anN5b/qWRN9Y52I0WJmthmdGY/HxmrH+8uVwsSubWc92rSM0ufuZ2O5AY7dE7LKEd0b2FWm3SCl/O14CQfkn/DIrCs7yZACLtFT3+KzCHV0ozUhHD/aKqQjSer22rspwrFKmSjQ3ciYwcAoj8oORokKY3dPt5E884GbgoAd8NJZGVM+Go09xHqPcBEcqCQfyHL9UwfCiJDEebZmDiAsmZSw759AMKr19BodzpqSj3e0+WXsfBYQvXt8Cp5RVnr/DjPTdsF6q62cZX7NCbcLP4McnC2QlZUJ/f3hNCl4e1lU68Tw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b33d32d-8600-4c49-f476-08d5885e10eb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2018 21:13:13.4058 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2040 X-SW-Source: 2018-03/txt/msg00298.txt.bz2 Joseph Myers wrote: > On Mon, 12 Mar 2018, Wilco Dijkstra wrote: > >> Though these patches keep the ULP accuracy across the full range as is,= =20 >> we could agree on higher ULP errors for large/huge range reduction cases= =20 >> in the future. The main complexity is for certain rare inputs which happ= en to >> be extremely close to an integer multiple of PI/2, and those few cases m= ean >> you need significant extra work to guarantee 0.5 ULP error bound on range >> reduction. > > I don't think the work for having an error bound not much more than 0.5ul= p=20 > on the final result of sin/cos for large arguments is significantly=20 > different from the work for having an error bound of say 3ulp (the=20 > testsuite has a global maximum of 9ulp (16ulp for IBM long double) beyond= =20 > which it will not accept errors even if those large errors are listed in= =20 > libm-test-ulps files - that bound is simply based on the errors=20 > empirically observed at present, for functions other than Bessel function= s=20 > and cpow which are known to have cases with much larger errors). Having to do another reduction step can increase latency significantly. To = give an example, I had to increase accuracy of the first-level range reduction b= ecause a handful huge multiples of PI (6-7 digits) had 2-3ULP reduction error. The= additional accuracy means range reduction became 50% slower while being way too accura= te for almost all inputs. Obviously it would be possible redesign it from scratch using a much smalle= r input range and FMA when available etc. Wilco