Average Error: 32.8 → 3.6
Time: 36.3s
Precision: 64
Internal Precision: 1344
\[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{\log \left(\sqrt[3]{e^{\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]{e^{\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) + \log \left(\sqrt[3]{e^{\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)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \log \left(\sqrt{x.im^2 + x.re^2}^*\right) \cdot y.re}} \le 0.9999986149604796:\\ \;\;\;\;\frac{\log \left(\sqrt[3]{e^{\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]{e^{\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) + \log \left(\sqrt[3]{e^{\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)}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \log \left(\sqrt{x.im^2 + x.re^2}^*\right) \cdot y.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\sqrt{x.im^2 + x.re^2}^*\right)}^{y.re}}{{\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 2 regimes
  2. if (/ (+ (log (* (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))) (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))))) (log (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))))) (exp (- (* y.im (atan2 x.im x.re)) (* (log (hypot x.im x.re)) y.re)))) < 0.9999986149604796

    1. Initial program 34.1

      \[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 simplify15.3

      \[\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-exp-log15.3

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

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

      \[\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)}{\color{blue}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \log \left(\sqrt{x.im^2 + x.re^2}^*\right) \cdot y.re}}}\]
    8. Using strategy rm
    9. Applied add-log-exp5.3

      \[\leadsto \frac{\color{blue}{\log \left(e^{\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)}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} - \log \left(\sqrt{x.im^2 + x.re^2}^*\right) \cdot y.re}}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt5.3

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

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

    if 0.9999986149604796 < (/ (+ (log (* (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))) (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))))) (log (cbrt (exp (cos (fma (log (hypot x.im x.re)) y.im (* (atan2 x.im x.re) y.re))))))) (exp (- (* y.im (atan2 x.im x.re)) (* (log (hypot x.im x.re)) y.re))))

    1. Initial program 30.7

      \[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 simplify0.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. Taylor expanded around 0 0.8

      \[\leadsto \frac{\color{blue}{1}}{\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}}}\]
    4. Applied simplify0.8

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

Runtime

Time bar (total: 36.3s)Debug logProfile

herbie shell --seed '#(1071119240 1686926585 3481876196 78132896 2080707795 3185793749)' +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)))))