Average Error: 19.2 → 6.5
Time: 6.6s
Precision: binary64
\[\]
\[\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if b < -6.0329111911809092e90

    1. Initial program 45.1

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

      \[\leadsto \]
    3. Simplified5.2

      \[\leadsto \]
    4. Taylor expanded around 0 5.0

      \[\leadsto \]
    5. Simplified5.0

      \[\leadsto \]
    6. Using strategy rm
    7. Applied div-inv5.0

      \[\leadsto \]
    8. Simplified5.0

      \[\leadsto \]

    if -6.0329111911809092e90 < b < -2.6862915384868101e-246 or 1.35418184362108912e101 < b

    1. Initial program 18.1

      \[\]
    2. Taylor expanded around inf 6.9

      \[\leadsto \]
    3. Simplified5.1

      \[\leadsto \]

    if -2.6862915384868101e-246 < b < 1.35418184362108912e101

    1. Initial program 9.0

      \[\]
    2. Using strategy rm
    3. Applied flip-+9.0

      \[\leadsto \]
    4. Simplified9.1

      \[\leadsto \]
    5. Simplified9.0

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (a b c)
  :name "jeff quadratic root 2"
  :precision binary64
  (if (>= b 0.0) (/ (* 2.0 c) (- (neg b) (sqrt (- (* b b) (* (* 4.0 a) c))))) (/ (+ (neg b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))