[PATCH] Simplify sinh (x) / cosh (x)
Mon Apr 29 21:23:00 GMT 2019
On 1/22/19 12:31 PM, Rafael Tsuha wrote:
> This patch simplifies the expression sinh (x) / cosh (x) to tanh (x).
> This rule is mathematically valid.
> There's a slight difference in the result when applying this
> optimization with x in the interval 0 < x <= 1e-4951. With the
> optimization, the result using long double is -0 and without the
> optimization, the result is +0.
That's an indication something has gone wrong.
If I'm reading this correctly it sounds like tanh in that range is
returning -0? If so, that just seems like the wrong output from tanh
since IIUC for a positive input tanh will always have a positive output.
More information about the Gcc-patches