Average Error: 28.5 → 0.3
Time: 4.3m
Precision: 64
Internal Precision: 128
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{c \cdot a}{\frac{a}{-2}}}{b + \sqrt{(\left(c \cdot a\right) \cdot -4 + \left(b \cdot b\right))_*}}\]

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{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} - b}{2}}{a}}\]
  3. Using strategy rm
  4. Applied flip--28.5

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

    \[\leadsto \frac{\frac{\frac{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} + b}}{2}}{\color{blue}{1 \cdot a}}\]
  7. Applied *-un-lft-identity28.5

    \[\leadsto \frac{\frac{\frac{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} + b}}{\color{blue}{1 \cdot 2}}}{1 \cdot a}\]
  8. Applied div-inv28.5

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

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} - b \cdot b}{1} \cdot \frac{\frac{1}{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} + b}}{2}}}{1 \cdot a}\]
  10. Applied times-frac28.5

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

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

    \[\leadsto \left(\left(c \cdot a\right) \cdot -4\right) \cdot \color{blue}{\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}}\]
  13. Using strategy rm
  14. Applied pow10.5

    \[\leadsto \left(\left(c \cdot a\right) \cdot -4\right) \cdot \color{blue}{{\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}}\]
  15. Applied pow10.5

    \[\leadsto \left(\left(c \cdot a\right) \cdot \color{blue}{{-4}^{1}}\right) \cdot {\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}\]
  16. Applied pow10.5

    \[\leadsto \left(\left(c \cdot \color{blue}{{a}^{1}}\right) \cdot {-4}^{1}\right) \cdot {\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}\]
  17. Applied pow10.5

    \[\leadsto \left(\left(\color{blue}{{c}^{1}} \cdot {a}^{1}\right) \cdot {-4}^{1}\right) \cdot {\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}\]
  18. Applied pow-prod-down0.5

    \[\leadsto \left(\color{blue}{{\left(c \cdot a\right)}^{1}} \cdot {-4}^{1}\right) \cdot {\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}\]
  19. Applied pow-prod-down0.5

    \[\leadsto \color{blue}{{\left(\left(c \cdot a\right) \cdot -4\right)}^{1}} \cdot {\left(\frac{\frac{\frac{1}{2}}{b + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\right)}^{1}\]
  20. Applied pow-prod-down0.5

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

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

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

Reproduce

herbie shell --seed 2019094 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))