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



Bits error versus re



Bits error versus im
Results
Initial program 0.8
rmApplied log1p-expm1-u0.7
Final simplification0.7
herbie shell --seed 2020105 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10)))