\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{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(\log base, 0.0\right) \cdot 1}}{\sqrt{\log base \cdot \log base + 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 ((fma(log(hypot(re, im)), log(base), (atan2(im, re) * 0.0)) / (hypot(log(base), 0.0) * 1.0)) / sqrt(((log(base) * log(base)) + (0.0 * 0.0))));
}



Bits error versus re



Bits error versus im



Bits error versus base
Results
Initial program 32.4
rmApplied hypot-def0.5
rmApplied add-sqr-sqrt0.5
Applied associate-/r*0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020066 +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))))