\[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Test:
math.log/2 on complex, imaginary part
Bits:
128 bits
Bits error versus re
Bits error versus im
Bits error versus base
Time: 7.8 s
Input Error: 14.8
Output Error: 0.4
Log:
Profile: 🕒
\(\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}\)
  1. Started with
    \[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    14.8
  2. Applied simplify to get
    \[\color{red}{\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}} \leadsto \color{blue}{\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}}\]
    0.4

  3. Removed slow pow expressions

Original test:


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