\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}\right)\right)\right)\right)double f(double re, double im) {
double r39892 = im;
double r39893 = re;
double r39894 = atan2(r39892, r39893);
double r39895 = 10.0;
double r39896 = log(r39895);
double r39897 = r39894 / r39896;
return r39897;
}
double f(double re, double im) {
double r39898 = 1.0;
double r39899 = 10.0;
double r39900 = log(r39899);
double r39901 = r39898 / r39900;
double r39902 = sqrt(r39901);
double r39903 = im;
double r39904 = re;
double r39905 = atan2(r39903, r39904);
double r39906 = r39902 * r39905;
double r39907 = sqrt(r39900);
double r39908 = r39906 / r39907;
double r39909 = expm1(r39908);
double r39910 = expm1(r39909);
double r39911 = log1p(r39910);
double r39912 = log1p(r39911);
return r39912;
}



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 log1p-expm1-u0.7
Simplified0.7
rmApplied log1p-expm1-u0.4
Simplified0.5
Final simplification0.5
herbie shell --seed 2019179 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
(/ (atan2 im re) (log 10.0)))