On Thu, 17 Aug 2017, Wilco Dijkstra wrote: > This patch simplifies pow (C, x) into exp (x * C1) if C > 0, C1 = log (C).
Note this changes the outcome for C == +Inf, x == 0 (pow is specified to return 1.0 in that case, but x * C1 == NaN). There's another existing transform with the same issue, 'pow(expN(x), y) -> expN(x*y)', so this is not a new problem. The whole set of these match.pd transforms is guarded by flag_unsafe_math_optimizations, which is a bit strange, on the one hand it does not include -ffinite-math-only, but on the other hand it's defined broadly enough to imply that. (to be clear, I'm not objecting to the patch, just pointing out an existing inconsistency in case someone can offer clarifications) Alexander