Average Error: 35.7 → 17.6
Time: 2.8m
Precision: 64
Internal Precision: 1920
\[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 8.88826629259068 \cdot 10^{-299}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.re\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \frac{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}{\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.re < 8.88826629259068e-299

    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 \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. Applied simplify34.1

      \[\leadsto \color{blue}{\frac{\sin \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. Using strategy rm
    4. Applied add-cbrt-cube38.2

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\sin \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) \cdot \sin \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)\right) \cdot \sin \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}}}\]
    5. Applied simplify38.2

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

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

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

    if 8.88826629259068e-299 < x.re

    1. Initial program 37.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 \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. Applied simplify35.8

      \[\leadsto \color{blue}{\frac{\sin \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 0 18.7

      \[\leadsto \frac{\color{blue}{\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}}{\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: 2.8m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(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)))))