Average Error: 32.9 → 14.1
Time: 45.3s
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 -3.620921759365202:\\ \;\;\;\;\frac{\frac{{\left(\frac{-1}{x.im}\right)}^{\left(-y.re\right)}}{\sqrt[3]{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}}{\sqrt[3]{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}\\ \mathbf{if}\;x.im \le -6.14716397985538 \cdot 10^{-192}:\\ \;\;\;\;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 -2.847095670678806 \cdot 10^{-307}:\\ \;\;\;\;\frac{\frac{{\left(\frac{-1}{x.im}\right)}^{\left(-y.re\right)}}{\sqrt[3]{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}}}{\sqrt[3]{e^{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 3 regimes
  2. if x.im < -3.620921759365202 or -6.14716397985538e-192 < x.im < -2.847095670678806e-307

    1. Initial program 38.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 23.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 simplify27.8

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

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

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

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

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

    if -3.620921759365202 < x.im < -6.14716397985538e-192

    1. Initial program 21.1

      \[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 14.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 simplify19.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. Using strategy rm
    5. Applied pow-exp18.9

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

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

      \[\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-exp14.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 -2.847095670678806e-307 < x.im

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

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

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

Runtime

Time bar (total: 45.3s)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' 
(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)))))