\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -612731228641100030:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(-1 \cdot re\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 6.1273794464224312 \cdot 10^{97}:\\
\;\;\;\;\log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) \cdot \frac{2}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(2 \cdot \frac{1}{2 \cdot \left|\sqrt[3]{\log 10}\right|}\right)}\right)}^{\left(\frac{1}{\sqrt{\sqrt[3]{\log 10}}}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log re \cdot \sqrt{\frac{1}{\log 10}}\right)\\
\end{array}double f(double re, double im) {
double r54751 = re;
double r54752 = r54751 * r54751;
double r54753 = im;
double r54754 = r54753 * r54753;
double r54755 = r54752 + r54754;
double r54756 = sqrt(r54755);
double r54757 = log(r54756);
double r54758 = 10.0;
double r54759 = log(r54758);
double r54760 = r54757 / r54759;
return r54760;
}
double f(double re, double im) {
double r54761 = re;
double r54762 = -6.127312286411e+17;
bool r54763 = r54761 <= r54762;
double r54764 = 1.0;
double r54765 = 10.0;
double r54766 = log(r54765);
double r54767 = sqrt(r54766);
double r54768 = r54764 / r54767;
double r54769 = -1.0;
double r54770 = r54769 * r54761;
double r54771 = pow(r54770, r54768);
double r54772 = log(r54771);
double r54773 = r54768 * r54772;
double r54774 = 6.127379446422431e+97;
bool r54775 = r54761 <= r54774;
double r54776 = r54761 * r54761;
double r54777 = im;
double r54778 = r54777 * r54777;
double r54779 = r54776 + r54778;
double r54780 = sqrt(r54779);
double r54781 = pow(r54780, r54768);
double r54782 = cbrt(r54781);
double r54783 = log(r54782);
double r54784 = 2.0;
double r54785 = r54784 / r54767;
double r54786 = r54783 * r54785;
double r54787 = cbrt(r54766);
double r54788 = fabs(r54787);
double r54789 = r54784 * r54788;
double r54790 = r54764 / r54789;
double r54791 = r54784 * r54790;
double r54792 = pow(r54780, r54791);
double r54793 = sqrt(r54787);
double r54794 = r54764 / r54793;
double r54795 = pow(r54792, r54794);
double r54796 = cbrt(r54795);
double r54797 = log(r54796);
double r54798 = r54768 * r54797;
double r54799 = r54786 + r54798;
double r54800 = log(r54761);
double r54801 = r54764 / r54766;
double r54802 = sqrt(r54801);
double r54803 = r54800 * r54802;
double r54804 = r54768 * r54803;
double r54805 = r54775 ? r54799 : r54804;
double r54806 = r54763 ? r54773 : r54805;
return r54806;
}



Bits error versus re



Bits error versus im
Results
if re < -6.127312286411e+17Initial program 41.0
rmApplied add-sqr-sqrt41.0
Applied pow141.0
Applied log-pow41.0
Applied times-frac40.9
rmApplied add-log-exp40.9
Simplified40.8
Taylor expanded around -inf 13.3
if -6.127312286411e+17 < re < 6.127379446422431e+97Initial program 22.7
rmApplied add-sqr-sqrt22.7
Applied pow122.7
Applied log-pow22.7
Applied times-frac22.7
rmApplied add-log-exp22.7
Simplified22.5
rmApplied add-cube-cbrt22.5
Applied log-prod22.6
Applied distribute-lft-in22.6
Simplified22.6
rmApplied add-cube-cbrt22.7
Applied sqrt-prod22.7
Applied *-un-lft-identity22.7
Applied times-frac22.6
Applied pow-unpow22.6
Simplified22.6
if 6.127379446422431e+97 < re Initial program 52.5
rmApplied add-sqr-sqrt52.5
Applied pow152.5
Applied log-pow52.5
Applied times-frac52.5
rmApplied add-log-exp52.5
Simplified52.4
Taylor expanded around inf 9.2
Simplified9.2
Final simplification18.1
herbie shell --seed 2020060
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))