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



Bits error versus re



Bits error versus im



Bits error versus base
Results
Initial program 32.0
Taylor expanded around inf 0.3
rmApplied add-cube-cbrt0.3
Applied add-cube-cbrt0.3
Applied times-frac0.3
Applied log-prod0.4
Simplified0.4
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied cbrt-prod0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2020053
(FPCore (re im base)
:name "math.log/2 on complex, imaginary part"
:precision binary64
(/ (- (* (atan2 im re) (log base)) (* (log (sqrt (+ (* re re) (* im im)))) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))