\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
Test:
math.log10 on complex, real part
Bits:
128 bits
Bits error versus re
Bits error versus im
Time: 2.6 s
Input Error: 31.4
Output Error: 0.6
Log:
Profile: 🕒
\(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log 10}\)
  1. Started with
    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
    31.4
  2. Applied simplify to get
    \[\color{red}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}} \leadsto \color{blue}{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log 10}}\]
    0.6

Original test:


(lambda ((re default) (im default))
  #:name "math.log10 on complex, real part"
  (/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))