Average Error: 33.0 → 8.7
Time: 12.0s
Precision: binary64
\[\]
\[\]

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 x.re < -3.41304251363267e-311

    1. Initial program 31.7

      \[\]
    2. Taylor expanded around 0 17.0

      \[\leadsto \]
    3. Taylor expanded around -inf 5.9

      \[\leadsto \]
    4. Simplified5.9

      \[\leadsto \]

    if -3.41304251363267e-311 < x.re

    1. Initial program 34.4

      \[\]
    2. Taylor expanded around 0 20.8

      \[\leadsto \]
    3. Taylor expanded around inf 11.5

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.7

    \[\leadsto \]

Reproduce

herbie shell --seed 2020181 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  :precision binary64
  (* (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)))))