Average Error: 28.5 → 0.3
Time: 17.5s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{c \cdot 4}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot 2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{c \cdot 4}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot 2}
double f(double a, double b, double c) {
        double r46410 = b;
        double r46411 = -r46410;
        double r46412 = r46410 * r46410;
        double r46413 = 4.0;
        double r46414 = a;
        double r46415 = r46413 * r46414;
        double r46416 = c;
        double r46417 = r46415 * r46416;
        double r46418 = r46412 - r46417;
        double r46419 = sqrt(r46418);
        double r46420 = r46411 + r46419;
        double r46421 = 2.0;
        double r46422 = r46421 * r46414;
        double r46423 = r46420 / r46422;
        return r46423;
}

double f(double a, double b, double c) {
        double r46424 = c;
        double r46425 = 4.0;
        double r46426 = r46424 * r46425;
        double r46427 = b;
        double r46428 = -r46427;
        double r46429 = r46427 * r46427;
        double r46430 = a;
        double r46431 = r46425 * r46430;
        double r46432 = r46431 * r46424;
        double r46433 = r46429 - r46432;
        double r46434 = sqrt(r46433);
        double r46435 = r46428 - r46434;
        double r46436 = 2.0;
        double r46437 = r46435 * r46436;
        double r46438 = r46426 / r46437;
        return r46438;
}

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

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

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

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

    \[\leadsto \frac{\color{blue}{\left(0 + 4 \cdot \left(a \cdot c\right)\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied associate-/l*0.5

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{4 \cdot \left(a \cdot c\right)}{2} \cdot \frac{1}{a}}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]
  14. Applied associate-/l*0.5

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

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

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

Reproduce

herbie shell --seed 2019303 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))