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



Bits error versus re



Bits error versus im



Bits error versus base
Results
Initial program 32.1
Simplified0.3
rmApplied div-inv_binary640.4
Final simplification0.4
herbie shell --seed 2020224
(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))))