Average Error: 32.7 → 9.2
Time: 45.5s
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{\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(\left(\sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\right) \cdot \sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\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}}} = -\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{e^{\frac{\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}}{y.im}}}{{\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{\left(\left(\sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\right) \cdot \sqrt[3]{{\left(\sqrt[3]{e^{y.im}} \cdot \sqrt[3]{e^{y.im}}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\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}}}\\ \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 (/ (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))) (/ (* (* (* (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re))) (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re)))) (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re)))) (pow (cbrt (exp y.im)) (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))

    1. Initial program 58.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 \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 simplify62.8

      \[\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 inf 56.9

      \[\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}{e^{\frac{\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}}{y.im}}}}{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}}\]

    if (/ (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))) (/ (* (* (* (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re))) (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re)))) (cbrt (pow (* (cbrt (exp y.im)) (cbrt (exp y.im))) (atan2 x.im x.re)))) (pow (cbrt (exp y.im)) (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))

    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 simplify8.9

      \[\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-cbrt8.9

      \[\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-down8.9

      \[\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}}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt8.9

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

Runtime

Time bar (total: 45.5s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' +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)))))