Average Error: 32.5 → 11.3
Time: 40.7s
Precision: 64
Internal Precision: 1408
\[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 -1.5983183330782787 \cdot 10^{-64}:\\ \;\;\;\;\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.4566471790657564 \cdot 10^{-283}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;x.im \le -8.60765907993334 \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{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - 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

Derivation

  1. Split input into 3 regimes
  2. if x.im < -1.5983183330782787e-64 or -3.4566471790657564e-283 < x.im < -8.60765907993334e-310

    1. Initial program 35.9

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

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

      \[\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)}}\]
    5. Applied simplify11.6

      \[\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 -1.5983183330782787e-64 < x.im < -3.4566471790657564e-283

    1. Initial program 25.8

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

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

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

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

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

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

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

    if -8.60765907993334e-310 < x.im

    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 20.1

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

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

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

      \[\leadsto \frac{{x.im}^{y.re}}{\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}\]
    7. Applied pow-to-exp14.3

      \[\leadsto \frac{\color{blue}{e^{\log x.im \cdot y.re}}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\]
    8. Applied div-exp9.3

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

Runtime

Time bar (total: 40.7s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' 
(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)))))