\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -9.040563023697554117134626098062771221449 \cdot 10^{108}:\\
\;\;\;\;\left(\log \left(\frac{-1}{re}\right) \cdot \sqrt{\frac{1}{\log 10}}\right) \cdot \frac{-1}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le 1.876761322676858408683984671658326382422 \cdot 10^{119}:\\
\;\;\;\;\log \left({\left({\left(im \cdot im + re \cdot re\right)}^{\left(\frac{\frac{\sqrt{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}}{\left|\sqrt[3]{\log 10}\right|}\right)}\right)}^{\left(\frac{\frac{\sqrt{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}}{\sqrt{\sqrt[3]{\log 10}}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\log re \cdot 2\right) \cdot \frac{\frac{1}{2}}{\sqrt{\log 10}}\right) \cdot \frac{1}{\sqrt{\log 10}}\\
\end{array}double f(double re, double im) {
double r31818 = re;
double r31819 = r31818 * r31818;
double r31820 = im;
double r31821 = r31820 * r31820;
double r31822 = r31819 + r31821;
double r31823 = sqrt(r31822);
double r31824 = log(r31823);
double r31825 = 10.0;
double r31826 = log(r31825);
double r31827 = r31824 / r31826;
return r31827;
}
double f(double re, double im) {
double r31828 = re;
double r31829 = -9.040563023697554e+108;
bool r31830 = r31828 <= r31829;
double r31831 = -1.0;
double r31832 = r31831 / r31828;
double r31833 = log(r31832);
double r31834 = 1.0;
double r31835 = 10.0;
double r31836 = log(r31835);
double r31837 = r31834 / r31836;
double r31838 = sqrt(r31837);
double r31839 = r31833 * r31838;
double r31840 = sqrt(r31836);
double r31841 = r31831 / r31840;
double r31842 = r31839 * r31841;
double r31843 = 1.8767613226768584e+119;
bool r31844 = r31828 <= r31843;
double r31845 = im;
double r31846 = r31845 * r31845;
double r31847 = r31828 * r31828;
double r31848 = r31846 + r31847;
double r31849 = 0.5;
double r31850 = sqrt(r31849);
double r31851 = sqrt(r31840);
double r31852 = r31850 / r31851;
double r31853 = cbrt(r31836);
double r31854 = fabs(r31853);
double r31855 = r31852 / r31854;
double r31856 = pow(r31848, r31855);
double r31857 = sqrt(r31853);
double r31858 = r31852 / r31857;
double r31859 = pow(r31856, r31858);
double r31860 = log(r31859);
double r31861 = log(r31828);
double r31862 = 2.0;
double r31863 = r31861 * r31862;
double r31864 = r31849 / r31840;
double r31865 = r31863 * r31864;
double r31866 = r31834 / r31840;
double r31867 = r31865 * r31866;
double r31868 = r31844 ? r31860 : r31867;
double r31869 = r31830 ? r31842 : r31868;
return r31869;
}



Bits error versus re



Bits error versus im
Results
if re < -9.040563023697554e+108Initial program 54.4
rmApplied add-sqr-sqrt54.4
Applied pow1/254.4
Applied log-pow54.4
Applied times-frac54.4
rmApplied div-inv54.3
Applied associate-*r*54.3
Simplified54.3
Taylor expanded around -inf 10.0
Simplified10.0
if -9.040563023697554e+108 < re < 1.8767613226768584e+119Initial program 22.0
rmApplied add-sqr-sqrt22.0
Applied pow1/222.0
Applied log-pow22.0
Applied times-frac22.0
rmApplied div-inv21.9
Applied associate-*r*21.9
Simplified21.9
rmApplied add-log-exp21.9
Simplified21.7
rmApplied add-cube-cbrt22.6
Applied sqrt-prod22.6
Applied add-sqr-sqrt22.6
Applied sqrt-prod22.8
Applied add-sqr-sqrt22.6
Applied times-frac21.7
Applied times-frac21.7
Applied pow-unpow21.6
Simplified21.6
if 1.8767613226768584e+119 < re Initial program 56.0
rmApplied add-sqr-sqrt56.0
Applied pow1/256.0
Applied log-pow56.0
Applied times-frac56.0
rmApplied div-inv56.0
Applied associate-*r*56.0
Simplified56.0
Taylor expanded around inf 7.2
Simplified7.2
Final simplification17.6
herbie shell --seed 2019235
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))