\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -7.266849055505758 \cdot 10^{+89}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log \left(-re\right) \cdot \frac{1}{\sqrt{\log 10}}\right)\\
\mathbf{elif}\;re \le 7.762022248986236 \cdot 10^{+136}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \sqrt{\frac{1}{\sqrt{\log 10}}}\right) \cdot \left(\log \left(\sqrt{im \cdot im + re \cdot re}\right) \cdot \frac{1}{\sqrt{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \left(\left(\log re \cdot \frac{1}{\sqrt{\log 10}}\right) \cdot \sqrt{\frac{1}{\sqrt{\log 10}}}\right)\\
\end{array}double f(double re, double im) {
double r2014865 = re;
double r2014866 = r2014865 * r2014865;
double r2014867 = im;
double r2014868 = r2014867 * r2014867;
double r2014869 = r2014866 + r2014868;
double r2014870 = sqrt(r2014869);
double r2014871 = log(r2014870);
double r2014872 = 10.0;
double r2014873 = log(r2014872);
double r2014874 = r2014871 / r2014873;
return r2014874;
}
double f(double re, double im) {
double r2014875 = re;
double r2014876 = -7.266849055505758e+89;
bool r2014877 = r2014875 <= r2014876;
double r2014878 = 1.0;
double r2014879 = 10.0;
double r2014880 = log(r2014879);
double r2014881 = sqrt(r2014880);
double r2014882 = r2014878 / r2014881;
double r2014883 = -r2014875;
double r2014884 = log(r2014883);
double r2014885 = r2014884 * r2014882;
double r2014886 = r2014882 * r2014885;
double r2014887 = 7.762022248986236e+136;
bool r2014888 = r2014875 <= r2014887;
double r2014889 = sqrt(r2014882);
double r2014890 = r2014889 * r2014889;
double r2014891 = im;
double r2014892 = r2014891 * r2014891;
double r2014893 = r2014875 * r2014875;
double r2014894 = r2014892 + r2014893;
double r2014895 = sqrt(r2014894);
double r2014896 = log(r2014895);
double r2014897 = r2014896 * r2014882;
double r2014898 = r2014890 * r2014897;
double r2014899 = log(r2014875);
double r2014900 = r2014899 * r2014882;
double r2014901 = r2014900 * r2014889;
double r2014902 = r2014889 * r2014901;
double r2014903 = r2014888 ? r2014898 : r2014902;
double r2014904 = r2014877 ? r2014886 : r2014903;
return r2014904;
}



Bits error versus re



Bits error versus im
Results
if re < -7.266849055505758e+89Initial program 47.9
rmApplied add-sqr-sqrt47.9
Applied pow147.9
Applied log-pow47.9
Applied times-frac47.9
rmApplied div-inv47.8
Applied associate-*r*47.8
Taylor expanded around -inf 9.3
Simplified9.3
if -7.266849055505758e+89 < re < 7.762022248986236e+136Initial program 21.4
rmApplied add-sqr-sqrt21.4
Applied pow121.4
Applied log-pow21.4
Applied times-frac21.4
rmApplied div-inv21.2
Applied associate-*r*21.2
rmApplied add-sqr-sqrt21.2
Applied associate-*r*21.3
rmApplied associate-*l*21.2
if 7.762022248986236e+136 < re Initial program 57.5
rmApplied add-sqr-sqrt57.5
Applied pow157.5
Applied log-pow57.5
Applied times-frac57.5
rmApplied div-inv57.4
Applied associate-*r*57.4
rmApplied add-sqr-sqrt57.4
Applied associate-*r*57.5
Taylor expanded around inf 7.5
Final simplification17.2
herbie shell --seed 2019107
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))