\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -2.2033296293392884 \cdot 10^{+64}:\\
\;\;\;\;\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}{re}\right)\right) \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{elif}\;re \le -1.2465139226076545 \cdot 10^{-304}:\\
\;\;\;\;\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(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \log \left(im \cdot im + re \cdot re\right)\right)\\
\mathbf{elif}\;re \le 9.161820666739078 \cdot 10^{-228}:\\
\;\;\;\;\frac{\frac{1}{2}}{\frac{1}{2} \cdot \frac{\log 10}{\log im}}\\
\mathbf{elif}\;re \le 7.1259985451937965 \cdot 10^{+137}:\\
\;\;\;\;\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(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \log \left(im \cdot im + re \cdot re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\end{array}double f(double re, double im) {
double r954943 = re;
double r954944 = r954943 * r954943;
double r954945 = im;
double r954946 = r954945 * r954945;
double r954947 = r954944 + r954946;
double r954948 = sqrt(r954947);
double r954949 = log(r954948);
double r954950 = 10.0;
double r954951 = log(r954950);
double r954952 = r954949 / r954951;
return r954952;
}
double f(double re, double im) {
double r954953 = re;
double r954954 = -2.2033296293392884e+64;
bool r954955 = r954953 <= r954954;
double r954956 = 0.5;
double r954957 = cbrt(r954956);
double r954958 = 10.0;
double r954959 = log(r954958);
double r954960 = cbrt(r954959);
double r954961 = r954957 / r954960;
double r954962 = r954961 * r954961;
double r954963 = -2.0;
double r954964 = -1.0;
double r954965 = r954964 / r954953;
double r954966 = log(r954965);
double r954967 = r954963 * r954966;
double r954968 = r954967 * r954961;
double r954969 = r954962 * r954968;
double r954970 = -1.2465139226076545e-304;
bool r954971 = r954953 <= r954970;
double r954972 = im;
double r954973 = r954972 * r954972;
double r954974 = r954953 * r954953;
double r954975 = r954973 + r954974;
double r954976 = log(r954975);
double r954977 = r954961 * r954976;
double r954978 = r954962 * r954977;
double r954979 = 9.161820666739078e-228;
bool r954980 = r954953 <= r954979;
double r954981 = log(r954972);
double r954982 = r954959 / r954981;
double r954983 = r954956 * r954982;
double r954984 = r954956 / r954983;
double r954985 = 7.1259985451937965e+137;
bool r954986 = r954953 <= r954985;
double r954987 = log(r954953);
double r954988 = 2.0;
double r954989 = r954987 * r954988;
double r954990 = r954989 * r954961;
double r954991 = r954990 * r954962;
double r954992 = r954986 ? r954978 : r954991;
double r954993 = r954980 ? r954984 : r954992;
double r954994 = r954971 ? r954978 : r954993;
double r954995 = r954955 ? r954969 : r954994;
return r954995;
}



Bits error versus re



Bits error versus im
Results
if re < -2.2033296293392884e+64Initial program 45.5
rmApplied pow1/245.5
Applied log-pow45.5
Applied associate-/l*45.5
rmApplied pow145.5
Applied log-pow45.5
Applied add-cube-cbrt45.7
Applied times-frac45.8
Applied add-cube-cbrt45.5
Applied times-frac45.5
Simplified45.5
Simplified45.5
Taylor expanded around -inf 10.6
Simplified10.6
if -2.2033296293392884e+64 < re < -1.2465139226076545e-304 or 9.161820666739078e-228 < re < 7.1259985451937965e+137Initial program 20.2
rmApplied pow1/220.2
Applied log-pow20.2
Applied associate-/l*20.3
rmApplied pow120.3
Applied log-pow20.3
Applied add-cube-cbrt20.8
Applied times-frac20.8
Applied add-cube-cbrt20.2
Applied times-frac20.1
Simplified20.1
Simplified20.1
if -1.2465139226076545e-304 < re < 9.161820666739078e-228Initial program 33.1
rmApplied pow1/233.1
Applied log-pow33.1
Applied associate-/l*33.1
Taylor expanded around 0 33.8
if 7.1259985451937965e+137 < re Initial program 58.5
rmApplied pow1/258.5
Applied log-pow58.5
Applied associate-/l*58.5
rmApplied pow158.5
Applied log-pow58.5
Applied add-cube-cbrt58.5
Applied times-frac58.5
Applied add-cube-cbrt58.4
Applied times-frac58.4
Simplified58.4
Simplified58.4
Taylor expanded around inf 8.1
Simplified8.1
Final simplification17.5
herbie shell --seed 2019143
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))