Average Error: 32.7 → 15.3
Time: 48.9s
Precision: 64
Internal Precision: 1344
\[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)\]
\[\begin{array}{l} \mathbf{if}\;x.im \le -2.1659480938715 \cdot 10^{-310}:\\ \;\;\;\;\frac{{\left(-x.im\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{if}\;x.im \le 3.714180074609937 \cdot 10^{-121} \lor \neg \left(x.im \le 1.106169874404692 \cdot 10^{-70}\right):\\ \;\;\;\;\frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x.re}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \end{array}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x.im < -2.1659480938715e-310

    1. Initial program 33.4

      \[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)\]
    2. Taylor expanded around 0 19.9

      \[\leadsto 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 \color{blue}{1}\]
    3. Applied simplify24.0

      \[\leadsto \color{blue}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}}\]
    4. Taylor expanded around -inf 14.6

      \[\leadsto {\color{blue}{\left(-1 \cdot x.im\right)}}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\]
    5. Applied simplify15.0

      \[\leadsto \color{blue}{\frac{{\left(-x.im\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]

    if -2.1659480938715e-310 < x.im < 3.714180074609937e-121 or 1.106169874404692e-70 < x.im

    1. Initial program 33.4

      \[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)\]
    2. Taylor expanded around 0 19.9

      \[\leadsto 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 \color{blue}{1}\]
    3. Applied simplify23.7

      \[\leadsto \color{blue}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}}\]
    4. Taylor expanded around inf 13.9

      \[\leadsto {\color{blue}{x.im}}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\]
    5. Applied simplify14.4

      \[\leadsto \color{blue}{\frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]

    if 3.714180074609937e-121 < x.im < 1.106169874404692e-70

    1. Initial program 18.2

      \[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)\]
    2. Taylor expanded around 0 12.2

      \[\leadsto 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 \color{blue}{1}\]
    3. Applied simplify16.0

      \[\leadsto \color{blue}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}}\]
    4. Taylor expanded around 0 28.6

      \[\leadsto {\color{blue}{x.re}}^{y.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\]
    5. Applied simplify29.1

      \[\leadsto \color{blue}{\frac{{x.re}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    6. Using strategy rm
    7. Applied pow-exp28.6

      \[\leadsto \frac{{x.re}^{y.re}}{\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}\]
  3. Recombined 3 regimes into one program.
  4. Applied simplify15.3

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;x.im \le -2.1659480938715 \cdot 10^{-310}:\\ \;\;\;\;\frac{{\left(-x.im\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{if}\;x.im \le 3.714180074609937 \cdot 10^{-121} \lor \neg \left(x.im \le 1.106169874404692 \cdot 10^{-70}\right):\\ \;\;\;\;\frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x.re}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \end{array}}\]

Runtime

Time bar (total: 48.9s)Debug logProfile

herbie shell --seed 2018193 
(FPCore (x.re x.im y.re y.im)
  :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)))))