\[\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.3 s
Input Error: 31.4
Output Error: 0.3
Log:
Profile: 🕒
\(\frac{\tan^{-1}_* \frac{im}{re}}{\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}\]
    31.4
  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 clear-num to get
    \[\color{red}{\frac{\tan^{-1}_* \frac{im}{re} - 0}{\log base}} \leadsto \color{blue}{\frac{1}{\frac{\log base}{\tan^{-1}_* \frac{im}{re} - 0}}}\]
    0.5
  5. Using strategy rm
    0.5
  6. Applied flip-- to get
    \[\frac{1}{\frac{\log base}{\color{red}{\tan^{-1}_* \frac{im}{re} - 0}}} \leadsto \frac{1}{\frac{\log base}{\color{blue}{\frac{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2}{\tan^{-1}_* \frac{im}{re} + 0}}}}\]
    8.0
  7. Applied associate-/r/ to get
    \[\frac{1}{\color{red}{\frac{\log base}{\frac{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2}{\tan^{-1}_* \frac{im}{re} + 0}}}} \leadsto \frac{1}{\color{blue}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2} \cdot \left(\tan^{-1}_* \frac{im}{re} + 0\right)}}\]
    8.2
  8. Applied associate-/r* to get
    \[\color{red}{\frac{1}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2} \cdot \left(\tan^{-1}_* \frac{im}{re} + 0\right)}} \leadsto \color{blue}{\frac{\frac{1}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2}}}{\tan^{-1}_* \frac{im}{re} + 0}}\]
    8.2
  9. Applied taylor to get
    \[\frac{\frac{1}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2 - {0}^2}}}{\tan^{-1}_* \frac{im}{re} + 0} \leadsto \frac{\frac{1}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2}}}{\tan^{-1}_* \frac{im}{re} + 0}\]
    8.2
  10. Taylor expanded around 0 to get
    \[\frac{\frac{1}{\color{red}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2}}}}{\tan^{-1}_* \frac{im}{re} + 0} \leadsto \frac{\frac{1}{\color{blue}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2}}}}{\tan^{-1}_* \frac{im}{re} + 0}\]
    8.2
  11. Applied simplify to get
    \[\frac{\frac{1}{\frac{\log base}{{\left(\tan^{-1}_* \frac{im}{re}\right)}^2}}}{\tan^{-1}_* \frac{im}{re} + 0} \leadsto \frac{\frac{\tan^{-1}_* \frac{im}{re} \cdot \tan^{-1}_* \frac{im}{re}}{\log base}}{\tan^{-1}_* \frac{im}{re}}\]
    8.0

  12. Applied final simplification
  13. Applied simplify to get
    \[\color{red}{\frac{\frac{\tan^{-1}_* \frac{im}{re} \cdot \tan^{-1}_* \frac{im}{re}}{\log base}}{\tan^{-1}_* \frac{im}{re}}} \leadsto \color{blue}{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
    0.3

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