\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 f(double re, double im) {
double r1382563 = im;
double r1382564 = re;
double r1382565 = atan2(r1382563, r1382564);
double r1382566 = 10.0;
double r1382567 = log(r1382566);
double r1382568 = r1382565 / r1382567;
return r1382568;
}
double f(double re, double im) {
double r1382569 = im;
double r1382570 = re;
double r1382571 = atan2(r1382569, r1382570);
double r1382572 = 10.0;
double r1382573 = log(r1382572);
double r1382574 = r1382571 / r1382573;
double r1382575 = expm1(r1382574);
double r1382576 = log1p(r1382575);
return r1382576;
}



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
rmApplied div-inv0.8
Applied associate-*r*0.8
rmApplied log1p-expm1-u0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2019200 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
(/ (atan2 im re) (log 10.0)))