Average Error: 33.4 → 6.4
Time: 27.6min
Precision: binary64
\[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}\;y.re \le -1608.94408824502466:\\ \;\;\;\;e^{\log \left(\log \left(e^{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \le 4.1576628687891882 \cdot 10^{80}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{x.re}{-1}\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.im + \left(\frac{1}{2} \cdot {y.im}^{2}\right) \cdot \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 y.re < -1608.94408824502466

    1. Initial program 36.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 0.6

      \[\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. Using strategy rm
    4. Applied add-log-exp2.4

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

    if -1608.94408824502466 < y.re < 4.1576628687891882e80

    1. Initial program 34.0

      \[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 29.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. Taylor expanded around -inf 33.9

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

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

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

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

      \[\leadsto e^{\color{blue}{0} - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1\]

    if 4.1576628687891882e80 < y.re

    1. Initial program 17.4

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

      \[\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. Taylor expanded around -inf 30.3

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

      \[\leadsto \color{blue}{\frac{{\left(\frac{x.re}{-1}\right)}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot 1\]
    5. Taylor expanded around 0 6.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \le -1608.94408824502466:\\ \;\;\;\;e^{\log \left(\log \left(e^{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \le 4.1576628687891882 \cdot 10^{80}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{x.re}{-1}\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(y.im + \left(\frac{1}{2} \cdot {y.im}^{2}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020181 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  :precision binary64
  (* (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)))))