\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)double f(double re, double im) {
double r39753 = im;
double r39754 = re;
double r39755 = atan2(r39753, r39754);
double r39756 = 10.0;
double r39757 = log(r39756);
double r39758 = r39755 / r39757;
return r39758;
}
double f(double re, double im) {
double r39759 = im;
double r39760 = re;
double r39761 = atan2(r39759, r39760);
double r39762 = 1.0;
double r39763 = 10.0;
double r39764 = log(r39763);
double r39765 = r39762 / r39764;
double r39766 = sqrt(r39765);
double r39767 = sqrt(r39764);
double r39768 = r39766 / r39767;
double r39769 = r39761 * r39768;
double r39770 = expm1(r39769);
double r39771 = log1p(r39770);
return r39771;
}



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