Average Error: 34.0 → 10.4
Time: 4.8s
Precision: binary64
\[\]
\[\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if b_2 < -3.4711307374776032e95

    1. Initial program 47.1

      \[\]
    2. Simplified47.1

      \[\leadsto \]
    3. Using strategy rm
    4. Applied div-sub47.1

      \[\leadsto \]
    5. Taylor expanded around -inf 3.6

      \[\leadsto \]
    6. Simplified3.6

      \[\leadsto \]

    if -3.4711307374776032e95 < b_2 < 3.55555551340401221e-28

    1. Initial program 15.0

      \[\]
    2. Simplified15.0

      \[\leadsto \]
    3. Using strategy rm
    4. Applied clear-num15.1

      \[\leadsto \]

    if 3.55555551340401221e-28 < b_2

    1. Initial program 54.5

      \[\]
    2. Simplified54.5

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

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020192 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  :precision binary64
  (/ (+ (neg b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))