\[\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: 3.9 s
Input Error: 14.8
Output Error: 0.3
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}\]
    14.8
  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.3

Original test:


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