Average Error: 33.2 → 5.3
Time: 55.5s
Precision: 64
Internal precision: 128
\[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 -4.0569569757455935 \cdot 10^{-11}:\\ \;\;\;\;\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 -1.0432625670633628 \cdot 10^{-79}:\\ \;\;\;\;e^{\log \left(\sqrt{{x.re}^2 + {x.im}^2}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;x.im \le -1.2718565120164916 \cdot 10^{-269}:\\ \;\;\;\;\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 1.4591773572605082 \cdot 10^{-06}:\\ \;\;\;\;e^{\log \left(\sqrt{{x.re}^2 + {x.im}^2}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \end{array}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Split input into 3 regimes.
  2. if x.im < -4.0569569757455935e-11 or -1.0432625670633628e-79 < x.im < -1.2718565120164916e-269

    1. Initial program 35.6

      \[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. Applied simplify 35.2

      \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + {x.re}^2}\right)\right) \cdot \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)}}}\]
    3. Applied taylor 22.4

      \[\leadsto 1 \cdot \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)}}\]
    4. Taylor expanded around 0 22.4

      \[\leadsto \color{blue}{1} \cdot \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)}}\]
    5. Applied simplify 22.4

      \[\leadsto \color{blue}{\frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    6. Applied taylor 1.0

      \[\leadsto \frac{{\left(-1 \cdot x.im\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\]
    7. Taylor expanded around -inf 1.0

      \[\leadsto \frac{{\color{blue}{\left(-1 \cdot x.im\right)}}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\]
    8. Applied simplify 1.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 -4.0569569757455935e-11 < x.im < -1.0432625670633628e-79 or -1.2718565120164916e-269 < x.im < 1.4591773572605082e-06

    1. Initial program 26.3

      \[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. Applied simplify 29.8

      \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + {x.re}^2}\right)\right) \cdot \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)}}}\]
    3. Applied taylor 19.6

      \[\leadsto 1 \cdot \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)}}\]
    4. Taylor expanded around 0 19.6

      \[\leadsto \color{blue}{1} \cdot \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)}}\]
    5. Applied simplify 19.6

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

      \[\leadsto \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}\]
    8. Applied add-exp-log 16.6

      \[\leadsto \frac{{\color{blue}{\left(e^{\log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}\right)}}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\]
    9. Applied pow-exp 16.6

      \[\leadsto \frac{\color{blue}{e^{\log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right) \cdot y.re}}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\]
    10. Applied div-exp 13.3

      \[\leadsto \color{blue}{e^{\log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\]
    11. Applied simplify 13.3

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

    if 1.4591773572605082e-06 < x.im

    1. Initial program 39.6

      \[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. Applied simplify 39.6

      \[\leadsto \color{blue}{\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + {x.re}^2}\right)\right) \cdot \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)}}}\]
    3. Applied taylor 22.4

      \[\leadsto 1 \cdot \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)}}\]
    4. Taylor expanded around 0 22.4

      \[\leadsto \color{blue}{1} \cdot \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)}}\]
    5. Applied simplify 22.4

      \[\leadsto \color{blue}{\frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    6. Applied taylor 0.3

      \[\leadsto \frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\]
    7. Taylor expanded around inf 0.3

      \[\leadsto \frac{{\color{blue}{x.im}}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 55.5s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1828363715 751267890 3921464056 2620166927 2943278772 2686039823)'
(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)))))