\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -1.9126520588893617 \cdot 10^{+89}:\\
\;\;\;\;\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 -1.0485843961505591 \cdot 10^{-243}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log \left(im \cdot im + re \cdot re\right) \cdot \frac{\frac{1}{2}}{\sqrt{\log 10}}\right)\\
\mathbf{elif}\;re \le 1.6776212883736178 \cdot 10^{-164}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log im \cdot \sqrt{\frac{1}{\log 10}}\right)\\
\mathbf{elif}\;re \le 3384984853102974.0:\\
\;\;\;\;\sqrt{\frac{\frac{1}{2}}{\sqrt{\log 10}}} \cdot \left(\sqrt{\frac{\frac{1}{2}}{\sqrt{\log 10}}} \cdot \frac{\log \left(im \cdot im + re \cdot re\right)}{\sqrt{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(\log re \cdot \sqrt{\frac{1}{\log 10}}\right)\\
\end{array}double f(double re, double im) {
double r2208134 = re;
double r2208135 = r2208134 * r2208134;
double r2208136 = im;
double r2208137 = r2208136 * r2208136;
double r2208138 = r2208135 + r2208137;
double r2208139 = sqrt(r2208138);
double r2208140 = log(r2208139);
double r2208141 = 10.0;
double r2208142 = log(r2208141);
double r2208143 = r2208140 / r2208142;
return r2208143;
}
double f(double re, double im) {
double r2208144 = re;
double r2208145 = -1.9126520588893617e+89;
bool r2208146 = r2208144 <= r2208145;
double r2208147 = -1.0;
double r2208148 = r2208147 / r2208144;
double r2208149 = log(r2208148);
double r2208150 = -2.0;
double r2208151 = r2208149 * r2208150;
double r2208152 = 0.5;
double r2208153 = 10.0;
double r2208154 = log(r2208153);
double r2208155 = sqrt(r2208154);
double r2208156 = r2208152 / r2208155;
double r2208157 = r2208151 * r2208156;
double r2208158 = 1.0;
double r2208159 = r2208158 / r2208155;
double r2208160 = r2208157 * r2208159;
double r2208161 = -1.0485843961505591e-243;
bool r2208162 = r2208144 <= r2208161;
double r2208163 = im;
double r2208164 = r2208163 * r2208163;
double r2208165 = r2208144 * r2208144;
double r2208166 = r2208164 + r2208165;
double r2208167 = log(r2208166);
double r2208168 = r2208167 * r2208156;
double r2208169 = r2208159 * r2208168;
double r2208170 = 1.6776212883736178e-164;
bool r2208171 = r2208144 <= r2208170;
double r2208172 = log(r2208163);
double r2208173 = r2208158 / r2208154;
double r2208174 = sqrt(r2208173);
double r2208175 = r2208172 * r2208174;
double r2208176 = r2208159 * r2208175;
double r2208177 = 3384984853102974.0;
bool r2208178 = r2208144 <= r2208177;
double r2208179 = sqrt(r2208156);
double r2208180 = r2208167 / r2208155;
double r2208181 = r2208179 * r2208180;
double r2208182 = r2208179 * r2208181;
double r2208183 = log(r2208144);
double r2208184 = r2208183 * r2208174;
double r2208185 = r2208159 * r2208184;
double r2208186 = r2208178 ? r2208182 : r2208185;
double r2208187 = r2208171 ? r2208176 : r2208186;
double r2208188 = r2208162 ? r2208169 : r2208187;
double r2208189 = r2208146 ? r2208160 : r2208188;
return r2208189;
}



Bits error versus re



Bits error versus im
Results
if re < -1.9126520588893617e+89Initial program 48.3
rmApplied add-sqr-sqrt48.3
Applied pow148.3
Applied sqrt-pow148.3
Applied log-pow48.3
Applied times-frac48.3
Simplified48.3
rmApplied div-inv48.2
Applied associate-*r*48.2
Taylor expanded around -inf 9.6
Simplified9.6
if -1.9126520588893617e+89 < re < -1.0485843961505591e-243Initial program 20.5
rmApplied add-sqr-sqrt20.5
Applied pow120.5
Applied sqrt-pow120.5
Applied log-pow20.5
Applied times-frac20.5
Simplified20.5
rmApplied div-inv20.3
Applied associate-*r*20.3
if -1.0485843961505591e-243 < re < 1.6776212883736178e-164Initial program 30.5
rmApplied add-sqr-sqrt30.5
Applied pow130.5
Applied sqrt-pow130.5
Applied log-pow30.5
Applied times-frac30.5
Simplified30.5
rmApplied div-inv30.4
Applied associate-*r*30.4
Taylor expanded around 0 35.4
if 1.6776212883736178e-164 < re < 3384984853102974.0Initial program 15.9
rmApplied add-sqr-sqrt15.9
Applied pow115.9
Applied sqrt-pow115.9
Applied log-pow15.9
Applied times-frac15.9
Simplified15.9
rmApplied add-sqr-sqrt15.9
Applied associate-*l*15.8
if 3384984853102974.0 < re Initial program 40.3
rmApplied add-sqr-sqrt40.3
Applied pow140.3
Applied sqrt-pow140.3
Applied log-pow40.3
Applied times-frac40.3
Simplified40.3
rmApplied div-inv40.2
Applied associate-*r*40.2
Taylor expanded around inf 12.0
Simplified12.0
Final simplification18.4
herbie shell --seed 2019120
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))