Average Error: 33.9 → 22.5
Time: 9.7s
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 < -2.89784192826185e-311

    1. Initial program 32.3

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

      \[\leadsto \]
    3. Simplified20.2

      \[\leadsto \]

    if -2.89784192826185e-311 < x.re

    1. Initial program 35.4

      \[\]
    2. Taylor expanded around inf 24.6

      \[\leadsto \]
    3. Simplified24.6

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

    \[\leadsto \]

Reproduce

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