\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
Test:
powComplex, imaginary part
Bits:
128 bits
Bits error versus x.re
Bits error versus x.im
Bits error versus y.re
Bits error versus y.im
Time: 24.6 s
Input Error: 32.7
Output Error: 4.3
Log:
Profile: 🕒
\(\frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot {\left(\sqrt[3]{\sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right)}^3\)
  1. Started with
    \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    32.7
  2. Applied simplify to get
    \[\color{red}{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \leadsto \color{blue}{\frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\]
    4.7
  3. Using strategy rm
    4.7
  4. Applied add-cube-cbrt to get
    \[\frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \color{red}{\sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)} \leadsto \frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \color{blue}{{\left(\sqrt[3]{\sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right)}^3}\]
    5.2
  5. Using strategy rm
    5.2
  6. Applied pow-exp to get
    \[\frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{\color{red}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}} \cdot {\left(\sqrt[3]{\sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right)}^3 \leadsto \frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot {\left(\sqrt[3]{\sin \left((y.im * \left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right)}^3\]
    4.3

  7. Removed slow pow expressions

Original test:


(lambda ((x.re default) (x.im default) (y.re default) (y.im default))
  #:name "powComplex, imaginary part"
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))