Average Error: 28.3 → 0.5
Time: 6.0s
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{\frac{4 \cdot \left(a \cdot \left(-c\right)\right)}{b + \sqrt{\left({b}^{4} - 4 \cdot \left(a \cdot \left(c \cdot \left(4 \cdot \left(a \cdot c\right)\right)\right)\right)\right) \cdot \frac{1}{4 \cdot \left(a \cdot c\right) + b \cdot b}}}}{a \cdot 2}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.3

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

    \[\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--28.4

    \[\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.5

    \[\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.5

    \[\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 flip--0.5

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

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

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

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

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

Reproduce

herbie shell --seed 2020184 
(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)))