\log \left(\sqrt{re \cdot re + im \cdot im}\right)\log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right)double code(double re, double im) {
return log(sqrt(((re * re) + (im * im))));
}
double code(double re, double im) {
return log((1.0 * hypot(re, im)));
}



Bits error versus re



Bits error versus im
Results
Initial program 32.1
rmApplied *-un-lft-identity32.1
Applied sqrt-prod32.1
Simplified32.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2020078 +o rules:numerics
(FPCore (re im)
:name "math.log/1 on complex, real part"
:precision binary64
(log (sqrt (+ (* re re) (* im im)))))