Average Error: 33.2 → 5.5
Time: 42.1s
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}\;\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{1 + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)} \le -6.6319782670508 \cdot 10^{-310}:\\ \;\;\;\;\left(\left(\sqrt[3]{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)} \cdot \sqrt[3]{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right) \cdot \sqrt[3]{\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right)}\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{if}\;\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{1 + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)} \le 3.9402580771062 \cdot 10^{-310}:\\ \;\;\;\;\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{1 + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)}\\ \mathbf{if}\;\cos \left((y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{1 + \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im + \frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^{2} \cdot {y.im}^{2}\right)\right)} \le 1.0000100717102895:\\ \;\;\;\;\cos \left(\left(\sqrt[3]{(y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*} \cdot \sqrt[3]{(y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*}\right) \cdot \sqrt[3]{(y.im \cdot \left(\log \left(\sqrt{x.re^2 + x.im^2}^*\right)\right) + \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right))_*}\right) \cdot \frac{{\left(\sqrt{x.re^2 + x.im^2}^*\right)}^{y.re}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;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)\\ \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 4 regimes
  2. if (* (cos (fma y.im (log (hypot x.re x.im)) (* y.re (atan2 x.im x.re)))) (/ (pow (hypot x.re x.im) y.re) (+ 1 (+ (* (atan2 x.im x.re) y.im) (* 1/2 (* (pow (atan2 x.im x.re) 2) (pow y.im 2))))))) < -6.6319782670508e-310

    1. Initial program 38.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 simplify21.5

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

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

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

    if -6.6319782670508e-310 < (* (cos (fma y.im (log (hypot x.re x.im)) (* y.re (atan2 x.im x.re)))) (/ (pow (hypot x.re x.im) y.re) (+ 1 (+ (* (atan2 x.im x.re) y.im) (* 1/2 (* (pow (atan2 x.im x.re) 2) (pow y.im 2))))))) < 3.9402580771062e-310

    1. Initial program 31.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. Applied simplify6.8

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

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

    if 3.9402580771062e-310 < (* (cos (fma y.im (log (hypot x.re x.im)) (* y.re (atan2 x.im x.re)))) (/ (pow (hypot x.re x.im) y.re) (+ 1 (+ (* (atan2 x.im x.re) y.im) (* 1/2 (* (pow (atan2 x.im x.re) 2) (pow y.im 2))))))) < 1.0000100717102895

    1. Initial program 33.0

      \[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 simplify2.6

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

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

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

    if 1.0000100717102895 < (* (cos (fma y.im (log (hypot x.re x.im)) (* y.re (atan2 x.im x.re)))) (/ (pow (hypot x.re x.im) y.re) (+ 1 (+ (* (atan2 x.im x.re) y.im) (* 1/2 (* (pow (atan2 x.im x.re) 2) (pow y.im 2)))))))

    1. Initial program 39.0

      \[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)\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 42.1s)Debug logProfile

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