\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 r2014870 = re;
double r2014871 = r2014870 * r2014870;
double r2014872 = im;
double r2014873 = r2014872 * r2014872;
double r2014874 = r2014871 + r2014873;
double r2014875 = sqrt(r2014874);
double r2014876 = log(r2014875);
double r2014877 = 10.0;
double r2014878 = log(r2014877);
double r2014879 = r2014876 / r2014878;
return r2014879;
}
double f(double re, double im) {
double r2014880 = re;
double r2014881 = -7.266849055505758e+89;
bool r2014882 = r2014880 <= r2014881;
double r2014883 = 1.0;
double r2014884 = 10.0;
double r2014885 = log(r2014884);
double r2014886 = sqrt(r2014885);
double r2014887 = r2014883 / r2014886;
double r2014888 = -r2014880;
double r2014889 = log(r2014888);
double r2014890 = r2014889 * r2014887;
double r2014891 = r2014887 * r2014890;
double r2014892 = 7.762022248986236e+136;
bool r2014893 = r2014880 <= r2014892;
double r2014894 = sqrt(r2014887);
double r2014895 = r2014894 * r2014894;
double r2014896 = im;
double r2014897 = r2014896 * r2014896;
double r2014898 = r2014880 * r2014880;
double r2014899 = r2014897 + r2014898;
double r2014900 = sqrt(r2014899);
double r2014901 = log(r2014900);
double r2014902 = r2014901 * r2014887;
double r2014903 = r2014895 * r2014902;
double r2014904 = log(r2014880);
double r2014905 = r2014904 * r2014887;
double r2014906 = r2014905 * r2014894;
double r2014907 = r2014894 * r2014906;
double r2014908 = r2014893 ? r2014903 : r2014907;
double r2014909 = r2014882 ? r2014891 : r2014908;
return r2014909;
}



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)))