\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -6.35114368572189993071033166198605826169 \cdot 10^{103}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{2}}}{\frac{\sqrt[3]{\log 10}}{\log \left(\frac{-1}{re}\right) \cdot -2}} \cdot \left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right)\\
\mathbf{elif}\;re \le -1.403306634450894669656271333137131311492 \cdot 10^{-200}:\\
\;\;\;\;\left(\frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\sqrt[3]{\log 10}}\right) \cdot \frac{\sqrt[3]{\frac{1}{2}}}{\frac{\sqrt[3]{\log 10}}{\log \left(im \cdot im + re \cdot re\right)}}\\
\mathbf{elif}\;re \le -9.644694989558798059127661663723838127542 \cdot 10^{-288}:\\
\;\;\;\;\left(\frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}} \cdot \left(\log \left(\frac{-1}{im}\right) \cdot -2\right)\right) \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}}\\
\mathbf{elif}\;re \le 1.086754484260071349249942835782837644818 \cdot 10^{-222}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}} \cdot \left(\left(\log im \cdot 2\right) \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}}\right)\\
\mathbf{elif}\;re \le 2.488227374408068484790604899998157177197 \cdot 10^{120}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}} \cdot \left(\log \left(im \cdot im + re \cdot re\right) \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{2}}}{\sqrt{\log 10}} \cdot \left(\left(\sqrt{\frac{1}{\log 10}} \cdot \left(\log re \cdot \sqrt{\frac{1}{2}}\right)\right) \cdot 2\right)\\
\end{array}double f(double re, double im) {
double r1352224 = re;
double r1352225 = r1352224 * r1352224;
double r1352226 = im;
double r1352227 = r1352226 * r1352226;
double r1352228 = r1352225 + r1352227;
double r1352229 = sqrt(r1352228);
double r1352230 = log(r1352229);
double r1352231 = 10.0;
double r1352232 = log(r1352231);
double r1352233 = r1352230 / r1352232;
return r1352233;
}
double f(double re, double im) {
double r1352234 = re;
double r1352235 = -6.3511436857219e+103;
bool r1352236 = r1352234 <= r1352235;
double r1352237 = 0.5;
double r1352238 = cbrt(r1352237);
double r1352239 = 10.0;
double r1352240 = log(r1352239);
double r1352241 = cbrt(r1352240);
double r1352242 = -1.0;
double r1352243 = r1352242 / r1352234;
double r1352244 = log(r1352243);
double r1352245 = -2.0;
double r1352246 = r1352244 * r1352245;
double r1352247 = r1352241 / r1352246;
double r1352248 = r1352238 / r1352247;
double r1352249 = r1352238 / r1352241;
double r1352250 = r1352249 * r1352249;
double r1352251 = r1352248 * r1352250;
double r1352252 = -1.4033066344508947e-200;
bool r1352253 = r1352234 <= r1352252;
double r1352254 = im;
double r1352255 = r1352254 * r1352254;
double r1352256 = r1352234 * r1352234;
double r1352257 = r1352255 + r1352256;
double r1352258 = log(r1352257);
double r1352259 = r1352241 / r1352258;
double r1352260 = r1352238 / r1352259;
double r1352261 = r1352250 * r1352260;
double r1352262 = -9.644694989558798e-288;
bool r1352263 = r1352234 <= r1352262;
double r1352264 = sqrt(r1352237);
double r1352265 = sqrt(r1352240);
double r1352266 = r1352264 / r1352265;
double r1352267 = r1352242 / r1352254;
double r1352268 = log(r1352267);
double r1352269 = r1352268 * r1352245;
double r1352270 = r1352266 * r1352269;
double r1352271 = r1352270 * r1352266;
double r1352272 = 1.0867544842600713e-222;
bool r1352273 = r1352234 <= r1352272;
double r1352274 = log(r1352254);
double r1352275 = 2.0;
double r1352276 = r1352274 * r1352275;
double r1352277 = r1352276 * r1352266;
double r1352278 = r1352266 * r1352277;
double r1352279 = 2.4882273744080685e+120;
bool r1352280 = r1352234 <= r1352279;
double r1352281 = r1352258 * r1352266;
double r1352282 = r1352266 * r1352281;
double r1352283 = 1.0;
double r1352284 = r1352283 / r1352240;
double r1352285 = sqrt(r1352284);
double r1352286 = log(r1352234);
double r1352287 = r1352286 * r1352264;
double r1352288 = r1352285 * r1352287;
double r1352289 = r1352288 * r1352275;
double r1352290 = r1352266 * r1352289;
double r1352291 = r1352280 ? r1352282 : r1352290;
double r1352292 = r1352273 ? r1352278 : r1352291;
double r1352293 = r1352263 ? r1352271 : r1352292;
double r1352294 = r1352253 ? r1352261 : r1352293;
double r1352295 = r1352236 ? r1352251 : r1352294;
return r1352295;
}



Bits error versus re



Bits error versus im
Results
if re < -6.3511436857219e+103Initial program 52.4
rmApplied pow1/252.4
Applied log-pow52.4
Applied associate-/l*52.4
rmApplied pow152.4
Applied log-pow52.4
Applied add-cube-cbrt52.5
Applied times-frac52.5
Applied add-cube-cbrt52.4
Applied times-frac52.4
Simplified52.4
Taylor expanded around -inf 8.4
Simplified8.4
if -6.3511436857219e+103 < re < -1.4033066344508947e-200Initial program 18.7
rmApplied pow1/218.7
Applied log-pow18.7
Applied associate-/l*18.8
rmApplied pow118.8
Applied log-pow18.8
Applied add-cube-cbrt19.4
Applied times-frac19.3
Applied add-cube-cbrt18.7
Applied times-frac18.6
Simplified18.6
if -1.4033066344508947e-200 < re < -9.644694989558798e-288Initial program 30.4
rmApplied pow1/230.4
Applied log-pow30.4
Applied associate-/l*30.5
rmApplied pow130.5
Applied log-pow30.5
Applied add-sqr-sqrt30.5
Applied times-frac30.6
Applied add-sqr-sqrt30.4
Applied times-frac30.4
Simplified30.4
Simplified30.3
Taylor expanded around -inf 35.3
Simplified35.3
if -9.644694989558798e-288 < re < 1.0867544842600713e-222Initial program 34.1
rmApplied pow1/234.1
Applied log-pow34.1
Applied associate-/l*34.1
rmApplied pow134.1
Applied log-pow34.1
Applied add-sqr-sqrt34.1
Applied times-frac34.2
Applied add-sqr-sqrt34.1
Applied times-frac34.0
Simplified34.0
Simplified34.0
Taylor expanded around inf 31.6
Simplified31.6
if 1.0867544842600713e-222 < re < 2.4882273744080685e+120Initial program 18.5
rmApplied pow1/218.5
Applied log-pow18.5
Applied associate-/l*18.5
rmApplied pow118.5
Applied log-pow18.5
Applied add-sqr-sqrt18.5
Applied times-frac18.7
Applied add-sqr-sqrt18.5
Applied times-frac18.4
Simplified18.4
Simplified18.3
if 2.4882273744080685e+120 < re Initial program 54.8
rmApplied pow1/254.8
Applied log-pow54.8
Applied associate-/l*54.8
rmApplied pow154.8
Applied log-pow54.8
Applied add-sqr-sqrt54.8
Applied times-frac54.8
Applied add-sqr-sqrt54.8
Applied times-frac54.7
Simplified54.7
Simplified54.7
Taylor expanded around 0 7.5
Final simplification17.4
herbie shell --seed 2019200
(FPCore (re im)
:name "math.log10 on complex, real part"
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10.0)))