\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -2.111326592735039579788335414834132413433 \cdot 10^{117}:\\
\;\;\;\;\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 5.246446846048960229429099302337261201176 \cdot 10^{-199}:\\
\;\;\;\;\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 1.178720592182588159154577176110759415934 \cdot 10^{-172}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({re}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 9.769663399544422990952065102026170637802 \cdot 10^{95}:\\
\;\;\;\;\frac{\left(2 \cdot \log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\right) \cdot 1}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt[3]{\sqrt{\log 10}} \cdot \sqrt[3]{\sqrt{\log 10}}}\right)}\right)}^{\left(\frac{1}{\sqrt[3]{\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 r44701 = re;
double r44702 = r44701 * r44701;
double r44703 = im;
double r44704 = r44703 * r44703;
double r44705 = r44702 + r44704;
double r44706 = sqrt(r44705);
double r44707 = log(r44706);
double r44708 = 10.0;
double r44709 = log(r44708);
double r44710 = r44707 / r44709;
return r44710;
}
double f(double re, double im) {
double r44711 = re;
double r44712 = -2.1113265927350396e+117;
bool r44713 = r44711 <= r44712;
double r44714 = 1.0;
double r44715 = 10.0;
double r44716 = log(r44715);
double r44717 = sqrt(r44716);
double r44718 = r44714 / r44717;
double r44719 = -1.0;
double r44720 = r44719 * r44711;
double r44721 = pow(r44720, r44718);
double r44722 = log(r44721);
double r44723 = r44718 * r44722;
double r44724 = 5.24644684604896e-199;
bool r44725 = r44711 <= r44724;
double r44726 = r44711 * r44711;
double r44727 = im;
double r44728 = r44727 * r44727;
double r44729 = r44726 + r44728;
double r44730 = sqrt(r44729);
double r44731 = pow(r44730, r44718);
double r44732 = log(r44731);
double r44733 = r44718 * r44732;
double r44734 = 1.1787205921825882e-172;
bool r44735 = r44711 <= r44734;
double r44736 = pow(r44711, r44718);
double r44737 = log(r44736);
double r44738 = r44718 * r44737;
double r44739 = 9.769663399544423e+95;
bool r44740 = r44711 <= r44739;
double r44741 = 2.0;
double r44742 = cbrt(r44731);
double r44743 = log(r44742);
double r44744 = r44741 * r44743;
double r44745 = r44744 * r44714;
double r44746 = r44745 / r44717;
double r44747 = cbrt(r44717);
double r44748 = r44747 * r44747;
double r44749 = r44714 / r44748;
double r44750 = pow(r44730, r44749);
double r44751 = r44714 / r44747;
double r44752 = pow(r44750, r44751);
double r44753 = cbrt(r44752);
double r44754 = log(r44753);
double r44755 = r44718 * r44754;
double r44756 = r44746 + r44755;
double r44757 = r44740 ? r44756 : r44738;
double r44758 = r44735 ? r44738 : r44757;
double r44759 = r44725 ? r44733 : r44758;
double r44760 = r44713 ? r44723 : r44759;
return r44760;
}



Bits error versus re



Bits error versus im
Results
if re < -2.1113265927350396e+117Initial program 54.6
rmApplied add-sqr-sqrt54.6
Applied pow154.6
Applied log-pow54.6
Applied times-frac54.6
rmApplied add-log-exp54.6
Simplified54.6
Taylor expanded around -inf 8.9
if -2.1113265927350396e+117 < re < 5.24644684604896e-199Initial program 24.3
rmApplied add-sqr-sqrt24.3
Applied pow124.3
Applied log-pow24.3
Applied times-frac24.3
rmApplied add-log-exp24.3
Simplified24.1
if 5.24644684604896e-199 < re < 1.1787205921825882e-172 or 9.769663399544423e+95 < re Initial program 48.8
rmApplied add-sqr-sqrt48.8
Applied pow148.8
Applied log-pow48.8
Applied times-frac48.8
rmApplied add-log-exp48.8
Simplified48.7
Taylor expanded around inf 13.7
if 1.1787205921825882e-172 < re < 9.769663399544423e+95Initial program 17.4
rmApplied add-sqr-sqrt17.4
Applied pow117.4
Applied log-pow17.4
Applied times-frac17.4
rmApplied add-log-exp17.4
Simplified17.2
rmApplied add-cube-cbrt17.2
Applied log-prod17.3
Applied distribute-lft-in17.3
Simplified17.3
rmApplied add-cube-cbrt17.3
Applied *-un-lft-identity17.3
Applied times-frac17.3
Applied pow-unpow17.3
Final simplification18.3
herbie shell --seed 2019298
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))