\[\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: 9.7 s
Input Error: 14.9
Output Error: 0.6
Log:
Profile: 🕒
\(\frac{\sqrt[3]{\log \left(\sqrt{im^2 + re^2}^*\right)} \cdot \sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2}}{\sqrt[3]{\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}\]
    14.9
  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 \left(\sqrt{im^2 + re^2}^*\right)}{\log base}}\]
    0.4
  3. Using strategy rm
    0.4
  4. Applied add-cbrt-cube to get
    \[\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\color{red}{\log base}} \leadsto \frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\color{blue}{\sqrt[3]{{\left(\log base\right)}^3}}}\]
    0.4
  5. Applied add-cbrt-cube to get
    \[\frac{\color{red}{\log \left(\sqrt{im^2 + re^2}^*\right)}}{\sqrt[3]{{\left(\log base\right)}^3}} \leadsto \frac{\color{blue}{\sqrt[3]{{\left(\log \left(\sqrt{im^2 + re^2}^*\right)\right)}^3}}}{\sqrt[3]{{\left(\log base\right)}^3}}\]
    0.4
  6. Applied cbrt-undiv to get
    \[\color{red}{\frac{\sqrt[3]{{\left(\log \left(\sqrt{im^2 + re^2}^*\right)\right)}^3}}{\sqrt[3]{{\left(\log base\right)}^3}}} \leadsto \color{blue}{\sqrt[3]{\frac{{\left(\log \left(\sqrt{im^2 + re^2}^*\right)\right)}^3}{{\left(\log base\right)}^3}}}\]
    0.4
  7. Applied simplify to get
    \[\sqrt[3]{\color{red}{\frac{{\left(\log \left(\sqrt{im^2 + re^2}^*\right)\right)}^3}{{\left(\log base\right)}^3}}} \leadsto \sqrt[3]{\color{blue}{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^3}}\]
    0.4
  8. Using strategy rm
    0.4
  9. Applied cube-mult to get
    \[\sqrt[3]{\color{red}{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^3}} \leadsto \sqrt[3]{\color{blue}{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}}\]
    0.4
  10. Applied cbrt-prod to get
    \[\color{red}{\sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}} \leadsto \color{blue}{\sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}} \cdot \sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}}}\]
    0.5
  11. Applied simplify to get
    \[\sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}} \cdot \color{red}{\sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base} \cdot \frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}}} \leadsto \sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}} \cdot \color{blue}{\sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2}}\]
    0.5
  12. Using strategy rm
    0.5
  13. Applied cbrt-div to get
    \[\color{red}{\sqrt[3]{\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}}} \cdot \sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2} \leadsto \color{blue}{\frac{\sqrt[3]{\log \left(\sqrt{im^2 + re^2}^*\right)}}{\sqrt[3]{\log base}}} \cdot \sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2}\]
    0.6
  14. Applied associate-*l/ to get
    \[\color{red}{\frac{\sqrt[3]{\log \left(\sqrt{im^2 + re^2}^*\right)}}{\sqrt[3]{\log base}} \cdot \sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2}} \leadsto \color{blue}{\frac{\sqrt[3]{\log \left(\sqrt{im^2 + re^2}^*\right)} \cdot \sqrt[3]{{\left(\frac{\log \left(\sqrt{im^2 + re^2}^*\right)}{\log base}\right)}^2}}{\sqrt[3]{\log base}}}\]
    0.6

  15. Removed slow pow expressions

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