\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -8504444214849186820:\\
\;\;\;\;\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 -1.94492286994368674 \cdot 10^{-227}:\\
\;\;\;\;\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(e^{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\\
\mathbf{elif}\;re \le 2.05452758266485844 \cdot 10^{-296}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({im}^{\left(\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 1.23466046513203641 \cdot 10^{-75}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \frac{1}{\sqrt{\log 10}}\right)\\
\mathbf{elif}\;re \le 1.3202809311828264 \cdot 10^{-48}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log im \cdot \sqrt{\frac{1}{\log 10}}\right)\\
\mathbf{elif}\;re \le 4.2866910569424042 \cdot 10^{68}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \frac{1}{\sqrt{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\frac{1}{re}\right)}^{\left(-\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\end{array}double f(double re, double im) {
double r50639 = re;
double r50640 = r50639 * r50639;
double r50641 = im;
double r50642 = r50641 * r50641;
double r50643 = r50640 + r50642;
double r50644 = sqrt(r50643);
double r50645 = log(r50644);
double r50646 = 10.0;
double r50647 = log(r50646);
double r50648 = r50645 / r50647;
return r50648;
}
double f(double re, double im) {
double r50649 = re;
double r50650 = -8.504444214849187e+18;
bool r50651 = r50649 <= r50650;
double r50652 = 1.0;
double r50653 = 10.0;
double r50654 = log(r50653);
double r50655 = sqrt(r50654);
double r50656 = r50652 / r50655;
double r50657 = -1.0;
double r50658 = r50657 * r50649;
double r50659 = pow(r50658, r50656);
double r50660 = log(r50659);
double r50661 = r50656 * r50660;
double r50662 = -1.9449228699436867e-227;
bool r50663 = r50649 <= r50662;
double r50664 = r50649 * r50649;
double r50665 = im;
double r50666 = r50665 * r50665;
double r50667 = r50664 + r50666;
double r50668 = sqrt(r50667);
double r50669 = pow(r50668, r50656);
double r50670 = cbrt(r50669);
double r50671 = log(r50670);
double r50672 = 2.0;
double r50673 = r50672 / r50655;
double r50674 = r50671 * r50673;
double r50675 = log(r50668);
double r50676 = exp(r50675);
double r50677 = pow(r50676, r50656);
double r50678 = cbrt(r50677);
double r50679 = log(r50678);
double r50680 = r50656 * r50679;
double r50681 = r50674 + r50680;
double r50682 = 2.0545275826648584e-296;
bool r50683 = r50649 <= r50682;
double r50684 = r50652 / r50654;
double r50685 = sqrt(r50684);
double r50686 = pow(r50665, r50685);
double r50687 = log(r50686);
double r50688 = r50656 * r50687;
double r50689 = 1.2346604651320364e-75;
bool r50690 = r50649 <= r50689;
double r50691 = r50675 * r50656;
double r50692 = r50656 * r50691;
double r50693 = 1.3202809311828264e-48;
bool r50694 = r50649 <= r50693;
double r50695 = log(r50665);
double r50696 = r50695 * r50685;
double r50697 = r50656 * r50696;
double r50698 = 4.286691056942404e+68;
bool r50699 = r50649 <= r50698;
double r50700 = r50652 / r50649;
double r50701 = -r50685;
double r50702 = pow(r50700, r50701);
double r50703 = log(r50702);
double r50704 = r50656 * r50703;
double r50705 = r50699 ? r50692 : r50704;
double r50706 = r50694 ? r50697 : r50705;
double r50707 = r50690 ? r50692 : r50706;
double r50708 = r50683 ? r50688 : r50707;
double r50709 = r50663 ? r50681 : r50708;
double r50710 = r50651 ? r50661 : r50709;
return r50710;
}



Bits error versus re



Bits error versus im
Results
if re < -8.504444214849187e+18Initial program 42.7
rmApplied add-sqr-sqrt42.7
Applied pow142.7
Applied log-pow42.7
Applied times-frac42.7
rmApplied add-log-exp42.7
Simplified42.6
Taylor expanded around -inf 12.1
if -8.504444214849187e+18 < re < -1.9449228699436867e-227Initial program 19.5
rmApplied add-sqr-sqrt19.5
Applied pow119.5
Applied log-pow19.5
Applied times-frac19.5
rmApplied add-log-exp19.5
Simplified19.3
rmApplied add-cube-cbrt19.3
Applied log-prod19.3
Applied distribute-lft-in19.3
Simplified19.4
rmApplied add-exp-log19.3
if -1.9449228699436867e-227 < re < 2.0545275826648584e-296Initial program 32.8
rmApplied add-sqr-sqrt32.8
Applied pow132.8
Applied log-pow32.8
Applied times-frac32.8
rmApplied add-log-exp32.8
Simplified32.6
Taylor expanded around 0 34.4
Simplified34.4
if 2.0545275826648584e-296 < re < 1.2346604651320364e-75 or 1.3202809311828264e-48 < re < 4.286691056942404e+68Initial program 21.9
rmApplied add-sqr-sqrt21.9
Applied pow121.9
Applied log-pow21.9
Applied times-frac21.9
rmApplied add-log-exp21.9
Simplified21.7
rmApplied add-exp-log21.7
Applied pow-exp21.7
Applied rem-log-exp21.7
if 1.2346604651320364e-75 < re < 1.3202809311828264e-48Initial program 16.4
rmApplied add-sqr-sqrt16.4
Applied pow116.4
Applied log-pow16.4
Applied times-frac16.5
Taylor expanded around 0 44.0
if 4.286691056942404e+68 < re Initial program 48.3
rmApplied add-sqr-sqrt48.3
Applied pow148.3
Applied log-pow48.3
Applied times-frac48.3
rmApplied add-log-exp48.3
Simplified48.2
Taylor expanded around inf 10.6
Simplified10.5
Final simplification18.3
herbie shell --seed 2020036
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))