\[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 \cos \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, real 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: 30.9 s
Input Error: 31.4
Output Error: 1.3
Log:
Profile: 🕒
\(\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 \left(\cos \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \log \left(e^{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\right)\)
  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 \cos \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)\]
    31.4
  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 \cos \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 \cos \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)}\]
    1.3
  3. Using strategy rm
    1.3
  4. Applied fma-udef 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 \cos \color{red}{\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 \cos \color{blue}{\left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\]
    1.3
  5. Applied cos-sum 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}{\cos \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\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(\cos \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\]
    1.3
  6. Using strategy rm
    1.3
  7. Applied add-log-exp 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 \left(\cos \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \color{red}{\sin \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 \left(\cos \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) - \sin \left(y.im \cdot \log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot \color{blue}{\log \left(e^{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}\right)\]
    1.3

Original test:


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