Average Error: 32.5 → 12.1
Time: 44.6s
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 -6.36508696798025 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \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 2 regimes
  2. if x.im < -6.36508696798025e-310

    1. Initial program 32.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 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}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot {\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}\]
    4. Taylor expanded around -inf 14.3

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

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

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

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

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

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

    if -6.36508696798025e-310 < x.im

    1. Initial program 32.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 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.9

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

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

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

Runtime

Time bar (total: 44.6s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(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)))))