\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -2.5872918038759956 \cdot 10^{153}:\\
\;\;\;\;\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 5087537.9202582333:\\
\;\;\;\;\log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) \cdot \frac{2}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(2 \cdot \frac{1}{2 \cdot \left|\sqrt[3]{\log 10}\right|}\right)}\right)}^{\left(\frac{\sqrt{1}}{\sqrt{\sqrt[3]{\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 r52432 = re;
double r52433 = r52432 * r52432;
double r52434 = im;
double r52435 = r52434 * r52434;
double r52436 = r52433 + r52435;
double r52437 = sqrt(r52436);
double r52438 = log(r52437);
double r52439 = 10.0;
double r52440 = log(r52439);
double r52441 = r52438 / r52440;
return r52441;
}
double f(double re, double im) {
double r52442 = re;
double r52443 = -2.5872918038759956e+153;
bool r52444 = r52442 <= r52443;
double r52445 = 1.0;
double r52446 = 10.0;
double r52447 = log(r52446);
double r52448 = sqrt(r52447);
double r52449 = r52445 / r52448;
double r52450 = -1.0;
double r52451 = r52450 * r52442;
double r52452 = pow(r52451, r52449);
double r52453 = log(r52452);
double r52454 = r52449 * r52453;
double r52455 = 5087537.920258233;
bool r52456 = r52442 <= r52455;
double r52457 = r52442 * r52442;
double r52458 = im;
double r52459 = r52458 * r52458;
double r52460 = r52457 + r52459;
double r52461 = sqrt(r52460);
double r52462 = pow(r52461, r52449);
double r52463 = cbrt(r52462);
double r52464 = log(r52463);
double r52465 = 2.0;
double r52466 = r52465 / r52448;
double r52467 = r52464 * r52466;
double r52468 = cbrt(r52447);
double r52469 = fabs(r52468);
double r52470 = r52465 * r52469;
double r52471 = r52445 / r52470;
double r52472 = r52465 * r52471;
double r52473 = pow(r52461, r52472);
double r52474 = sqrt(r52445);
double r52475 = sqrt(r52468);
double r52476 = r52474 / r52475;
double r52477 = pow(r52473, r52476);
double r52478 = cbrt(r52477);
double r52479 = log(r52478);
double r52480 = r52449 * r52479;
double r52481 = r52467 + r52480;
double r52482 = pow(r52442, r52449);
double r52483 = log(r52482);
double r52484 = r52449 * r52483;
double r52485 = r52456 ? r52481 : r52484;
double r52486 = r52444 ? r52454 : r52485;
return r52486;
}



Bits error versus re



Bits error versus im
Results
if re < -2.5872918038759956e+153Initial program 63.9
rmApplied add-sqr-sqrt63.9
Applied pow163.9
Applied log-pow63.9
Applied times-frac63.9
rmApplied add-log-exp63.9
Simplified63.9
Taylor expanded around -inf 6.6
if -2.5872918038759956e+153 < re < 5087537.920258233Initial program 21.8
rmApplied add-sqr-sqrt21.8
Applied pow121.8
Applied log-pow21.8
Applied times-frac21.8
rmApplied add-log-exp21.8
Simplified21.6
rmApplied add-cube-cbrt21.6
Applied log-prod21.7
Applied distribute-lft-in21.7
Simplified21.7
rmApplied add-cube-cbrt21.8
Applied sqrt-prod21.8
Applied add-sqr-sqrt21.8
Applied times-frac21.7
Applied pow-unpow21.7
Simplified21.7
if 5087537.920258233 < re Initial program 41.0
rmApplied add-sqr-sqrt41.0
Applied pow141.0
Applied log-pow41.0
Applied times-frac41.0
rmApplied add-log-exp41.0
Simplified40.9
Taylor expanded around inf 13.9
Final simplification17.8
herbie shell --seed 2020024
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))