<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76549>76549</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang is suboptimal for `log(pow(x, y))` with fast-math
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Test case:
https://godbolt.org/z/1fvYPxY37
```c
#include<math.h>
double test1(double x) {
return log(pow(x, -3));
}
double test2(double x) {
return -3 * log(x);
}
```
My expectation is that the output of `test1` will be the same as `test2`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEks2OnDoQhZ-m2FggU-Z3wWJm-rK7UhbZzNLGbnBi2giXp7vz9BE0rUSJRpFKoFIdndLnOjIEO16M6aB8hfKUyEiTX7vvqVxXfw2J8vrefTWB2CCDAfEC_AT8ZSJawtZhD9iPXivvKPPrCNj_AOzz88f7l9u7qB9yqPijhqNHYS-Di9qAeJslTdkE4r9jtn-1j8oZRiZQDtgc7Q2wZVC_soeIsdVQXC_M-RGwWfwVsLkBvrFUALZbiacW6tMn_vhv_1QwwJdjze0T3yfj72v-vzNzW8xAkqy_MBsYTZIYTYb5SEsk5s8MKv7grDi7WueYMrsiyNkwGZ5zhIpnie6EbkUrE9PlNRdNXmFeJlPHRa5U2aKqULdNIatBVlLwAhW2iFgktkOOIkdsOeZVWWa6MTUaLSSKttFaQsHNLK3LnPuYt1smNoRouroqizZxUhkX9pggDk5eRkDcErN2mz5VcQxQcGcDhV8OZMmZbpdv8CEqv5CdpWNnv25gf13ufhxufwua2FkGSreIJHF13R-5szRFlQ1-Buy3nccvXVb_zQwE2O8IAbDfKX4GAAD__xCv3NQ">