Average Error: 30.5 → 0.0
Time: 2.2m
Precision: 64
Internal Precision: 128
\[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)\]
\[\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 e^{y.re \cdot \log \left(\sqrt{x.re^2 + x.im^2}^*\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\]

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 30.5

    \[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. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019089 +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)))))