Average Error: 33.0 → 8.6
Time: 11.6s
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 < 4.892073360187566e-310

    1. Initial program 31.9

      \[\]
    2. Taylor expanded around 0 17.0

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

      \[\leadsto \]
    4. Simplified5.7

      \[\leadsto \]

    if 4.892073360187566e-310 < x.re

    1. Initial program 34.0

      \[\]
    2. Taylor expanded around 0 21.3

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

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(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)))))