From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109965 invoked by alias); 8 Aug 2018 18:57:51 -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 109924 invoked by uid 89); 8 Aug 2018 18:57:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:f1-v6mr, H*F:D*br X-HELO: mail-oi0-f65.google.com Received: from mail-oi0-f65.google.com (HELO mail-oi0-f65.google.com) (209.85.218.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 18:57:46 +0000 Received: by mail-oi0-f65.google.com with SMTP id s198-v6so5532093oih.11 for ; Wed, 08 Aug 2018 11:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9UaJWTdaV9lfqFPD6UxaAMlnujNFgbmLdp8vo+FTCbY=; b=MZfRTg/CqKqurraKIhqa0hZYLDKP72FOwKbsWz/NDU+zGzaEZYYeaN6y2dEDclW/aB 5V6yHg2U0irHiiTM2aImYnYvtipeL3dLyjfgvjDo7GoFNMQeclIHj5ufBBdN/VcC/fJv rwIEP+jSZ0DG6EVdcnCC5J1kROWRtBu8DDnB0WT2T/F1auMRqjkuCdZ1erdSgqkXWZYG A7/b+iX0tUhR/wNAyefg9P2BNUo8xDFukdZN8vhDuRE7LZzAE+mOvUu9tfBY0pgt8w7V 00J1oRYfycSRZ98kHBoVga+0l/uZ05eKgUOxcHQ6EUnA3sPkp8/0LCH52wnuV0EGncq7 iFYA== MIME-Version: 1.0 Received: by 2002:a4a:b08b:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 11:57:44 -0700 (PDT) In-Reply-To: <7AC47F39-364E-4D7D-BC01-690761CA2F09@comcast.net> References: <889F7D7D-EA25-448B-87C4-8F7690EF8DA6@comcast.net> <7AC47F39-364E-4D7D-BC01-690761CA2F09@comcast.net> From: Giuliano Augusto Faulin Belinassi Date: Wed, 08 Aug 2018 18:57:00 -0000 Message-ID: Subject: Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules To: Paul Koning Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00595.txt.bz2 Sorry about that. In the e-mail text field I wrote sinh(tanh(x)) and cosh(tanh(x)) where it was supposed to be sinh(atanh(x)) and cosh(atanh(x)), thus I am talking about the inverse hyperbolic tangent function. The patch code and comments are still correct. On Wed, Aug 8, 2018 at 10:58 AM, Paul Koning wrote: > Now I'm puzzled. > > I don't see how an infinite would show up in the original expression. I don't know hyperbolic functions, so I just constructed a small test program, and the original vs. the substitution you mention are not at all similar. > > paul > > >> On Aug 7, 2018, at 4:42 PM, Giuliano Augusto Faulin Belinassi wrote: >> >> That is a good question because I didn't know that such targets >> exists. Any suggestion? >> >> >> On Tue, Aug 7, 2018 at 5:29 PM, Paul Koning wrote: >>> >>> >>>> On Aug 7, 2018, at 4:00 PM, Giuliano Augusto Faulin Belinassi wrote: >>>> >>>> Related with bug 86829, but for hyperbolic trigonometric functions. >>>> This patch adds substitution rules to both sinh(tanh(x)) -> x / sqrt(1 >>>> - x*x) and cosh(tanh(x)) -> 1 / sqrt(1 - x*x). Notice that the both >>>> formulas has division by 0, but it causes no harm because 1/(+0) -> >>>> +infinity, thus the math is still safe. >>> >>> What about non-IEEE targets that don't have "infinite" in their float representation? >>> >>> paul >>> >>> >