Currently, clang ignores the 0 initialisation in finite math
For example:
double f_prod = 0; double arr[1000]; for (size_t i = 0; i < 1000; i++) { f_prod *= arr[i]; }
Clang will ignore that f_prod is set to zero and it will generate assembly to iterate over the loop.
Could you add a comment explaining the transform we are applying here? Also, it would probably be good to move this more towards the end of the function, so cheaper patterns are tried first.