\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\mathsf{log1p}\left(\mathsf{expm1}\left(1 \cdot \frac{\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)double f(double re, double im) {
double r28004 = im;
double r28005 = re;
double r28006 = atan2(r28004, r28005);
double r28007 = 10.0;
double r28008 = log(r28007);
double r28009 = r28006 / r28008;
return r28009;
}
double f(double re, double im) {
double r28010 = 1.0;
double r28011 = im;
double r28012 = re;
double r28013 = atan2(r28011, r28012);
double r28014 = 10.0;
double r28015 = log(r28014);
double r28016 = r28010 / r28015;
double r28017 = sqrt(r28016);
double r28018 = r28013 * r28017;
double r28019 = sqrt(r28015);
double r28020 = r28018 / r28019;
double r28021 = r28010 * r28020;
double r28022 = expm1(r28021);
double r28023 = log1p(r28022);
return r28023;
}



Bits error versus re



Bits error versus im
Results
Initial program 0.8
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 *-un-lft-identity0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Applied associate-*l*0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2019346 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10)))