\[\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: 6.6 s
Input Error: 31.5
Output Error: 0.6
Log:
Profile: 🕒
\(\frac{\log \left({\left((e^{\log_* (1 + \sqrt[3]{\sqrt{im^2 + re^2}^*})} - 1)^*\right)}^3\right)}{\log 10}\)
  1. Started with
    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
    31.5
  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
  3. Using strategy rm
    0.6
  4. Applied add-cube-cbrt to get
    \[\frac{\log \color{red}{\left(\sqrt{im^2 + re^2}^*\right)}}{\log 10} \leadsto \frac{\log \color{blue}{\left({\left(\sqrt[3]{\sqrt{im^2 + re^2}^*}\right)}^3\right)}}{\log 10}\]
    0.6
  5. Using strategy rm
    0.6
  6. Applied expm1-log1p-u to get
    \[\frac{\log \left({\color{red}{\left(\sqrt[3]{\sqrt{im^2 + re^2}^*}\right)}}^3\right)}{\log 10} \leadsto \frac{\log \left({\color{blue}{\left((e^{\log_* (1 + \sqrt[3]{\sqrt{im^2 + re^2}^*})} - 1)^*\right)}}^3\right)}{\log 10}\]
    0.6

  7. Removed slow pow expressions

Original test:


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