\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Test:
math.log/2 on complex, real part
Bits:
128 bits
Bits error versus re
Bits error versus im
Bits error versus base
Time: 10.4 s
Input Error: 30.4
Output Error: 30.4
Log:
Profile: 🕒
\(\frac{\log \left(\sqrt{im \cdot im + {re}^2}\right)}{\log base}\)
  1. Started with
    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    30.4
  2. Applied simplify to get
    \[\color{red}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}} \leadsto \color{blue}{\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\log base \cdot \log base}}\]
    30.4
  3. Using strategy rm
    30.4
  4. Applied add-cbrt-cube to get
    \[\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\color{red}{\log base \cdot \log base}} \leadsto \frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\color{blue}{\sqrt[3]{{\left(\log base \cdot \log base\right)}^3}}}\]
    30.5
  5. Applied taylor to get
    \[\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\sqrt[3]{{\left(\log base \cdot \log base\right)}^3}} \leadsto \frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{{\left(\log \left(\frac{1}{base}\right)\right)}^2}\]
    30.4
  6. Taylor expanded around inf to get
    \[\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\color{red}{{\left(\log \left(\frac{1}{base}\right)\right)}^2}} \leadsto \frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\color{blue}{{\left(\log \left(\frac{1}{base}\right)\right)}^2}}\]
    30.4
  7. Applied simplify to get
    \[\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{{\left(\log \left(\frac{1}{base}\right)\right)}^2} \leadsto \frac{\log base}{\log base \cdot \log base} \cdot \log \left(\sqrt{im \cdot im + re \cdot re}\right)\]
    30.4

  8. Applied final simplification
  9. Applied simplify to get
    \[\color{red}{\frac{\log base}{\log base \cdot \log base} \cdot \log \left(\sqrt{im \cdot im + re \cdot re}\right)} \leadsto \color{blue}{\frac{\log \left(\sqrt{im \cdot im + {re}^2}\right)}{\log base}}\]
    30.4

Original test:


(lambda ((re default) (im default) (base default))
  #:name "math.log/2 on complex, real part"
  (/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0)) (+ (* (log base) (log base)) (* 0 0))))