\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\begin{array}{l}
\mathbf{if}\;\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \le -8.783854077383176606796760781421950863633 \cdot 10^{-38}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)\\
\end{array}double f(double re, double im) {
double r40091 = im;
double r40092 = re;
double r40093 = atan2(r40091, r40092);
double r40094 = 10.0;
double r40095 = log(r40094);
double r40096 = r40093 / r40095;
return r40096;
}
double f(double re, double im) {
double r40097 = im;
double r40098 = re;
double r40099 = atan2(r40097, r40098);
double r40100 = 10.0;
double r40101 = log(r40100);
double r40102 = r40099 / r40101;
double r40103 = -8.783854077383177e-38;
bool r40104 = r40102 <= r40103;
double r40105 = 3.0;
double r40106 = pow(r40102, r40105);
double r40107 = cbrt(r40106);
double r40108 = log1p(r40102);
double r40109 = expm1(r40108);
double r40110 = r40104 ? r40107 : r40109;
return r40110;
}



Bits error versus re



Bits error versus im
Results
if (/ (atan2 im re) (log 10.0)) < -8.783854077383177e-38Initial program 1.0
rmApplied add-cbrt-cube1.6
Applied add-cbrt-cube1.0
Applied cbrt-undiv0.7
Simplified0.1
if -8.783854077383177e-38 < (/ (atan2 im re) (log 10.0)) Initial program 0.8
rmApplied add-sqr-sqrt0.8
Applied *-un-lft-identity0.8
Applied times-frac0.8
rmApplied expm1-log1p-u0.8
Simplified0.8
Final simplification0.5
herbie shell --seed 2019208 +o rules:numerics
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10)))