You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using sin(x) and cos(x) the optimization for cos(x) / sin(x) -> 1/tan(x) is already implemented. This is not the case for the hyperbolic functions, maybe it would be good to also implement this behavior for sinh(x) and cos(x).
However this is not how gcc behaves, gcc calculates it like cosh(x) / sinh(x).
felixkellenbenz
changed the title
Simplify cosh(x) / sinh(x) -> 1/tanh(x) with fast math
Simplify cosh(x) / sinh(x) -> 1/tanh(x) with fast math
Jan 29, 2024
I am currently working on #78871. I could fix this issue too. Should I create separate pull request for this issue and #78871 or is it fine if I include a fix for both issues in one PR.
When using
sin(x)
andcos(x)
the optimization forcos(x) / sin(x) -> 1/tan(x)
is already implemented. This is not the case for the hyperbolic functions, maybe it would be good to also implement this behavior forsinh(x)
andcos(x)
.However this is not how
gcc
behaves,gcc
calculates it likecosh(x) / sinh(x)
.See here:
https://godbolt.org/z/vrMTP3h9x
The text was updated successfully, but these errors were encountered: