Average Error: 32.2 → 6.7
Time: 43.3s
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}\;\frac{\left(\sqrt[3]{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)} \cdot \sqrt[3]{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)}\right) \cdot \sqrt[3]{1}}{\frac{{\left({\left(e^{y.im}\right)}^{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}\right)}^{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}}{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}} \le +\infty:\\ \;\;\;\;\frac{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)}{\frac{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)} \cdot {\left(\sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.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^2 + x.re^2}^*\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 (/ (* (* (cbrt (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re)))) (cbrt (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))) (cbrt 1)) (/ (pow (pow (exp y.im) (* (cbrt (atan2 x.im x.re)) (cbrt (atan2 x.im x.re)))) (cbrt (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))) < +inf.0

    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. Applied simplify4.0

      \[\leadsto \color{blue}{\frac{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt4.0

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

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

    if +inf.0 < (/ (* (* (cbrt (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re)))) (cbrt (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))) (cbrt 1)) (/ (pow (pow (exp y.im) (* (cbrt (atan2 x.im x.re)) (cbrt (atan2 x.im x.re)))) (cbrt (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))

    1. Initial program 31.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. Applied simplify63.0

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

      \[\leadsto \frac{\cos \left((\left(\log \left(\sqrt{x.im^2 + x.re^2}^*\right)\right) \cdot y.im + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.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^2 + x.re^2}^*\right)}^{y.re}}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 43.3s)Debug logProfile

herbie shell --seed '#(1070578969 3140398606 632207097 462683394 1189254563 964980650)' +o rules:numerics
(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)))))