\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -5.330091552844717472226479932066920744645 \cdot 10^{114}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\frac{-1}{re}\right)}^{\left(-\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le -4.215661627499373563855656419004671791113 \cdot 10^{-144}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 3.482912996481695209350075344359753892544 \cdot 10^{-250}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({im}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 6.50977017724907722738153182022955067076 \cdot 10^{55}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({re}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\end{array}double f(double re, double im) {
double r39105 = re;
double r39106 = r39105 * r39105;
double r39107 = im;
double r39108 = r39107 * r39107;
double r39109 = r39106 + r39108;
double r39110 = sqrt(r39109);
double r39111 = log(r39110);
double r39112 = 10.0;
double r39113 = log(r39112);
double r39114 = r39111 / r39113;
return r39114;
}
double f(double re, double im) {
double r39115 = re;
double r39116 = -5.330091552844717e+114;
bool r39117 = r39115 <= r39116;
double r39118 = 1.0;
double r39119 = 10.0;
double r39120 = log(r39119);
double r39121 = sqrt(r39120);
double r39122 = r39118 / r39121;
double r39123 = -1.0;
double r39124 = r39123 / r39115;
double r39125 = r39118 / r39120;
double r39126 = sqrt(r39125);
double r39127 = -r39126;
double r39128 = pow(r39124, r39127);
double r39129 = log(r39128);
double r39130 = r39122 * r39129;
double r39131 = -4.2156616274993736e-144;
bool r39132 = r39115 <= r39131;
double r39133 = r39115 * r39115;
double r39134 = im;
double r39135 = r39134 * r39134;
double r39136 = r39133 + r39135;
double r39137 = sqrt(r39136);
double r39138 = pow(r39137, r39122);
double r39139 = log(r39138);
double r39140 = r39122 * r39139;
double r39141 = 3.482912996481695e-250;
bool r39142 = r39115 <= r39141;
double r39143 = pow(r39134, r39122);
double r39144 = log(r39143);
double r39145 = r39122 * r39144;
double r39146 = 6.509770177249077e+55;
bool r39147 = r39115 <= r39146;
double r39148 = pow(r39115, r39122);
double r39149 = log(r39148);
double r39150 = r39122 * r39149;
double r39151 = r39147 ? r39140 : r39150;
double r39152 = r39142 ? r39145 : r39151;
double r39153 = r39132 ? r39140 : r39152;
double r39154 = r39117 ? r39130 : r39153;
return r39154;
}



Bits error versus re



Bits error versus im
Results
if re < -5.330091552844717e+114Initial program 54.3
rmApplied add-sqr-sqrt54.3
Applied pow154.3
Applied log-pow54.3
Applied times-frac54.3
rmApplied div-inv54.3
rmApplied add-log-exp54.3
Simplified54.3
Taylor expanded around -inf 7.7
Simplified7.6
if -5.330091552844717e+114 < re < -4.2156616274993736e-144 or 3.482912996481695e-250 < re < 6.509770177249077e+55Initial program 19.1
rmApplied add-sqr-sqrt19.1
Applied pow119.1
Applied log-pow19.1
Applied times-frac19.1
rmApplied div-inv19.0
rmApplied add-log-exp19.0
Simplified18.9
if -4.2156616274993736e-144 < re < 3.482912996481695e-250Initial program 31.3
rmApplied add-sqr-sqrt31.3
Applied pow131.3
Applied log-pow31.3
Applied times-frac31.2
rmApplied div-inv31.2
rmApplied add-log-exp31.2
Simplified31.1
Taylor expanded around 0 35.9
if 6.509770177249077e+55 < re Initial program 44.2
rmApplied add-sqr-sqrt44.2
Applied pow144.2
Applied log-pow44.2
Applied times-frac44.2
rmApplied div-inv44.2
rmApplied add-log-exp44.2
Simplified44.1
Taylor expanded around inf 11.3
Final simplification18.7
herbie shell --seed 2019325
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))