Average Error: 33.5 → 10.7
Time: 13.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 3 regimes
  2. if x.re < -3.8865966887532446e-308

    1. Initial program 32.0

      \[\]
    2. Taylor expanded around 0 18.6

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

      \[\leadsto \]
    4. Simplified5.8

      \[\leadsto \]

    if -3.8865966887532446e-308 < x.re < 1.4668072428131629e-52

    1. Initial program 25.3

      \[\]
    2. Taylor expanded around 0 14.1

      \[\leadsto \]

    if 1.4668072428131629e-52 < x.re

    1. Initial program 41.2

      \[\]
    2. Taylor expanded around 0 26.3

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

      \[\leadsto \]
    4. Simplified15.9

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

    \[\leadsto \]

Reproduce

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