Average Error: 28.4 → 0.4
Time: 38.7s
Precision: 64
Internal Precision: 576
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{-2}{\sqrt{b \cdot b + c \cdot \left(-4 \cdot a\right)} + b} \cdot c\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 28.4

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

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

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

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

    \[\leadsto \frac{\color{blue}{\left(c \cdot -4\right) \cdot a}}{\left(2 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} + b\right)}\]
  7. Using strategy rm
  8. Applied associate-/l*0.3

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

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

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

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

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

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

Runtime

Time bar (total: 38.7s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.40.40.00.30%
herbie shell --seed 2018263 
(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)))