Average Error: 32.3 → 13.4
Time: 44.6s
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 -6.8592051560094 \cdot 10^{-310}:\\ \;\;\;\;\left(\left(\sqrt[3]{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)}} \cdot \sqrt[3]{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)}}\right) \cdot \sqrt[3]{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)}}\right) \cdot {\left(-x.im\right)}^{y.re}\\ \mathbf{if}\;x.im \le 27600853.888346687:\\ \;\;\;\;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 x.im \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \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 < -6.8592051560094e-310

    1. Initial program 32.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. Taylor expanded around 0 19.8

      \[\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.8

      \[\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. Using strategy rm
    5. Applied add-log-exp24.1

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

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

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

      \[\leadsto \color{blue}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{\left(-y.im\right)} \cdot {\left(-x.im\right)}^{y.re}}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt14.8

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

    if -6.8592051560094e-310 < x.im < 27600853.888346687

    1. Initial program 25.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 16.6

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

    if 27600853.888346687 < x.im

    1. Initial program 39.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 21.5

      \[\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 simplify25.5

      \[\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 7.0

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

      \[\leadsto \color{blue}{\frac{{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.

Runtime

Time bar (total: 44.6s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' 
(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)))))