\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -9.983262521343274363476799981820042586015 \cdot 10^{136}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(-1 \cdot re\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 2.715346883449109812449415853977495365892 \cdot 10^{73}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\left|\sqrt[3]{re \cdot re + im \cdot im}\right| \cdot \sqrt{\sqrt[3]{re \cdot re + im \cdot im}}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({re}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\end{array}double f(double re, double im) {
double r40140 = re;
double r40141 = r40140 * r40140;
double r40142 = im;
double r40143 = r40142 * r40142;
double r40144 = r40141 + r40143;
double r40145 = sqrt(r40144);
double r40146 = log(r40145);
double r40147 = 10.0;
double r40148 = log(r40147);
double r40149 = r40146 / r40148;
return r40149;
}
double f(double re, double im) {
double r40150 = re;
double r40151 = -9.983262521343274e+136;
bool r40152 = r40150 <= r40151;
double r40153 = 1.0;
double r40154 = 10.0;
double r40155 = log(r40154);
double r40156 = sqrt(r40155);
double r40157 = r40153 / r40156;
double r40158 = -1.0;
double r40159 = r40158 * r40150;
double r40160 = pow(r40159, r40157);
double r40161 = log(r40160);
double r40162 = r40157 * r40161;
double r40163 = 2.7153468834491098e+73;
bool r40164 = r40150 <= r40163;
double r40165 = r40150 * r40150;
double r40166 = im;
double r40167 = r40166 * r40166;
double r40168 = r40165 + r40167;
double r40169 = cbrt(r40168);
double r40170 = fabs(r40169);
double r40171 = sqrt(r40169);
double r40172 = r40170 * r40171;
double r40173 = pow(r40172, r40157);
double r40174 = log(r40173);
double r40175 = r40157 * r40174;
double r40176 = pow(r40150, r40157);
double r40177 = log(r40176);
double r40178 = r40157 * r40177;
double r40179 = r40164 ? r40175 : r40178;
double r40180 = r40152 ? r40162 : r40179;
return r40180;
}



Bits error versus re



Bits error versus im
Results
if re < -9.983262521343274e+136Initial program 59.8
rmApplied add-sqr-sqrt59.8
Applied pow159.8
Applied log-pow59.8
Applied times-frac59.8
rmApplied add-log-exp59.8
Simplified59.8
Taylor expanded around -inf 8.1
if -9.983262521343274e+136 < re < 2.7153468834491098e+73Initial program 22.2
rmApplied add-sqr-sqrt22.2
Applied pow122.2
Applied log-pow22.2
Applied times-frac22.1
rmApplied add-log-exp22.1
Simplified22.0
rmApplied add-cube-cbrt22.0
Applied sqrt-prod22.0
Simplified22.0
if 2.7153468834491098e+73 < re Initial program 47.1
rmApplied add-sqr-sqrt47.1
Applied pow147.1
Applied log-pow47.1
Applied times-frac47.1
rmApplied add-log-exp47.1
Simplified47.0
Taylor expanded around inf 9.2
Final simplification17.5
herbie shell --seed 2019304
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))