\[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: 17.7 s
Input Error: 43.2
Output Error: 21.0
Log:
Profile: 🕒
\(\frac{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\)
  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)\]
    43.2
  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{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}}\]
    44.7
  3. Applied taylor to get
    \[\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right)\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
    42.3
  4. Taylor expanded around 0 to get
    \[\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\color{red}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right)\right)}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right)\right)}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
    42.3
  5. Applied taylor to get
    \[\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right)\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot 0\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
    41.3
  6. Taylor expanded around 0 to get
    \[\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \color{red}{0}\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \color{blue}{0}\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
    41.3
  7. Applied simplify to get
    \[\color{red}{\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot 0\right)}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}} \leadsto \color{blue}{\frac{\cos \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}}\]
    41.3
  8. Applied taylor to get
    \[\frac{\cos \left(\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}} \leadsto \frac{1}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\]
    21.0
  9. Taylor expanded around 0 to get
    \[\frac{\color{red}{1}}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}} \leadsto \frac{\color{blue}{1}}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\]
    21.0
  10. Applied simplify to get
    \[\frac{1}{\frac{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}} \leadsto \frac{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\]
    21.0

  11. Applied final simplification
  12. Applied simplify to get
    \[\color{red}{\frac{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \leadsto \color{blue}{\frac{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\]
    21.0

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