Average Error: 34.1 → 10.0
Time: 5.9s
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 < -1.38476143180922117e134

    1. Initial program 56.8

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

      \[\leadsto \]
    3. Simplified2.4

      \[\leadsto \]

    if -1.38476143180922117e134 < b < 5.1943629106266941e-122

    1. Initial program 11.3

      \[\]

    if 5.1943629106266941e-122 < b

    1. Initial program 51.6

      \[\]
    2. Taylor expanded around inf 10.8

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (a b c)
  :name "Quadratic roots, full range"
  :precision binary64
  (/ (+ (neg b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))