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



Bits error versus re



Bits error versus im
Results
Initial program 0.8
rmApplied add-sqr-sqrt0.8
Applied *-un-lft-identity0.8
Applied times-frac0.8
Taylor expanded around 0 0.8
rmApplied *-commutative0.8
Applied associate-*r*0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2020113
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10)))