Average Error: 33.0 → 13.4
Time: 43.1s
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.6027616921874595 \cdot 10^{-224}:\\ \;\;\;\;\frac{{\left(\frac{-1}{x.im}\right)}^{\left(-y.re\right)}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{if}\;x.im \le 2.3121315604054924 \cdot 10^{-249}:\\ \;\;\;\;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 1.3148291958115144 \cdot 10^{-177}:\\ \;\;\;\;\frac{{x.im}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{if}\;x.im \le 4.9733483225402754 \cdot 10^{+135}:\\ \;\;\;\;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{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 < -1.6027616921874595e-224

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

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

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

      \[\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}}}}\]

    if -1.6027616921874595e-224 < x.im < 2.3121315604054924e-249 or 1.3148291958115144e-177 < x.im < 4.9733483225402754e+135

    1. Initial program 23.7

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

      \[\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.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. Using strategy rm
    5. Applied pow-exp19.0

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

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

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

      \[\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.3121315604054924e-249 < x.im < 1.3148291958115144e-177 or 4.9733483225402754e+135 < x.im

    1. Initial program 51.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 28.7

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

      \[\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: 43.1s)Debug logProfile

herbie shell --seed '#(1070131407 1246090267 3027482374 2150728003 2026520792 2347815650)' 
(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)))))