\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \le -9.983262521343274363476799981820042586015 \cdot 10^{136}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\frac{-1}{re}\right)}^{\left(-\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\mathbf{elif}\;re \le 2.715346883449109812449415853977495365892 \cdot 10^{73}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({re}^{\left(\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\end{array}double f(double re, double im) {
double r62318 = re;
double r62319 = r62318 * r62318;
double r62320 = im;
double r62321 = r62320 * r62320;
double r62322 = r62319 + r62321;
double r62323 = sqrt(r62322);
double r62324 = log(r62323);
double r62325 = 10.0;
double r62326 = log(r62325);
double r62327 = r62324 / r62326;
return r62327;
}
double f(double re, double im) {
double r62328 = re;
double r62329 = -9.983262521343274e+136;
bool r62330 = r62328 <= r62329;
double r62331 = 1.0;
double r62332 = 10.0;
double r62333 = log(r62332);
double r62334 = sqrt(r62333);
double r62335 = r62331 / r62334;
double r62336 = -1.0;
double r62337 = r62336 / r62328;
double r62338 = r62331 / r62333;
double r62339 = sqrt(r62338);
double r62340 = -r62339;
double r62341 = pow(r62337, r62340);
double r62342 = log(r62341);
double r62343 = r62335 * r62342;
double r62344 = 2.7153468834491098e+73;
bool r62345 = r62328 <= r62344;
double r62346 = r62328 * r62328;
double r62347 = im;
double r62348 = r62347 * r62347;
double r62349 = r62346 + r62348;
double r62350 = sqrt(r62349);
double r62351 = pow(r62350, r62335);
double r62352 = log(r62351);
double r62353 = r62335 * r62352;
double r62354 = pow(r62328, r62339);
double r62355 = log(r62354);
double r62356 = r62335 * r62355;
double r62357 = r62345 ? r62353 : r62356;
double r62358 = r62330 ? r62343 : r62357;
return r62358;
}



Bits error versus re



Bits error versus im
Results
if re < -9.983262521343274e+136Initial program 59.8
rmApplied add-sqr-sqrt59.8
Applied pow159.8
Applied log-pow59.8
Applied times-frac59.8
rmApplied div-inv59.8
rmApplied add-log-exp59.8
Simplified59.8
Taylor expanded around -inf 8.1
Simplified8.1
if -9.983262521343274e+136 < re < 2.7153468834491098e+73Initial program 22.2
rmApplied add-sqr-sqrt22.2
Applied pow122.2
Applied log-pow22.2
Applied times-frac22.1
rmApplied div-inv22.0
rmApplied add-log-exp22.0
Simplified22.0
if 2.7153468834491098e+73 < re Initial program 47.1
rmApplied add-sqr-sqrt47.1
Applied pow147.1
Applied log-pow47.1
Applied times-frac47.1
rmApplied div-inv47.0
rmApplied add-log-exp47.0
Simplified47.0
Taylor expanded around inf 9.2
Simplified9.2
Final simplification17.5
herbie shell --seed 2019304
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))