\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\frac{\log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\left(\log base \cdot \left(2 \cdot \log \left(\sqrt[3]{base}\right)\right) + \log base \cdot \log \left(\sqrt[3]{base}\right)\right) + 0.0 \cdot 0.0}double code(double re, double im, double base) {
return (((log(sqrt(((re * re) + (im * im)))) * log(base)) + (atan2(im, re) * 0.0)) / ((log(base) * log(base)) + (0.0 * 0.0)));
}
double code(double re, double im, double base) {
return (((log((1.0 * hypot(re, im))) * log(base)) + (atan2(im, re) * 0.0)) / (((log(base) * (2.0 * log(cbrt(base)))) + (log(base) * log(cbrt(base)))) + (0.0 * 0.0)));
}



Bits error versus re



Bits error versus im



Bits error versus base
Results
Initial program 32.2
rmApplied *-un-lft-identity32.2
Applied sqrt-prod32.2
Simplified32.2
Simplified0.5
rmApplied add-cube-cbrt0.5
Applied log-prod0.5
Applied distribute-lft-in0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020053 +o rules:numerics
(FPCore (re im base)
:name "math.log/2 on complex, real part"
:precision binary64
(/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))