Average Error: 28.9 → 0.4
Time: 5.5s
Precision: binary64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{4 \cdot \left(a \cdot \left(-c\right)\right)}{a \cdot \left(\left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \cdot 2\right)}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.9

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Simplified28.9

    \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}}\]
  3. Using strategy rm
  4. Applied flip--29.0

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} \cdot \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b \cdot b}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} + b}}}{a \cdot 2}\]
  5. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{0 - 4 \cdot \left(a \cdot c\right)}}{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} + b}}{a \cdot 2}\]
  6. Simplified0.4

    \[\leadsto \frac{\frac{0 - 4 \cdot \left(a \cdot c\right)}{\color{blue}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2}\]
  7. Using strategy rm
  8. Applied div-inv0.5

    \[\leadsto \frac{\color{blue}{\left(0 - 4 \cdot \left(a \cdot c\right)\right) \cdot \frac{1}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}}{a \cdot 2}\]
  9. Applied associate-/l*0.5

    \[\leadsto \color{blue}{\frac{0 - 4 \cdot \left(a \cdot c\right)}{\frac{a \cdot 2}{\frac{1}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}}}\]
  10. Simplified0.4

    \[\leadsto \frac{0 - 4 \cdot \left(a \cdot c\right)}{\color{blue}{a \cdot \left(\left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \cdot 2\right)}}\]
  11. Final simplification0.4

    \[\leadsto \frac{4 \cdot \left(a \cdot \left(-c\right)\right)}{a \cdot \left(\left(b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right) \cdot 2\right)}\]

Reproduce

herbie shell --seed 2020182 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (neg b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))