\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)\right)\right)double f(double re, double im) {
double r21186 = im;
double r21187 = re;
double r21188 = atan2(r21186, r21187);
double r21189 = 10.0;
double r21190 = log(r21189);
double r21191 = r21188 / r21190;
return r21191;
}
double f(double re, double im) {
double r21192 = im;
double r21193 = re;
double r21194 = atan2(r21192, r21193);
double r21195 = 1.0;
double r21196 = 10.0;
double r21197 = log(r21196);
double r21198 = r21195 / r21197;
double r21199 = sqrt(r21198);
double r21200 = sqrt(r21197);
double r21201 = r21199 / r21200;
double r21202 = r21194 * r21201;
double r21203 = expm1(r21202);
double r21204 = expm1(r21203);
double r21205 = log1p(r21204);
double r21206 = log1p(r21205);
return r21206;
}



Bits error versus re



Bits error versus im
Results
Initial program 0.9
rmApplied log1p-expm1-u0.7
rmApplied add-sqr-sqrt0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Taylor expanded around 0 0.7
rmApplied log1p-expm1-u0.5
Simplified0.4
Final simplification0.4
herbie shell --seed 2019195 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
(/ (atan2 im re) (log 10.0)))