\[\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: 7.8 s
Input Error: 30.7
Output Error: 30.7
Log:
Profile: 🕒
\(\frac{1}{\log base} \cdot \log \left(\sqrt{{im}^2 + re \cdot re}\right)\)
  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.7
  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.7
  3. Using strategy rm
    30.7
  4. Applied *-un-lft-identity to get
    \[\frac{\color{red}{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}}{\log base \cdot \log base} \leadsto \frac{\color{blue}{1 \cdot \left(\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0\right)}}{\log base \cdot \log base}\]
    30.7
  5. Applied times-frac to get
    \[\color{red}{\frac{1 \cdot \left(\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0\right)}{\log base \cdot \log base}} \leadsto \color{blue}{\frac{1}{\log base} \cdot \frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\log base}}\]
    30.7
  6. Applied simplify to get
    \[\frac{1}{\log base} \cdot \color{red}{\frac{\log base \cdot \log \left(\sqrt{{re}^2 + im \cdot im}\right) + 0}{\log base}} \leadsto \frac{1}{\log base} \cdot \color{blue}{\log \left(\sqrt{im \cdot im + re \cdot re}\right)}\]
    30.7
  7. Applied simplify to get
    \[\frac{1}{\log base} \cdot \log \color{red}{\left(\sqrt{im \cdot im + re \cdot re}\right)} \leadsto \frac{1}{\log base} \cdot \log \color{blue}{\left(\sqrt{{im}^2 + re \cdot re}\right)}\]
    30.7

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))))