\[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: 28.2 s
Input Error: 16.3
Output Error: 8.0
Log:
Profile: 🕒
\(\begin{cases} \frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(-x.re\right)}^{y.re}}} & \text{when } x.re \le -3.378624f-13 \\ \frac{\sin \left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{1} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} & \text{when } x.re \le 5.791498f+21 \\ \frac{\log x.re \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{x.re}^{y.re}}} & \text{otherwise} \end{cases}\)

    if x.re < -3.378624f-13

    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)\]
      18.6
    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{\sin \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}}}}\]
      19.1
    3. Applied taylor to get
      \[\frac{\sin \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{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\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}}}\]
      12.0
    4. Taylor expanded around -inf to get
      \[\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \color{red}{\left(-1 \cdot x.re\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{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \color{blue}{\left(-1 \cdot x.re\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}}}\]
      12.0
    5. Applied taylor to get
      \[\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\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{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(-1 \cdot x.re\right)}^{y.re}}}\]
      1.7
    6. Taylor expanded around -inf to get
      \[\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\color{red}{\left(-1 \cdot x.re\right)}}^{y.re}}} \leadsto \frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\color{blue}{\left(-1 \cdot x.re\right)}}^{y.re}}}\]
      1.7
    7. Applied simplify to get
      \[\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-1 \cdot x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(-1 \cdot x.re\right)}^{y.re}}} \leadsto \frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \log \left(-x.re\right) \cdot y.im\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(-x.re\right)}^{y.re}}}\]
      1.7

    8. Applied final simplification

    if -3.378624f-13 < x.re < 5.791498f+21

    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)\]
      12.1
    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{\sin \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}}}}\]
      13.0
    3. Using strategy rm
      13.0
    4. Applied pow-exp to get
      \[\frac{\sin \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}{{\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{\sin \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}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
      12.5
    5. Using strategy rm
      12.5
    6. Applied pow1 to get
      \[\frac{\sin \left(\color{red}{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{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\sin \left(\color{blue}{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{1}} + \log \left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right) \cdot y.im\right)}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
      12.5

    if 5.791498f+21 < 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 \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)\]
      30.9
    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{\sin \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}}}}\]
      30.9
    3. Using strategy rm
      30.9
    4. Applied pow-exp to get
      \[\frac{\sin \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}{{\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{\sin \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}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
      30.9
    5. Applied taylor to get
      \[\frac{\sin \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{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
      17.8
    6. Taylor expanded around 0 to get
      \[\frac{\color{red}{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{\color{blue}{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}}\]
      17.8
    7. Applied taylor to get
      \[\frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\sqrt{{x.re}^2 + x.im \cdot x.im}\right)}^{y.re}}} \leadsto \frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{x.re}^{y.re}}}\]
      3.7
    8. Taylor expanded around inf to get
      \[\frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\color{red}{x.re}}^{y.re}}} \leadsto \frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{\color{blue}{x.re}}^{y.re}}}\]
      3.7
    9. Applied simplify to get
      \[\frac{y.im \cdot \log x.re + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\frac{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}{{x.re}^{y.re}}} \leadsto \frac{\log x.re \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{x.re}^{y.re}}}\]
      3.7

    10. Applied final simplification

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