\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;im \le -3.494473208647424 \cdot 10^{+151}:\\
\;\;\;\;\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 \left(\frac{-1}{im}\right)\right) \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{elif}\;im \le -1.4780679115634563 \cdot 10^{-120}:\\
\;\;\;\;\frac{\frac{\log \left(im \cdot im + re \cdot re\right)}{\sqrt{\sqrt{\log 10}}} \cdot \sqrt{\frac{1}{2}}}{\frac{\sqrt{\log 10}}{\sqrt{\frac{1}{2}}} \cdot \sqrt{\sqrt{\log 10}}}\\
\mathbf{elif}\;im \le -6.847505130661582 \cdot 10^{-247}:\\
\;\;\;\;\left(\left(\log re \cdot 2\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 9.270740708287654 \cdot 10^{+63}:\\
\;\;\;\;\sqrt{\frac{1}{2}} \cdot \left(\frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}} \cdot \frac{\log \left(im \cdot im + re \cdot re\right)}{\sqrt{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{2}}{\sqrt{\log 10}} \cdot \left(2 \cdot \left(\log im \cdot \sqrt{\frac{1}{\log 10}}\right)\right)\\
\end{array}double f(double re, double im) {
double r1172734 = re;
double r1172735 = r1172734 * r1172734;
double r1172736 = im;
double r1172737 = r1172736 * r1172736;
double r1172738 = r1172735 + r1172737;
double r1172739 = sqrt(r1172738);
double r1172740 = log(r1172739);
double r1172741 = 10.0;
double r1172742 = log(r1172741);
double r1172743 = r1172740 / r1172742;
return r1172743;
}
double f(double re, double im) {
double r1172744 = im;
double r1172745 = -3.494473208647424e+151;
bool r1172746 = r1172744 <= r1172745;
double r1172747 = 0.5;
double r1172748 = cbrt(r1172747);
double r1172749 = 10.0;
double r1172750 = log(r1172749);
double r1172751 = cbrt(r1172750);
double r1172752 = r1172748 / r1172751;
double r1172753 = r1172752 * r1172752;
double r1172754 = -2.0;
double r1172755 = -1.0;
double r1172756 = r1172755 / r1172744;
double r1172757 = log(r1172756);
double r1172758 = r1172754 * r1172757;
double r1172759 = r1172758 * r1172752;
double r1172760 = r1172753 * r1172759;
double r1172761 = -1.4780679115634563e-120;
bool r1172762 = r1172744 <= r1172761;
double r1172763 = r1172744 * r1172744;
double r1172764 = re;
double r1172765 = r1172764 * r1172764;
double r1172766 = r1172763 + r1172765;
double r1172767 = log(r1172766);
double r1172768 = sqrt(r1172750);
double r1172769 = sqrt(r1172768);
double r1172770 = r1172767 / r1172769;
double r1172771 = sqrt(r1172747);
double r1172772 = r1172770 * r1172771;
double r1172773 = r1172768 / r1172771;
double r1172774 = r1172773 * r1172769;
double r1172775 = r1172772 / r1172774;
double r1172776 = -6.847505130661582e-247;
bool r1172777 = r1172744 <= r1172776;
double r1172778 = log(r1172764);
double r1172779 = 2.0;
double r1172780 = r1172778 * r1172779;
double r1172781 = r1172780 * r1172752;
double r1172782 = r1172781 * r1172753;
double r1172783 = 9.270740708287654e+63;
bool r1172784 = r1172744 <= r1172783;
double r1172785 = r1172771 / r1172768;
double r1172786 = r1172767 / r1172768;
double r1172787 = r1172785 * r1172786;
double r1172788 = r1172771 * r1172787;
double r1172789 = r1172747 / r1172768;
double r1172790 = log(r1172744);
double r1172791 = 1.0;
double r1172792 = r1172791 / r1172750;
double r1172793 = sqrt(r1172792);
double r1172794 = r1172790 * r1172793;
double r1172795 = r1172779 * r1172794;
double r1172796 = r1172789 * r1172795;
double r1172797 = r1172784 ? r1172788 : r1172796;
double r1172798 = r1172777 ? r1172782 : r1172797;
double r1172799 = r1172762 ? r1172775 : r1172798;
double r1172800 = r1172746 ? r1172760 : r1172799;
return r1172800;
}



Bits error versus re



Bits error versus im
Results
if im < -3.494473208647424e+151Initial program 61.4
rmApplied pow1/261.4
Applied log-pow61.4
Applied associate-/l*61.4
rmApplied pow161.4
Applied log-pow61.4
Applied add-cube-cbrt61.4
Applied times-frac61.4
Applied add-cube-cbrt61.4
Applied times-frac61.4
Simplified61.4
Simplified61.4
Taylor expanded around -inf 6.6
Simplified6.6
if -3.494473208647424e+151 < im < -1.4780679115634563e-120Initial program 15.7
rmApplied add-sqr-sqrt15.7
Applied pow1/215.7
Applied log-pow15.7
Applied times-frac15.6
rmApplied add-sqr-sqrt15.6
Applied sqrt-prod16.1
Applied associate-/r*16.2
Applied add-sqr-sqrt15.6
Applied associate-/l*15.6
Applied frac-times15.6
if -1.4780679115634563e-120 < im < -6.847505130661582e-247Initial program 25.4
rmApplied pow1/225.4
Applied log-pow25.4
Applied associate-/l*25.4
rmApplied pow125.4
Applied log-pow25.4
Applied add-cube-cbrt25.9
Applied times-frac25.9
Applied add-cube-cbrt25.3
Applied times-frac25.3
Simplified25.3
Simplified25.3
Taylor expanded around 0 37.5
if -6.847505130661582e-247 < im < 9.270740708287654e+63Initial program 21.9
rmApplied add-sqr-sqrt21.9
Applied pow1/221.9
Applied log-pow21.9
Applied times-frac21.9
rmApplied *-un-lft-identity21.9
Applied add-sqr-sqrt21.9
Applied times-frac21.9
Applied associate-*l*21.8
if 9.270740708287654e+63 < im Initial program 44.6
rmApplied add-sqr-sqrt44.6
Applied pow1/244.6
Applied log-pow44.6
Applied times-frac44.6
Taylor expanded around 0 10.0
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)))