\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -5.1674722654441826 \cdot 10^{+113}:\\
\;\;\;\;\left(\left(\log \left(\frac{-1}{re}\right) \cdot -2\right) \cdot \frac{1}{\sqrt{\log 10}}\right) \cdot \frac{\frac{1}{2}}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le 1.4251927726542934 \cdot 10^{+129}:\\
\;\;\;\;\left(\frac{1}{\sqrt{\log 10}} \cdot \log \left(im \cdot im + re \cdot re\right)\right) \cdot \frac{\frac{1}{2}}{\sqrt{\log 10}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{2}}{\sqrt{\log 10}} \cdot \left(\left(\log re \cdot 2\right) \cdot \frac{1}{\sqrt{\log 10}}\right)\\
\end{array}double f(double re, double im) {
double r1399732 = re;
double r1399733 = r1399732 * r1399732;
double r1399734 = im;
double r1399735 = r1399734 * r1399734;
double r1399736 = r1399733 + r1399735;
double r1399737 = sqrt(r1399736);
double r1399738 = log(r1399737);
double r1399739 = 10.0;
double r1399740 = log(r1399739);
double r1399741 = r1399738 / r1399740;
return r1399741;
}
double f(double re, double im) {
double r1399742 = re;
double r1399743 = -5.1674722654441826e+113;
bool r1399744 = r1399742 <= r1399743;
double r1399745 = -1.0;
double r1399746 = r1399745 / r1399742;
double r1399747 = log(r1399746);
double r1399748 = -2.0;
double r1399749 = r1399747 * r1399748;
double r1399750 = 1.0;
double r1399751 = 10.0;
double r1399752 = log(r1399751);
double r1399753 = sqrt(r1399752);
double r1399754 = r1399750 / r1399753;
double r1399755 = r1399749 * r1399754;
double r1399756 = 0.5;
double r1399757 = r1399756 / r1399753;
double r1399758 = r1399755 * r1399757;
double r1399759 = 1.4251927726542934e+129;
bool r1399760 = r1399742 <= r1399759;
double r1399761 = im;
double r1399762 = r1399761 * r1399761;
double r1399763 = r1399742 * r1399742;
double r1399764 = r1399762 + r1399763;
double r1399765 = log(r1399764);
double r1399766 = r1399754 * r1399765;
double r1399767 = r1399766 * r1399757;
double r1399768 = log(r1399742);
double r1399769 = 2.0;
double r1399770 = r1399768 * r1399769;
double r1399771 = r1399770 * r1399754;
double r1399772 = r1399757 * r1399771;
double r1399773 = r1399760 ? r1399767 : r1399772;
double r1399774 = r1399744 ? r1399758 : r1399773;
return r1399774;
}



Bits error versus re



Bits error versus im
Results
if re < -5.1674722654441826e+113Initial program 52.1
rmApplied add-sqr-sqrt52.1
Applied pow1/252.1
Applied log-pow52.1
Applied times-frac52.1
rmApplied div-inv52.1
Taylor expanded around -inf 8.4
Simplified8.4
if -5.1674722654441826e+113 < re < 1.4251927726542934e+129Initial program 21.4
rmApplied add-sqr-sqrt21.4
Applied pow1/221.4
Applied log-pow21.4
Applied times-frac21.4
rmApplied div-inv21.2
if 1.4251927726542934e+129 < re Initial program 55.4
rmApplied add-sqr-sqrt55.4
Applied pow1/255.4
Applied log-pow55.4
Applied times-frac55.4
rmApplied div-inv55.4
Taylor expanded around inf 7.5
Simplified7.5
Final simplification17.1
herbie shell --seed 2019135
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))