From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33158 invoked by alias); 9 Nov 2018 20:04:01 -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 33143 invoked by uid 89); 9 Nov 2018 20:04:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:985, 0.5000001ulp, derivative, 0.5000001ULP X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Nov 2018 20:04:00 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F690821CB; Fri, 9 Nov 2018 20:03:58 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-25.rdu2.redhat.com [10.10.112.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 467595D96E; Fri, 9 Nov 2018 20:03:56 +0000 (UTC) Subject: Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules To: Wilco Dijkstra , Segher Boessenkool Cc: Richard Biener , Giuliano Augusto Faulin Belinassi , GCC Patches , "giuliano.belinassi@gmail.com" , nd References: <20181019134511.GA1712@gate.crashing.org> <5b717a08-f994-0de8-5092-d11f5d9f8bd0@redhat.com> <20181108014316.GQ5994@gate.crashing.org> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <2f49ab2f-7290-9bc8-71d3-69f7fb52dfc4@redhat.com> Date: Fri, 09 Nov 2018 20:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00777.txt.bz2 On 11/8/18 6:33 AM, Wilco Dijkstra wrote: > Hi, > >> But the max. error in sinh/cosh/atanh is less than 2 ULP, with some math >> libraries.  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 > make a huge difference in the result if the derivative is > 1. > > Even with perfect implementations of 0.5000001ULP on easy functions with > no large derivatives you could get a 2ULP total error if the perfectly rounded > and actual result end up rounding in different directions in the 2nd function... > > So you have to measure ULP error since it is quite counter intuitive. > >> And signed zeroes.  Yeah.  I think it would have to be >> flag_unsafe_math_optimizations + some more. > > Indeed. So we need to give Giuliano some clear guidance on guarding. This is out of my area of expertise, so looking to y'all to help here. jeff