\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;im \le -5.252223443509709 \cdot 10^{+144}:\\
\;\;\;\;\frac{\log \left(\frac{-1}{im}\right)}{\log 10} \cdot -1\\
\mathbf{elif}\;im \le -1.4780679115634563 \cdot 10^{-120}:\\
\;\;\;\;\left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \log \left(im \cdot im + re \cdot re\right)\right) \cdot \left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{elif}\;im \le -1.8298455091974634 \cdot 10^{-246}:\\
\;\;\;\;\left(\left(2 \cdot \log re\right) \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right) \cdot \left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{elif}\;im \le 2.264720310277972 \cdot 10^{+61}:\\
\;\;\;\;\left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \log \left(im \cdot im + re \cdot re\right)\right) \cdot \left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right) \cdot \left(\left(2 \cdot \log im\right) \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\end{array}double f(double re, double im) {
double r1276686 = re;
double r1276687 = r1276686 * r1276686;
double r1276688 = im;
double r1276689 = r1276688 * r1276688;
double r1276690 = r1276687 + r1276689;
double r1276691 = sqrt(r1276690);
double r1276692 = log(r1276691);
double r1276693 = 10.0;
double r1276694 = log(r1276693);
double r1276695 = r1276692 / r1276694;
return r1276695;
}
double f(double re, double im) {
double r1276696 = im;
double r1276697 = -5.252223443509709e+144;
bool r1276698 = r1276696 <= r1276697;
double r1276699 = -1.0;
double r1276700 = r1276699 / r1276696;
double r1276701 = log(r1276700);
double r1276702 = 10.0;
double r1276703 = log(r1276702);
double r1276704 = r1276701 / r1276703;
double r1276705 = r1276704 * r1276699;
double r1276706 = -1.4780679115634563e-120;
bool r1276707 = r1276696 <= r1276706;
double r1276708 = 0.5;
double r1276709 = cbrt(r1276708);
double r1276710 = cbrt(r1276703);
double r1276711 = r1276709 / r1276710;
double r1276712 = r1276696 * r1276696;
double r1276713 = re;
double r1276714 = r1276713 * r1276713;
double r1276715 = r1276712 + r1276714;
double r1276716 = log(r1276715);
double r1276717 = r1276711 * r1276716;
double r1276718 = r1276711 * r1276711;
double r1276719 = r1276717 * r1276718;
double r1276720 = -1.8298455091974634e-246;
bool r1276721 = r1276696 <= r1276720;
double r1276722 = 2.0;
double r1276723 = log(r1276713);
double r1276724 = r1276722 * r1276723;
double r1276725 = r1276724 * r1276711;
double r1276726 = r1276725 * r1276718;
double r1276727 = 2.264720310277972e+61;
bool r1276728 = r1276696 <= r1276727;
double r1276729 = log(r1276696);
double r1276730 = r1276722 * r1276729;
double r1276731 = r1276730 * r1276711;
double r1276732 = r1276718 * r1276731;
double r1276733 = r1276728 ? r1276719 : r1276732;
double r1276734 = r1276721 ? r1276726 : r1276733;
double r1276735 = r1276707 ? r1276719 : r1276734;
double r1276736 = r1276698 ? r1276705 : r1276735;
return r1276736;
}



Bits error versus re



Bits error versus im
Results
if im < -5.252223443509709e+144Initial program 59.5
rmApplied pow1/259.5
Applied log-pow59.5
Applied associate-/l*59.5
rmApplied +-commutative59.5
Taylor expanded around -inf 6.9
if -5.252223443509709e+144 < im < -1.4780679115634563e-120 or -1.8298455091974634e-246 < im < 2.264720310277972e+61Initial program 19.6
rmApplied pow1/219.6
Applied log-pow19.6
Applied associate-/l*19.7
rmApplied pow119.7
Applied log-pow19.7
Applied add-cube-cbrt20.2
Applied times-frac20.2
Applied add-cube-cbrt19.6
Applied times-frac19.5
Simplified19.5
Simplified19.5
if -1.4780679115634563e-120 < im < -1.8298455091974634e-246Initial program 25.3
rmApplied pow1/225.3
Applied log-pow25.3
Applied associate-/l*25.4
rmApplied pow125.4
Applied log-pow25.4
Applied add-cube-cbrt25.9
Applied times-frac25.8
Applied add-cube-cbrt25.3
Applied times-frac25.2
Simplified25.2
Simplified25.2
Taylor expanded around inf 37.5
Simplified37.5
if 2.264720310277972e+61 < im Initial program 44.4
rmApplied pow1/244.4
Applied log-pow44.4
Applied associate-/l*44.4
rmApplied pow144.4
Applied log-pow44.4
Applied add-cube-cbrt44.6
Applied times-frac44.6
Applied add-cube-cbrt44.4
Applied times-frac44.4
Simplified44.4
Simplified44.3
Taylor expanded around 0 10.1
Final simplification17.9
herbie shell --seed 2019158
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))