\[\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: 6.6 s
Input Error: 30.8
Output Error: 0.3
Log:
Profile: 🕒
\(\log_* (1 + (e^{\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}} - 1)^*)\)
  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}\]
    30.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.3
  3. Using strategy rm
    0.3
  4. Applied log1p-expm1-u to get
    \[\color{red}{\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}} \leadsto \color{blue}{\log_* (1 + (e^{\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}} - 1)^*)}\]
    0.3

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