This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules
- From: Jeff Law <law at redhat dot com>
- To: Giuliano Augusto Faulin Belinassi <giuliano dot belinassi at usp dot br>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Oct 2018 22:09:25 -0600
- Subject: Re: [PATCH] Add sinh(tanh(x)) and cosh(tanh(x)) rules
- References: <CAEFO=4C+BLJYGHNwuCbjdeY2Xj5KJkBeRRCKmSxqTUqwVokkag@mail.gmail.com>
On 8/7/18 2: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.
>
> Changelog:
> 2018-08-07 Giuliano Belinassi <giuliano.belinassi@usp.br>
>
> * match.pd: add simplification rules to sinh(atanh(x)) and cosh(atanh(x)).
>
> All tests added by this patch runs without errors in trunk, however,
> there are tests unrelated with this patch that fails in my x86_64
> Ubuntu 18.04.
I think these are going to need similar handling because the x*x can
overflow. Are the domains constrained in a way that is helpful?
jeff