From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70044.outbound.protection.outlook.com [40.107.7.44]) by sourceware.org (Postfix) with ESMTPS id 9C22538708A6 for ; Mon, 4 Jan 2021 12:19:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9C22538708A6 Received: from DB6PR0501CA0021.eurprd05.prod.outlook.com (2603:10a6:4:8f::31) by AM0PR08MB5314.eurprd08.prod.outlook.com (2603:10a6:208:184::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Mon, 4 Jan 2021 12:19:43 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::e3) by DB6PR0501CA0021.outlook.office365.com (2603:10a6:4:8f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Mon, 4 Jan 2021 12:19:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.21 via Frontend Transport; Mon, 4 Jan 2021 12:19:43 +0000 Received: ("Tessian outbound 8b6e0bb22f1c:v71"); Mon, 04 Jan 2021 12:19:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 955584022648f6f4 X-CR-MTA-TID: 64aa7808 Received: from 3beafa7ca0d9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 52A6D8A7-04CE-416F-9686-41A89A0903EA.1; Mon, 04 Jan 2021 12:19:38 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3beafa7ca0d9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 04 Jan 2021 12:19:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDsZUIwgT6R4LdApZ+niNjqXJvBbyjQszAeCYhyAyLWabzFoSvTdYyFyNLjZyjdN2lAfNUAa9vcm53KF58F60PvNtguHo86Bmep/ynpGTQZrKCMlAe3LRv4a57A8r4/2Y8JR0KT4cV9CYSe8tA2E9STRrzn8/XZVggqvJM5O5vhDCve/tF/cA5bRthEEHiL1uQ9VWaC+vvqou5eUiDb+Nbr6w3pS4qGX+Uq7dmc7yksjAhIWKvIMIWxTxr0NSNudQ5NqoGcVy2M6ZydQ35W+4ItPer0pBB/vjbZ52QJql2SG191i8uze9ytbJOOhLB/5NgZ9rdYFiVf5X7wKLpA4ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cLQSPh1TUGTH/KuGMN+zBm2+vX+3pyvXvNLwoEsEPhI=; b=l9LHrySSWvyErI57dr1ICLOd4o/rc3D7Vw0cot0BaYBtJUv1UFegJ/HtOMGg5TcnU9Edmg4o0oMHFysPefMV8zkB16ZlYpzmbXKAJLYAvtwF/iFIEOoX4DlUsggjSfFNN1XZ/AkWrVQj+nRkCPVlkrk4ydn4434nFdtznKxBs970dqzRQ1xnwxXB5tLfNO5MOpDzBYcFlZyic45jje064w8OaPFnHCyo0sdVvYHKd1DJ/F6P/MFUqdUm+NEa9CvUxkNmfrNl2TzG89E75Ybf+JBPe2uBFoy0K6B6Luv90XK92lpnepxLvsFjUwxPP0WNEU2P8WHmsxgoU+ok0tPilA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5599.eurprd08.prod.outlook.com (2603:10a6:800:1a1::12) by VE1PR08MB4718.eurprd08.prod.outlook.com (2603:10a6:802:a5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.22; Mon, 4 Jan 2021 12:19:35 +0000 Received: from VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::6d00:2694:e0d7:986f]) by VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::6d00:2694:e0d7:986f%5]) with mapi id 15.20.3721.024; Mon, 4 Jan 2021 12:19:35 +0000 From: Wilco Dijkstra To: 'GNU C Library' Subject: [PATCH 3/5] Remove slow paths from atan Thread-Topic: [PATCH 3/5] Remove slow paths from atan Thread-Index: AQHW4pPd+I105q7+9Uu2w+Y9xRNMUw== Date: Mon, 4 Jan 2021 12:19:35 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [82.24.249.100] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4eabae04-5fc3-4db4-d283-08d8b0ab0482 x-ms-traffictypediagnostic: VE1PR08MB4718:|AM0PR08MB5314: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:156;OLM:156; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7C30wxVlWZJAHb9g02fKg0IbzMz31P2X4x+bQdm0xvg2JXOqZmqyIyhZaTLEQKoUGfOVHeUxTsxt6LPF921EIkMT2Y6+XSgmtqkG0GYOL2az39Okg560D/xcKUdI/OXLF9TiW7gM+W5s6ltV3OZu5L08smPL8c01RCrQpsE3lS4UEnF95gLJq7l+jv+f0QnEGMKyOjtw7geQCQQX9yBzHaM7zmTmm+J9K8QFKLDYQg3z1qvP0Qrbfh64XNRfnJQlqPScppUQAyy1cVnYUnC7xUm1X0ecOOf9Mb8DBiKerkpO/MIYy8HHfSAhGrRzOwml5mdkbY9FjNwe2zI5pc4sEcpNvz0lmfPeplKWCXDb6CUaSKXRFLKgh5moMbB+L0u+Nq5LhcQAranqUe9RU+I9CQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5599.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(396003)(346002)(376002)(91956017)(66446008)(8936002)(478600001)(66476007)(66556008)(64756008)(66946007)(71200400001)(7696005)(33656002)(26005)(8676002)(186003)(55016002)(316002)(76116006)(2906002)(9686003)(86362001)(83380400001)(5660300002)(2940100002)(52536014)(6506007)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?yp6DiMqmdlf5pa6n2IMAvmI6GULYMwNBfDDBj2qhYtq+51o5IDCaK8I0/L?= =?iso-8859-1?Q?bmCZ5g/VBE5HDdv8Y6XTmNz2r/eZqtpcl7vRgvCWANqZWGaIQXTrPomCId?= =?iso-8859-1?Q?d89AmJqHeypsCxAGLJXQXK04MCjzWcfRVpA4b31XY8KFMiwEXzqFv+iNbH?= =?iso-8859-1?Q?N8UoRmd43dn04mECQUT6UY2bVIzxhMJN2li+ExiGnXOgCpKkEfbM+fAO1F?= =?iso-8859-1?Q?Cv9xdQtvPShhWOvaEywGtd0yh1ZukfuUG7kfKn0pW9mt2fwkl1tY0INaF8?= =?iso-8859-1?Q?vo1cDB0wP7iNd6lApZabqGITvW4aZH2vvsLhxqWQ55+zIW+s/FK6jF2Sfy?= =?iso-8859-1?Q?/atPEp8uPj0gUDzHT0l7cAxospoG8pRElayf65CtfVyCC06KwzXM0OcICN?= =?iso-8859-1?Q?eRtK0/qeYd0WSz9D8vxmMu2LmAEVLvmRpvUB2wGjmpJSqSn0kunSY49JA8?= =?iso-8859-1?Q?PiF1gLOmuJtSkQUVvOznZwYGA/38+QunYZ7g3OKqd+nfHcVaDwUVeENjER?= =?iso-8859-1?Q?aBVhHJm9lQbhzbyPNwH1Ja5+4HGp6xGsYJnx2dtQfjKG7m/mknpIiVKAqg?= =?iso-8859-1?Q?JkDAgYkh6ntrUT3HwRkoTX8PtdmaYHM1rhQcMl2hbhMcoYiAIq4k06PQhT?= =?iso-8859-1?Q?wkcnjSaxJ9zKb3dVpOzIz4U4k6QXPwnne1NvGQ+IJDn1nr6E7f0QfVGxXI?= =?iso-8859-1?Q?8JuQ8uP1La45ZL/+CxpxiO1JvBb34RTOkVWpVUobKMoBZcnA+T8llyw8vb?= =?iso-8859-1?Q?Oy6ka1Jy7lOHWEq0fXGSVqys7jSR+DHDMEdtsbqzNnvK7Bitmz9i+Pf/1r?= =?iso-8859-1?Q?lFxe13/YWj3wUvjtLUoj930mI02RAiFat1nB9Us/3y6aWIcvh4zm5c+g4r?= =?iso-8859-1?Q?nOrQ9myAXKASjjl//WHlKfapeslX3iV5ySf59AyrNnJ+aJqRiPVL4KpJ6b?= =?iso-8859-1?Q?s/cEXXaoP3Fl1K5EmZYK/tXFH3rBHjw0ownWlbhwVaaj0xESMTKdI1cbB5?= =?iso-8859-1?Q?c4RQG4k3wF4DmutFo=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4718 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8bdaa13d-b6f6-4eda-619d-08d8b0aafffe X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v+8ARNosZhPTuNYUqEH/Pumeje8nDwKeF1uJthAte8KFAtmhjKvtZmL+oywPQIhXJOv8FAZQwfEbmVttF775RU9PxWlK7Qa4yS9YsdSq/QOyBkhQir0WA2hr9gFclN/+2KbLCBg4cb3oY01jimWLoS3FnhF/uQcDHzpti5w5b1DvWt+xSth70DRKNI1AtJ7UmClEBB7x/3fYlP7zP5LlcbqO9jlhfTnKH+LLWZZshhs5lH6Eic5LjHfgVGK7wooOs7KIQHVQd/jgjEqP1nrof4VKLNNi2SbfmQqpuDQsqqab1bWcOStz+rC3PM6QAray+2tFuq/d7DyqWzm3DcNo+e+2oJRCLYL4mQOr/N3Ieu+d4/P6YTQQmAlyevphF/1PGoBmt7loiJhKNP7oGXddgtNf87GTR8xMcNLftgy5bn1lJbdPPCWtAhgQo7aY4IUSEnWy5lLnW8mpkJaLSbrZvw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966006)(8676002)(52536014)(8936002)(6506007)(33656002)(336012)(5660300002)(82310400003)(26005)(478600001)(6916009)(186003)(47076005)(82740400003)(7696005)(2906002)(316002)(70206006)(70586007)(9686003)(86362001)(55016002)(356005)(2940100002)(81166007)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2021 12:19:43.4433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4eabae04-5fc3-4db4-d283-08d8b0ab0482 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5314 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham 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: Mon, 04 Jan 2021 12:19:48 -0000 Remove slow paths from atan. Add ULP annotations.=0A= =0A= Passes GLIBC testsuite.=0A= =0A= ---=0A= diff --git a/sysdeps/ieee754/dbl-64/atnat.h b/sysdeps/ieee754/dbl-64/atnat.= h=0A= index bb4a2ebdc4bd9b2f2ec8ec4395b91c683eb83a8f..29d7671b86750edb810e3918d30= 76bab23c0f56a 100644=0A= --- a/sysdeps/ieee754/dbl-64/atnat.h=0A= +++ b/sysdeps/ieee754/dbl-64/atnat.h=0A= @@ -29,7 +29,7 @@=0A= #define M 4=0A= =0A= #ifdef BIG_ENDI=0A= - static const number=0A= + static const mynumber=0A= /* polynomial I */=0A= /**/ d3 =3D {{0xbfd55555, 0x55555555} }, /* -0.333... */=0A= /**/ d5 =3D {{0x3fc99999, 0x999997fd} }, /* 0.199... */=0A= @@ -79,7 +79,7 @@=0A= =0A= #else=0A= #ifdef LITTLE_ENDI=0A= - static const number=0A= + static const mynumber=0A= /* polynomial I */=0A= /**/ d3 =3D {{0x55555555, 0xbfd55555} }, /* -0.333... */=0A= /**/ d5 =3D {{0x999997fd, 0x3fc99999} }, /* 0.199... */=0A= diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_ata= n.c=0A= index 30b0906826d005c17f9322ff7172ec06b66dc03e..fdd18920b38dda61d2ed43abfda= db0057d6d611f 100644=0A= --- a/sysdeps/ieee754/dbl-64/s_atan.c=0A= +++ b/sysdeps/ieee754/dbl-64/s_atan.c=0A= @@ -20,25 +20,15 @@=0A= /* MODULE_NAME: atnat.c */= =0A= /* */= =0A= /* FUNCTIONS: uatan */= =0A= -/* atanMp */= =0A= /* signArctan */= =0A= /* */= =0A= -/* */= =0A= -/* FILES NEEDED: dla.h endian.h mpa.h mydefs.h atnat.h */= =0A= -/* mpatan.c mpatan2.c mpsqrt.c */= =0A= +/* FILES NEEDED: dla.h endian.h mydefs.h atnat.h */= =0A= /* uatan.tbl */= =0A= /* */= =0A= -/* An ultimate atan() routine. Given an IEEE double machine number x */= =0A= -/* it computes the correctly rounded (to nearest) value of atan(x). */= =0A= -/* */= =0A= -/* Assumption: Machine arithmetic operations are performed in */= =0A= -/* round to nearest mode of IEEE 754 standard. */= =0A= -/* */= =0A= /************************************************************************/= =0A= =0A= #include =0A= -#include "mpa.h"=0A= -#include "MathLib.h"=0A= +#include "mydefs.h"=0A= #include "uatan.tbl"=0A= #include "atnat.h"=0A= #include =0A= @@ -47,10 +37,8 @@=0A= #include =0A= #include =0A= #include =0A= -#include =0A= =0A= -void __mpatan (mp_no *, mp_no *, int); /* see definition in mpatan.c */=0A= -static double atanMp (double, const int[]);=0A= +#define TWO52 0x1.0p52=0A= =0A= /* Fix the sign of y and return */=0A= static double=0A= @@ -60,16 +48,13 @@ __signArctan (double x, double y)=0A= }=0A= =0A= =0A= -/* An ultimate atan() routine. Given an IEEE double machine number x, *= /=0A= -/* routine computes the correctly rounded (to nearest) value of atan(x). *= /=0A= double=0A= __atan (double x)=0A= {=0A= - double cor, s1, ss1, s2, ss2, t1, t2, t3, t4, u, u2, u3,=0A= - v, vv, w, ww, y, yy, z, zz;=0A= + double cor, t1, t2, t3, u,=0A= + v, w, ww, y, yy, z;=0A= int i, ux, dx;=0A= - static const int pr[M] =3D { 6, 8, 10, 32 };=0A= - number num;=0A= + mynumber num;=0A= =0A= num.d =3D x;=0A= ux =3D num.i[HIGH_HALF];=0A= @@ -102,36 +87,14 @@ __atan (double x)=0A= yy =3D d3.d + v * yy;=0A= yy *=3D x * v;=0A= =0A= - if ((y =3D x + (yy - U1 * x)) =3D=3D x + (yy + U1 * x))=0A= - return y;=0A= -=0A= - EMULV (x, x, v, vv); /* v+vv=3Dx^2 */=0A= -=0A= - s1 =3D f17.d + v * f19.d;=0A= - s1 =3D f15.d + v * s1;=0A= - s1 =3D f13.d + v * s1;=0A= - s1 =3D f11.d + v * s1;=0A= - s1 *=3D v;=0A= -=0A= - ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f5.d, ff5.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f3.d, ff3.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - MUL2 (x, 0, s1, ss1, s2, ss2, t1, t2);=0A= - ADD2 (x, 0, s2, ss2, s1, ss1, t1, t2);=0A= - if ((y =3D s1 + (ss1 - U5 * s1)) =3D=3D s1 + (ss1 + U5 * s1))=0A= - return y;=0A= -=0A= - return atanMp (x, pr);=0A= + y =3D x + yy;=0A= + /* Max ULP is 0.511. */=0A= + return y;=0A= }=0A= }=0A= else=0A= { /* B <=3D u < C */=0A= - i =3D (TWO52 + TWO8 * u) - TWO52;=0A= + i =3D (TWO52 + 256 * u) - TWO52;=0A= i -=3D 16;=0A= z =3D u - cij[i][0].d;=0A= yy =3D cij[i][5].d + z * cij[i][6].d;=0A= @@ -141,44 +104,9 @@ __atan (double x)=0A= yy *=3D z;=0A= =0A= t1 =3D cij[i][1].d;=0A= - if (i < 112)=0A= - {=0A= - if (i < 48)=0A= - u2 =3D U21; /* u < 1/4 */=0A= - else=0A= - u2 =3D U22;=0A= - } /* 1/4 <=3D u < 1/2 */=0A= - else=0A= - {=0A= - if (i < 176)=0A= - u2 =3D U23; /* 1/2 <=3D u < 3/4 */=0A= - else=0A= - u2 =3D U24;=0A= - } /* 3/4 <=3D u <=3D 1 */=0A= - if ((y =3D t1 + (yy - u2 * t1)) =3D=3D t1 + (yy + u2 * t1))=0A= - return __signArctan (x, y);=0A= -=0A= - z =3D u - hij[i][0].d;=0A= -=0A= - s1 =3D hij[i][14].d + z * hij[i][15].d;=0A= - s1 =3D hij[i][13].d + z * s1;=0A= - s1 =3D hij[i][12].d + z * s1;=0A= - s1 =3D hij[i][11].d + z * s1;=0A= - s1 *=3D z;=0A= -=0A= - ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2);=0A= - MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][5].d, hij[i][6].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][3].d, hij[i][4].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][1].d, hij[i][2].d, s1, ss1, s2, ss2, t1, t2);=0A= - if ((y =3D s2 + (ss2 - U6 * s2)) =3D=3D s2 + (ss2 + U6 * s2))=0A= - return __signArctan (x, y);=0A= -=0A= - return atanMp (x, pr);=0A= + y =3D t1 + yy;=0A= + /* Max ULP is 0.56. */=0A= + return __signArctan (x, y);=0A= }=0A= }=0A= else=0A= @@ -188,7 +116,7 @@ __atan (double x)=0A= w =3D 1 / u;=0A= EMULV (w, u, t1, t2);=0A= ww =3D w * ((1 - t1) - t2);=0A= - i =3D (TWO52 + TWO8 * w) - TWO52;=0A= + i =3D (TWO52 + 256 * w) - TWO52;=0A= i -=3D 16;=0A= z =3D (w - cij[i][0].d) + ww;=0A= =0A= @@ -199,37 +127,9 @@ __atan (double x)=0A= yy =3D HPI1 - z * yy;=0A= =0A= t1 =3D HPI - cij[i][1].d;=0A= - if (i < 112)=0A= - u3 =3D U31; /* w < 1/2 */=0A= - else=0A= - u3 =3D U32; /* w >=3D 1/2 */=0A= - if ((y =3D t1 + (yy - u3)) =3D=3D t1 + (yy + u3))=0A= - return __signArctan (x, y);=0A= -=0A= - DIV2 (1, 0, u, 0, w, ww, t1, t2, t3, t4);=0A= - t1 =3D w - hij[i][0].d;=0A= - EADD (t1, ww, z, zz);=0A= -=0A= - s1 =3D hij[i][14].d + z * hij[i][15].d;=0A= - s1 =3D hij[i][13].d + z * s1;=0A= - s1 =3D hij[i][12].d + z * s1;=0A= - s1 =3D hij[i][11].d + z * s1;=0A= - s1 *=3D z;=0A= -=0A= - ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2);=0A= - MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][5].d, hij[i][6].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][3].d, hij[i][4].d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (hij[i][1].d, hij[i][2].d, s1, ss1, s2, ss2, t1, t2);=0A= - SUB2 (HPI, HPI1, s2, ss2, s1, ss1, t1, t2);=0A= - if ((y =3D s1 + (ss1 - U7)) =3D=3D s1 + (ss1 + U7))=0A= - return __signArctan (x, y);=0A= -=0A= - return atanMp (x, pr);=0A= + y =3D t1 + yy;=0A= + /* Max ULP is 0.503. */=0A= + return __signArctan (x, y);=0A= }=0A= else=0A= {=0A= @@ -249,34 +149,9 @@ __atan (double x)=0A= ww =3D w * ((1 - t1) - t2);=0A= ESUB (HPI, w, t3, cor);=0A= yy =3D ((HPI1 + cor) - ww) - yy;=0A= - if ((y =3D t3 + (yy - U4)) =3D=3D t3 + (yy + U4))=0A= - return __signArctan (x, y);=0A= -=0A= - DIV2 (1, 0, u, 0, w, ww, t1, t2, t3, t4);=0A= - MUL2 (w, ww, w, ww, v, vv, t1, t2);=0A= -=0A= - s1 =3D f17.d + v * f19.d;=0A= - s1 =3D f15.d + v * s1;=0A= - s1 =3D f13.d + v * s1;=0A= - s1 =3D f11.d + v * s1;=0A= - s1 *=3D v;=0A= -=0A= - ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f5.d, ff5.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - ADD2 (f3.d, ff3.d, s1, ss1, s2, ss2, t1, t2);=0A= - MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2);=0A= - MUL2 (w, ww, s1, ss1, s2, ss2, t1, t2);=0A= - ADD2 (w, ww, s2, ss2, s1, ss1, t1, t2);=0A= - SUB2 (HPI, HPI1, s1, ss1, s2, ss2, t1, t2);=0A= -=0A= - if ((y =3D s2 + (ss2 - U8)) =3D=3D s2 + (ss2 + U8))=0A= - return __signArctan (x, y);=0A= -=0A= - return atanMp (x, pr);=0A= + y =3D t3 + yy;=0A= + /* Max ULP is 0.5003. */=0A= + return __signArctan (x, y);=0A= }=0A= else=0A= {=0A= @@ -290,35 +165,6 @@ __atan (double x)=0A= }=0A= }=0A= =0A= - /* Final stages. Compute atan(x) by multiple precision arithmetic */=0A= -static double=0A= -atanMp (double x, const int pr[])=0A= -{=0A= - mp_no mpx, mpy, mpy2, mperr, mpt1, mpy1;=0A= - double y1, y2;=0A= - int i, p;=0A= -=0A= - for (i =3D 0; i < M; i++)=0A= - {=0A= - p =3D pr[i];=0A= - __dbl_mp (x, &mpx, p);=0A= - __mpatan (&mpx, &mpy, p);=0A= - __dbl_mp (u9[i].d, &mpt1, p);=0A= - __mul (&mpy, &mpt1, &mperr, p);=0A= - __add (&mpy, &mperr, &mpy1, p);=0A= - __sub (&mpy, &mperr, &mpy2, p);=0A= - __mp_dbl (&mpy1, &y1, p);=0A= - __mp_dbl (&mpy2, &y2, p);=0A= - if (y1 =3D=3D y2)=0A= - {=0A= - LIBC_PROBE (slowatan, 3, &p, &x, &y1);=0A= - return y1;=0A= - }=0A= - }=0A= - LIBC_PROBE (slowatan_inexact, 3, &p, &x, &y1);=0A= - return y1; /*if impossible to do exact computing */=0A= -}=0A= -=0A= #ifndef __atan=0A= libm_alias_double (__atan, atan)=0A= #endif=0A= diff --git a/sysdeps/ieee754/dbl-64/uatan.tbl b/sysdeps/ieee754/dbl-64/uata= n.tbl=0A= index 9730d576d6562e7a56d6f6f59e9943ec9e8a5343..3db2804cc2833ba94ebf428ea88= 1c4ab5e833e4c 100644=0A= --- a/sysdeps/ieee754/dbl-64/uatan.tbl=0A= +++ b/sysdeps/ieee754/dbl-64/uatan.tbl=0A= @@ -25,7 +25,7 @@=0A= =0A= #ifdef BIG_ENDI=0A= =0A= - static const number=0A= + static const mynumber=0A= cij[241][7] =3D { /* x0,cij for (1/16,1)= */=0A= /**/ {{{0X3FB04006, 0X65E0244E} },=0A= /**/ {{0X3FB03A73, 0X7B53DD20} },=0A= @@ -1716,7 +1716,7 @@=0A= /**/ {{0XBF99B9A7, 0X18A3BA58} } },=0A= };=0A= =0A= - static const number=0A= + static const mynumber=0A= hij[241][16] =3D { /* x0,hij for (1/16,1)= */=0A= /**/ {{{0x3fb04000, 0x00000000} },=0A= /**/ {{0x3fb03a6d, 0x1c06693d} },=0A= @@ -5579,7 +5579,7 @@=0A= #else=0A= #ifdef LITTLE_ENDI=0A= =0A= - static const number=0A= + static const mynumber=0A= cij[241][7] =3D { /* x0,cij for (1/16,1)= */=0A= /**/ {{{0X65E0244E, 0X3FB04006} },=0A= /**/ {{0X7B53DD20, 0X3FB03A73} },=0A= @@ -7270,7 +7270,7 @@=0A= /**/ {{0X18A3BA58, 0XBF99B9A7} } },=0A= };=0A= =0A= - static const number=0A= + static const mynumber=0A= hij[241][16] =3D { /* x0,hij for (1/16,1)= */=0A= /**/ {{{0x00000000, 0x3fb04000} },=0A= /**/ {{0x1c06693d, 0x3fb03a6d} },=0A= =0A= =0A=