Average Error: 28.5 → 0.3
Time: 36.8min
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{c}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b}}{2} \cdot 4\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.5

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

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

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

    \[\leadsto \frac{\frac{\frac{\color{blue}{-\left(4 \cdot a\right) \cdot c}}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b}}{2}}{a}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\frac{-\left(4 \cdot a\right) \cdot c}{\color{blue}{1 \cdot \left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b\right)}}}{2}}{a}\]
  8. Applied distribute-lft-neg-in0.5

    \[\leadsto \frac{\frac{\frac{\color{blue}{\left(-4 \cdot a\right) \cdot c}}{1 \cdot \left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b\right)}}{2}}{a}\]
  9. Applied times-frac0.3

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

    \[\leadsto \frac{\frac{\color{blue}{\left(-4 \cdot a\right)} \cdot \frac{c}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b}}{2}}{a}\]
  11. Using strategy rm
  12. Applied distribute-lft-neg-out0.3

    \[\leadsto \frac{\frac{\color{blue}{-\left(4 \cdot a\right) \cdot \frac{c}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b}}}{2}}{a}\]
  13. Applied distribute-frac-neg0.3

    \[\leadsto \frac{\color{blue}{-\frac{\left(4 \cdot a\right) \cdot \frac{c}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + b}}{2}}}{a}\]
  14. Applied distribute-frac-neg0.3

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

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

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

Reproduce

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