Average Error: 33.0 → 22.1
Time: 14.1s
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 < -1.58933453831505e-310

    1. Initial program 31.8

      \[\]
    2. Taylor expanded around -inf 19.8

      \[\leadsto \]
    3. Simplified19.8

      \[\leadsto \]

    if -1.58933453831505e-310 < x.re

    1. Initial program 34.1

      \[\]
    2. Taylor expanded around inf 24.4

      \[\leadsto \]
    3. Simplified24.4

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.1

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  :precision binary64
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))