Average Error: 33.7 → 9.2
Time: 8.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 3 regimes
  2. if x.re < -2.89784192826185e-311

    1. Initial program 32.2

      \[\]
    2. Taylor expanded around 0 17.3

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

      \[\leadsto \]
    4. Simplified5.9

      \[\leadsto \]

    if -2.89784192826185e-311 < x.re < 1.3420662967240638e-111 or 2.0538964275531915e-46 < x.re

    1. Initial program 36.8

      \[\]
    2. Taylor expanded around 0 23.1

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

      \[\leadsto \]

    if 1.3420662967240638e-111 < x.re < 2.0538964275531915e-46

    1. Initial program 20.3

      \[\]
    2. Using strategy rm
    3. Applied cos-sum20.3

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

    \[\leadsto \]

Reproduce

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