Average Error: 32.4 → 24.0
Time: 1.1m
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.320810918491509 \cdot 10^{-307}:\\ \;\;\;\;\frac{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(-x.im\right)\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(y.im \cdot \log x.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.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 2 regimes
  2. if x.im < 6.320810918491509e-307

    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. Applied simplify35.9

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

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

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

    if 6.320810918491509e-307 < 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. Applied simplify35.2

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

      \[\leadsto \frac{\cos \left(y.im \cdot \log \color{blue}{x.im} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed '#(1063027428 1192549564 1443466578 604016274 3637110559 1698629644)' 
(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)))))