[PATCH] Add simplification rule tanh (x) * cosh (x) -> sinh (x)
Jeff Law
law@redhat.com
Tue Apr 30 14:20:00 GMT 2019
On 4/30/19 8:00 AM, Jakub Jelinek wrote:
> On Tue, Apr 30, 2019 at 07:57:20AM -0600, Jeff Law wrote:
>>> Just curious, do we want to add math identities like above to match.pd ?
>> I'd think so.
>>
>>
>>> In practice, I am not sure how often we'd see "tanh * cosh" instead
>>> of sinh directly in source,
>> We're often surprised when what ultimately shows up in sources :-) And
>> a transformation that allows us to turn two transcendentals and a
>> multiplication into a single transcendental is going to be a big win.
>
> I guess an important question is if such transformations need to be guarded
> by some -ffast-math suboptions, whether those transformations work properly
> for signed zeros, NaNs, sNaNs, infinities, guarantee the same ulp, have the
> same -ferrno-math behavior etc.
Yes. If you look at the discussion with Gualiano for the first set in
this space that was the hardest part. And for Barbara's we know there's
at least one issue in this space as well -- in particular it looks like
the long double handling is incorrect in the sign bit for very small
inputs. The question is precisely where that's gone wrong :-)
jeff
More information about the Gcc-patches
mailing list