Average Error: 29.3 → 29.3
Time: 1.2s
Precision: binary64
\[\left(-b\right) + \sqrt{b \cdot b - a}\]
\[\sqrt{b \cdot b - a} - b\]

Error

Bits error versus b

Bits error versus a

Derivation

  1. Initial program 29.3

    \[\left(-b\right) + \sqrt{b \cdot b - a}\]
  2. Simplified29.3

    \[\leadsto \color{blue}{\sqrt{b \cdot b - a} - b}\]
  3. Final simplification29.3

    \[\leadsto \sqrt{b \cdot b - a} - b\]

Reproduce

herbie shell --seed 2020153 
(FPCore (b a)
  :name "(+ (- b) (sqrt (- (* b b) a)))"
  :precision binary64
  (+ (neg b) (sqrt (- (* b b) a))))