\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;re \leq -2.8311489939222134 \cdot 10^{+74}:\\
\;\;\;\;\frac{0.5}{\frac{\log 10}{\log \left(\frac{-1}{re}\right) \cdot -2}}\\
\mathbf{elif}\;re \leq 3.234431479514519 \cdot 10^{+70}:\\
\;\;\;\;\frac{\sqrt[3]{0.5} \cdot \sqrt[3]{0.5}}{\sqrt[3]{\log 10} \cdot \sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{0.5}}{\frac{\sqrt[3]{\log 10}}{\log \left(re \cdot re + im \cdot im\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{0.5} \cdot \sqrt[3]{0.5}}{\sqrt[3]{\log 10} \cdot \sqrt[3]{\log 10}} \cdot \frac{\sqrt[3]{0.5}}{\frac{\sqrt[3]{\log 10}}{2 \cdot \log re}}\\
\end{array}(FPCore (re im) :precision binary64 (/ (log (sqrt (+ (* re re) (* im im)))) (log 10.0)))
(FPCore (re im)
:precision binary64
(if (<= re -2.8311489939222134e+74)
(/ 0.5 (/ (log 10.0) (* (log (/ -1.0 re)) -2.0)))
(if (<= re 3.234431479514519e+70)
(*
(/ (* (cbrt 0.5) (cbrt 0.5)) (* (cbrt (log 10.0)) (cbrt (log 10.0))))
(/ (cbrt 0.5) (/ (cbrt (log 10.0)) (log (+ (* re re) (* im im))))))
(*
(/ (* (cbrt 0.5) (cbrt 0.5)) (* (cbrt (log 10.0)) (cbrt (log 10.0))))
(/ (cbrt 0.5) (/ (cbrt (log 10.0)) (* 2.0 (log re))))))))double code(double re, double im) {
return log(sqrt((re * re) + (im * im))) / log(10.0);
}
double code(double re, double im) {
double tmp;
if (re <= -2.8311489939222134e+74) {
tmp = 0.5 / (log(10.0) / (log(-1.0 / re) * -2.0));
} else if (re <= 3.234431479514519e+70) {
tmp = ((cbrt(0.5) * cbrt(0.5)) / (cbrt(log(10.0)) * cbrt(log(10.0)))) * (cbrt(0.5) / (cbrt(log(10.0)) / log((re * re) + (im * im))));
} else {
tmp = ((cbrt(0.5) * cbrt(0.5)) / (cbrt(log(10.0)) * cbrt(log(10.0)))) * (cbrt(0.5) / (cbrt(log(10.0)) / (2.0 * log(re))));
}
return tmp;
}



Bits error versus re



Bits error versus im
Results
if re < -2.83114899392221336e74Initial program 48.2
rmApplied pow1/2_binary6448.2
Applied log-pow_binary6448.2
Applied associate-/l*_binary6448.2
Taylor expanded around -inf 10.9
Simplified10.9
if -2.83114899392221336e74 < re < 3.234431479514519e70Initial program 22.5
rmApplied pow1/2_binary6422.5
Applied log-pow_binary6422.5
Applied associate-/l*_binary6422.5
rmApplied pow1_binary6422.5
Applied log-pow_binary6422.5
Applied add-cube-cbrt_binary6423.1
Applied times-frac_binary6423.1
Applied add-cube-cbrt_binary6422.5
Applied times-frac_binary6422.4
Simplified22.4
if 3.234431479514519e70 < re Initial program 48.2
rmApplied pow1/2_binary6448.2
Applied log-pow_binary6448.2
Applied associate-/l*_binary6448.2
rmApplied pow1_binary6448.2
Applied log-pow_binary6448.2
Applied add-cube-cbrt_binary6448.4
Applied times-frac_binary6448.4
Applied add-cube-cbrt_binary6448.2
Applied times-frac_binary6448.2
Simplified48.2
Taylor expanded around inf 10.4
Simplified10.4
Final simplification17.9
herbie shell --seed 2020260
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10.0)))