\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\frac{1}{\sqrt{\log 10}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\sqrt{\log 10}}\right)double code(double re, double im) {
return (atan2(im, re) / log(10.0));
}
double code(double re, double im) {
return ((1.0 / sqrt(log(10.0))) * (atan2(im, re) * (1.0 / sqrt(log(10.0)))));
}



Bits error versus re



Bits error versus im
Results
Initial program 0.9
rmApplied add-sqr-sqrt0.9
Applied *-un-lft-identity0.9
Applied times-frac0.8
rmApplied div-inv0.8
Final simplification0.8
herbie shell --seed 2020100
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10)))