Average Error: 33.2 → 27.7
Time: 1.4m
Precision: 64
Internal Precision: 2176
\[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 \sin \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.re \le -4.99277193710983 \cdot 10^{+208}:\\ \;\;\;\;\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\\ \mathbf{if}\;x.re \le -5.672017592203037 \cdot 10^{+156}:\\ \;\;\;\;\frac{{\left(-x.im\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{if}\;x.re \le -4.876934384207496 \cdot 10^{-114}:\\ \;\;\;\;\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)}{\frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \left(1 + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)}{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re}}}\\ \mathbf{if}\;x.re \le 9.627324993670137 \cdot 10^{-171}:\\ \;\;\;\;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 \sin \left(\log \left(\left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right) \cdot \sqrt[3]{\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)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right)}{{\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 4 regimes
  2. if x.re < -4.99277193710983e+208 or -5.672017592203037e+156 < x.re < -4.876934384207496e-114

    1. Initial program 30.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 \sin \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 -inf 18.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 \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Applied simplify23.9

      \[\leadsto \color{blue}{\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\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}}}}\]
    4. Taylor expanded around 0 23.4

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

    if -4.99277193710983e+208 < x.re < -5.672017592203037e+156

    1. Initial program 62.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 \sin \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 -inf 34.3

      \[\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 \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Applied simplify37.6

      \[\leadsto \color{blue}{\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\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}}}}\]
    4. Taylor expanded around -inf 33.9

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

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

    if -4.876934384207496e-114 < x.re < 9.627324993670137e-171

    1. Initial program 28.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 \sin \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. Using strategy rm
    3. Applied add-cube-cbrt28.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 \sin \left(\log \color{blue}{\left(\left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right) \cdot \sqrt[3]{\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)\]

    if 9.627324993670137e-171 < x.re

    1. Initial program 35.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 \sin \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 inf 24.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 \sin \left(\log \color{blue}{x.re} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Applied simplify29.4

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

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))