Average Error: 32.9 → 3.4
Time: 23.6s
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)\]
\[\frac{\log \left(\sqrt{e^{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)}}\right) + \log \left(\sqrt{e^{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right))_*\right)}}\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im - y.re \cdot \log \left(\sqrt{x.re^2 + x.im^2}^*\right)}}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Initial program 32.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 \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. Initial simplification9.3

    \[\leadsto \frac{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \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.re^2 + x.im^2}^*\right)}^{y.re}}}\]
  3. Using strategy rm
  4. Applied pow-to-exp9.3

    \[\leadsto \frac{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \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.re^2 + x.im^2}^*\right) \cdot y.re}}}}\]
  5. Applied pow-exp8.5

    \[\leadsto \frac{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \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.re^2 + x.im^2}^*\right) \cdot y.re}}}\]
  6. Applied div-exp3.4

    \[\leadsto \frac{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \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.re^2 + x.im^2}^*\right) \cdot y.re}}}\]
  7. Using strategy rm
  8. Applied add-log-exp3.4

    \[\leadsto \frac{\color{blue}{\log \left(e^{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \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.re^2 + x.im^2}^*\right) \cdot y.re}}\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt3.4

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

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

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

Runtime

Time bar (total: 23.6s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes3.43.43.40.00%
herbie shell --seed 2018339 +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)))))