\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -3.106642014201959 \cdot 10^{+51}:\\
\;\;\;\;\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 -2.2438685006751525 \cdot 10^{-249}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}} \cdot \left(\frac{\log \left(re \cdot re + im \cdot im\right)}{\sqrt{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}\right)\\
\mathbf{elif}\;re \le 1.3130508878524708 \cdot 10^{-291}:\\
\;\;\;\;\left(\log im \cdot \sqrt{\frac{1}{\log 10}}\right) \cdot \frac{1}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le 3.000728483394708 \cdot 10^{+92}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}} \cdot \left(\frac{\log \left(re \cdot re + im \cdot im\right)}{\sqrt{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}} \cdot \frac{\log re + \log re}{\sqrt{\log 10}}\right) \cdot \frac{\sqrt[3]{\frac{1}{2}} \cdot \sqrt[3]{\frac{1}{2}}}{\sqrt{\sqrt{\log 10}}}\\
\end{array}double f(double re, double im) {
double r552123 = re;
double r552124 = r552123 * r552123;
double r552125 = im;
double r552126 = r552125 * r552125;
double r552127 = r552124 + r552126;
double r552128 = sqrt(r552127);
double r552129 = log(r552128);
double r552130 = 10.0;
double r552131 = log(r552130);
double r552132 = r552129 / r552131;
return r552132;
}
double f(double re, double im) {
double r552133 = re;
double r552134 = -3.106642014201959e+51;
bool r552135 = r552133 <= r552134;
double r552136 = -1.0;
double r552137 = r552136 / r552133;
double r552138 = log(r552137);
double r552139 = -2.0;
double r552140 = r552138 * r552139;
double r552141 = 0.5;
double r552142 = 10.0;
double r552143 = log(r552142);
double r552144 = sqrt(r552143);
double r552145 = r552141 / r552144;
double r552146 = r552140 * r552145;
double r552147 = 1.0;
double r552148 = r552147 / r552144;
double r552149 = r552146 * r552148;
double r552150 = -2.2438685006751525e-249;
bool r552151 = r552133 <= r552150;
double r552152 = cbrt(r552141);
double r552153 = r552152 * r552152;
double r552154 = sqrt(r552144);
double r552155 = r552153 / r552154;
double r552156 = r552133 * r552133;
double r552157 = im;
double r552158 = r552157 * r552157;
double r552159 = r552156 + r552158;
double r552160 = log(r552159);
double r552161 = r552160 / r552144;
double r552162 = r552152 / r552154;
double r552163 = r552161 * r552162;
double r552164 = r552155 * r552163;
double r552165 = 1.3130508878524708e-291;
bool r552166 = r552133 <= r552165;
double r552167 = log(r552157);
double r552168 = r552147 / r552143;
double r552169 = sqrt(r552168);
double r552170 = r552167 * r552169;
double r552171 = r552170 * r552148;
double r552172 = 3.000728483394708e+92;
bool r552173 = r552133 <= r552172;
double r552174 = log(r552133);
double r552175 = r552174 + r552174;
double r552176 = r552175 / r552144;
double r552177 = r552162 * r552176;
double r552178 = r552177 * r552155;
double r552179 = r552173 ? r552164 : r552178;
double r552180 = r552166 ? r552171 : r552179;
double r552181 = r552151 ? r552164 : r552180;
double r552182 = r552135 ? r552149 : r552181;
return r552182;
}



Bits error versus re



Bits error versus im
Results
if re < -3.106642014201959e+51Initial program 43.3
rmApplied add-sqr-sqrt43.3
Applied pow1/243.3
Applied log-pow43.3
Applied times-frac43.3
rmApplied div-inv43.2
Applied associate-*r*43.2
Taylor expanded around -inf 10.4
Simplified10.4
if -3.106642014201959e+51 < re < -2.2438685006751525e-249 or 1.3130508878524708e-291 < re < 3.000728483394708e+92Initial program 20.8
rmApplied add-sqr-sqrt20.8
Applied pow1/220.8
Applied log-pow20.8
Applied times-frac20.8
rmApplied add-sqr-sqrt20.8
Applied sqrt-prod21.3
Applied add-cube-cbrt20.8
Applied times-frac20.8
Applied associate-*l*20.7
if -2.2438685006751525e-249 < re < 1.3130508878524708e-291Initial program 32.2
rmApplied add-sqr-sqrt32.2
Applied pow1/232.2
Applied log-pow32.2
Applied times-frac32.2
rmApplied div-inv32.1
Applied associate-*r*32.1
Taylor expanded around 0 34.4
if 3.000728483394708e+92 < re Initial program 49.1
rmApplied add-sqr-sqrt49.1
Applied pow1/249.1
Applied log-pow49.1
Applied times-frac49.1
rmApplied add-sqr-sqrt49.1
Applied sqrt-prod49.3
Applied add-cube-cbrt49.1
Applied times-frac49.1
Applied associate-*l*49.1
Taylor expanded around inf 10.5
Simplified10.5
Final simplification17.6
herbie shell --seed 2019154
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))