From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46121 invoked by alias); 8 Nov 2018 13:33:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 46108 invoked by uid 89); 8 Nov 2018 13:33:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:783 X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30084.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Nov 2018 13:33:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N3fgxbP2H2dFtJm0BKWrAVH06WKOreIJrkqdkWC0fQg=; b=eP50BMKc8bfC1Ykqs3O230byowwkwdbb78m6sTT6UYqHstrGbd2mxm1I4zV29jwkJ4jdSR5immlovcr05W5iz2ZHkF/m5TtdGz8rTE/1BOqgyCG68W064T9lXpR3J78LoC43bIBNeLO3W06Vj2ic0AKVB0CHJv4r69hqD7QO3TA= Received: from DB5PR08MB1030.eurprd08.prod.outlook.com (10.166.14.15) by DB5PR08MB0936.eurprd08.prod.outlook.com (10.166.13.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.32; Thu, 8 Nov 2018 13:33:20 +0000 Received: from DB5PR08MB1030.eurprd08.prod.outlook.com ([fe80::f5c9:8ef6:9b28:8caa]) by DB5PR08MB1030.eurprd08.prod.outlook.com ([fe80::f5c9:8ef6:9b28:8caa%2]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 13:33:20 +0000 From: Wilco Dijkstra To: Segher Boessenkool CC: Jeff Law , Richard Biener , Giuliano Augusto Faulin Belinassi , GCC Patches , "giuliano.belinassi@gmail.com" , nd Subject: Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules Date: Thu, 08 Nov 2018 13:33:00 -0000 Message-ID: References: <20181019134511.GA1712@gate.crashing.org> <5b717a08-f994-0de8-5092-d11f5d9f8bd0@redhat.com> ,<20181108014316.GQ5994@gate.crashing.org> In-Reply-To: <20181108014316.GQ5994@gate.crashing.org> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2018-11/txt/msg00566.txt.bz2 Hi, > But the max. error in sinh/cosh/atanh is less than 2 ULP, with some math > libraries.=A0 It could be < 1 ULP, in theory, so sinh(atanh(x)) less than > 2 ULP even. You can't add ULP errors in general - a tiny difference in the input can=20 make a huge difference in the result if the derivative is > 1.=20 Even with perfect implementations of 0.5000001ULP on easy functions with no large derivatives you could get a 2ULP total error if the perfectly roun= ded and actual result end up rounding in different directions in the 2nd functi= on... So you have to measure ULP error since it is quite counter intuitive. > And signed zeroes.=A0 Yeah.=A0 I think it would have to be > flag_unsafe_math_optimizations + some more. Indeed. Wilco =20=20=20=20