\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -86.01993975715544:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\frac{\log 10}{\sqrt{\frac{1}{2}} \cdot \log \left(\frac{-1}{re}\right)} \cdot \frac{-1}{2}}\\
\mathbf{elif}\;re \le 4.875955891928815 \cdot 10^{-233}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\frac{\frac{\sqrt{\log 10}}{\frac{\log \left(re \cdot re + im \cdot im\right)}{\sqrt{\log 10}}}}{\sqrt{\frac{1}{2}}}}\\
\mathbf{elif}\;re \le 5.785268620035206 \cdot 10^{-190}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\frac{\frac{\log 10}{\log im} \cdot \frac{1}{2}}{\sqrt{\frac{1}{2}}}}\\
\mathbf{elif}\;re \le 1.1977795536433536 \cdot 10^{+113}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\frac{\sqrt{\log 10}}{\log \left(re \cdot re + im \cdot im\right)}} \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log re}{\log 10}\\
\end{array}double f(double re, double im) {
double r761818 = re;
double r761819 = r761818 * r761818;
double r761820 = im;
double r761821 = r761820 * r761820;
double r761822 = r761819 + r761821;
double r761823 = sqrt(r761822);
double r761824 = log(r761823);
double r761825 = 10.0;
double r761826 = log(r761825);
double r761827 = r761824 / r761826;
return r761827;
}
double f(double re, double im) {
double r761828 = re;
double r761829 = -86.01993975715544;
bool r761830 = r761828 <= r761829;
double r761831 = 0.5;
double r761832 = sqrt(r761831);
double r761833 = 10.0;
double r761834 = log(r761833);
double r761835 = -1.0;
double r761836 = r761835 / r761828;
double r761837 = log(r761836);
double r761838 = r761832 * r761837;
double r761839 = r761834 / r761838;
double r761840 = -0.5;
double r761841 = r761839 * r761840;
double r761842 = r761832 / r761841;
double r761843 = 4.875955891928815e-233;
bool r761844 = r761828 <= r761843;
double r761845 = sqrt(r761834);
double r761846 = r761828 * r761828;
double r761847 = im;
double r761848 = r761847 * r761847;
double r761849 = r761846 + r761848;
double r761850 = log(r761849);
double r761851 = r761850 / r761845;
double r761852 = r761845 / r761851;
double r761853 = r761852 / r761832;
double r761854 = r761832 / r761853;
double r761855 = 5.785268620035206e-190;
bool r761856 = r761828 <= r761855;
double r761857 = log(r761847);
double r761858 = r761834 / r761857;
double r761859 = r761858 * r761831;
double r761860 = r761859 / r761832;
double r761861 = r761832 / r761860;
double r761862 = 1.1977795536433536e+113;
bool r761863 = r761828 <= r761862;
double r761864 = r761845 / r761850;
double r761865 = r761832 / r761864;
double r761866 = r761832 / r761845;
double r761867 = r761865 * r761866;
double r761868 = log(r761828);
double r761869 = r761868 / r761834;
double r761870 = r761863 ? r761867 : r761869;
double r761871 = r761856 ? r761861 : r761870;
double r761872 = r761844 ? r761854 : r761871;
double r761873 = r761830 ? r761842 : r761872;
return r761873;
}



Bits error versus re



Bits error versus im
Results
if re < -86.01993975715544Initial program 38.8
rmApplied pow138.8
Applied log-pow38.8
Applied associate-/r*38.8
Simplified38.8
rmApplied pow1/238.8
Applied log-pow38.8
Applied associate-/l*38.8
rmApplied add-sqr-sqrt38.9
Applied associate-/l*38.8
Taylor expanded around -inf 12.6
if -86.01993975715544 < re < 4.875955891928815e-233Initial program 24.6
rmApplied pow124.6
Applied log-pow24.6
Applied associate-/r*24.6
Simplified24.6
rmApplied pow1/224.6
Applied log-pow24.6
Applied associate-/l*24.6
rmApplied add-sqr-sqrt24.7
Applied associate-/l*24.5
rmApplied add-sqr-sqrt24.5
Applied associate-/l*24.5
if 4.875955891928815e-233 < re < 5.785268620035206e-190Initial program 34.0
rmApplied pow134.0
Applied log-pow34.0
Applied associate-/r*34.0
Simplified34.0
rmApplied pow1/234.0
Applied log-pow34.0
Applied associate-/l*34.0
rmApplied add-sqr-sqrt34.1
Applied associate-/l*34.0
Taylor expanded around 0 31.7
if 5.785268620035206e-190 < re < 1.1977795536433536e+113Initial program 17.3
rmApplied pow117.3
Applied log-pow17.3
Applied associate-/r*17.3
Simplified17.3
rmApplied pow1/217.3
Applied log-pow17.3
Applied associate-/l*17.3
rmApplied pow117.3
Applied log-pow17.3
Applied add-sqr-sqrt17.3
Applied times-frac17.5
Applied add-sqr-sqrt17.3
Applied times-frac17.2
Simplified17.2
if 1.1977795536433536e+113 < re Initial program 53.1
rmApplied pow153.1
Applied log-pow53.1
Applied associate-/r*53.1
Simplified53.1
Taylor expanded around inf 9.4
Final simplification17.5
herbie shell --seed 2019153
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))