Average Error: 28.7 → 0.4
Time: 2.8m
Precision: 64
Internal Precision: 576
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\left(-\frac{c}{2}\right) \cdot \frac{4}{b + \sqrt{(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(b \cdot b\right))_*}}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.7

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

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

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

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

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

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

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

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

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

Runtime

Time bar (total: 2.8m)Debug logProfile

herbie shell --seed 2019053 +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)))