\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -5.380362276173541 \cdot 10^{+107}:\\
\;\;\;\;\left(\left(\log \left(\frac{-1}{re}\right) \cdot -2\right) \cdot \frac{\frac{1}{2}}{\sqrt{\log 10}}\right) \cdot \frac{1}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le -8.063909354218252 \cdot 10^{-204}:\\
\;\;\;\;\left(\sqrt{\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}} \cdot \left(\sqrt{\frac{\frac{1}{2}}{\sqrt{\log 10}}} \cdot \frac{\log \left(re \cdot re + im \cdot im\right)}{\sqrt{\log 10}}\right)\right) \cdot \sqrt{\frac{\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}}\\
\mathbf{elif}\;re \le 4.448238055322174 \cdot 10^{-253}:\\
\;\;\;\;\left(\log im \cdot \sqrt{\frac{1}{\log 10}}\right) \cdot \frac{1}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le 7.561817009873841 \cdot 10^{+49}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{2}}{\sqrt{\log 10}}} \cdot \frac{\log \left(re \cdot re + im \cdot im\right) \cdot \sqrt{\frac{\frac{1}{2}}{\sqrt{\log 10}}}}{\sqrt{\log 10}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\sqrt{\frac{1}{\log 10}} \cdot \log re\right)\\
\end{array}double f(double re, double im) {
double r858342 = re;
double r858343 = r858342 * r858342;
double r858344 = im;
double r858345 = r858344 * r858344;
double r858346 = r858343 + r858345;
double r858347 = sqrt(r858346);
double r858348 = log(r858347);
double r858349 = 10.0;
double r858350 = log(r858349);
double r858351 = r858348 / r858350;
return r858351;
}
double f(double re, double im) {
double r858352 = re;
double r858353 = -5.380362276173541e+107;
bool r858354 = r858352 <= r858353;
double r858355 = -1.0;
double r858356 = r858355 / r858352;
double r858357 = log(r858356);
double r858358 = -2.0;
double r858359 = r858357 * r858358;
double r858360 = 0.5;
double r858361 = 10.0;
double r858362 = log(r858361);
double r858363 = sqrt(r858362);
double r858364 = r858360 / r858363;
double r858365 = r858359 * r858364;
double r858366 = 1.0;
double r858367 = r858366 / r858363;
double r858368 = r858365 * r858367;
double r858369 = -8.063909354218252e-204;
bool r858370 = r858352 <= r858369;
double r858371 = cbrt(r858360);
double r858372 = sqrt(r858363);
double r858373 = r858371 / r858372;
double r858374 = sqrt(r858373);
double r858375 = sqrt(r858364);
double r858376 = r858352 * r858352;
double r858377 = im;
double r858378 = r858377 * r858377;
double r858379 = r858376 + r858378;
double r858380 = log(r858379);
double r858381 = r858380 / r858363;
double r858382 = r858375 * r858381;
double r858383 = r858374 * r858382;
double r858384 = r858371 * r858371;
double r858385 = r858384 / r858372;
double r858386 = sqrt(r858385);
double r858387 = r858383 * r858386;
double r858388 = 4.448238055322174e-253;
bool r858389 = r858352 <= r858388;
double r858390 = log(r858377);
double r858391 = r858366 / r858362;
double r858392 = sqrt(r858391);
double r858393 = r858390 * r858392;
double r858394 = r858393 * r858367;
double r858395 = 7.561817009873841e+49;
bool r858396 = r858352 <= r858395;
double r858397 = r858380 * r858375;
double r858398 = r858397 / r858363;
double r858399 = r858375 * r858398;
double r858400 = log(r858352);
double r858401 = r858392 * r858400;
double r858402 = r858367 * r858401;
double r858403 = r858396 ? r858399 : r858402;
double r858404 = r858389 ? r858394 : r858403;
double r858405 = r858370 ? r858387 : r858404;
double r858406 = r858354 ? r858368 : r858405;
return r858406;
}



Bits error versus re



Bits error versus im
Results
if re < -5.380362276173541e+107Initial program 51.3
rmApplied add-sqr-sqrt51.3
Applied pow151.3
Applied sqrt-pow151.3
Applied log-pow51.3
Applied times-frac51.3
Simplified51.3
rmApplied div-inv51.3
Applied associate-*r*51.3
Taylor expanded around -inf 8.9
Simplified8.9
if -5.380362276173541e+107 < re < -8.063909354218252e-204Initial program 18.4
rmApplied add-sqr-sqrt18.4
Applied pow118.4
Applied sqrt-pow118.4
Applied log-pow18.4
Applied times-frac18.4
Simplified18.4
rmApplied add-sqr-sqrt18.4
Applied associate-*l*18.3
rmApplied add-sqr-sqrt18.3
Applied sqrt-prod18.7
Applied add-cube-cbrt18.3
Applied times-frac18.3
Applied sqrt-prod18.3
Applied associate-*l*18.4
if -8.063909354218252e-204 < re < 4.448238055322174e-253Initial program 28.5
rmApplied add-sqr-sqrt28.5
Applied pow128.5
Applied sqrt-pow128.5
Applied log-pow28.5
Applied times-frac28.5
Simplified28.5
rmApplied div-inv28.4
Applied associate-*r*28.4
Taylor expanded around 0 31.8
if 4.448238055322174e-253 < re < 7.561817009873841e+49Initial program 20.4
rmApplied add-sqr-sqrt20.4
Applied pow120.4
Applied sqrt-pow120.4
Applied log-pow20.4
Applied times-frac20.4
Simplified20.4
rmApplied add-sqr-sqrt20.4
Applied associate-*l*20.3
rmApplied associate-*r/20.3
if 7.561817009873841e+49 < re Initial program 42.7
rmApplied add-sqr-sqrt42.7
Applied pow142.7
Applied sqrt-pow142.7
Applied log-pow42.7
Applied times-frac42.7
Simplified42.7
rmApplied div-inv42.6
Applied associate-*r*42.6
Taylor expanded around inf 11.4
Simplified11.4
Final simplification17.5
herbie shell --seed 2019132
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))