Thanks. Ok, so the expressions you gave are undefined for x==1, which says
that substituting something that is also undefined for x==1 is permitted. You
can argue from "undefined" rather than relying on IEEE features like NaN or
infinite.
paul
> On Aug 8, 2018, at 2:57 PM, Giuliano Augusto Faulin Belinassi
> <[email protected]> wrote:
>
> 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 <[email protected]> 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
>>> <[email protected]> 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 <[email protected]> wrote:
>>>>
>>>>
>>>>> On Aug 7, 2018, at 4:00 PM, Giuliano Augusto Faulin Belinassi
>>>>> <[email protected]> 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
>>>>
>>>>
>>