Issue 173706
Summary Handle f(-x)=f(x) for cosh and f(-x)=-f(x) for sinh and tanh
Labels missed-optimization, floating-point
Assignees
Reporter k-arrows
    Consider the following:
https://godbolt.org/z/xWeWf8TxG
```c
#include <math.h>

double test_sin1(double x) { return -sin(-x); }
double test_sin2(double x) { return sin(x); }

double test_tan1(double x) { return -tan(-x); }
double test_tan2(double x) { return tan(x); }

double test_cos1(double x) { return cos(-x); }
double test_cos2(double x) { return cos(x); }

double test_sinh1(double x) { return -sinh(-x); }
double test_sinh2(double x) { return sinh(x); }

double test_tanh1(double x) { return -tanh(-x); }
double test_tanh2(double x) { return tanh(x); }

double test_cosh1(double x) { return cosh(-x); }
double test_cosh2(double x) { return cosh(x); }
```

With Clang, `test_sinh1`, `test_tanh1` and `test_cosh1` are not optimized.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to