Average Error: 43.9 → 0.5
Time: 11.4s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{1}{\frac{-b}{\left(4 \cdot a\right) \cdot c} - \frac{1}{4 \cdot a} \cdot \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{c}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{1}{\frac{-b}{\left(4 \cdot a\right) \cdot c} - \frac{1}{4 \cdot a} \cdot \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{c}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r36347 = b;
        double r36348 = -r36347;
        double r36349 = r36347 * r36347;
        double r36350 = 4.0;
        double r36351 = a;
        double r36352 = r36350 * r36351;
        double r36353 = c;
        double r36354 = r36352 * r36353;
        double r36355 = r36349 - r36354;
        double r36356 = sqrt(r36355);
        double r36357 = r36348 + r36356;
        double r36358 = 2.0;
        double r36359 = r36358 * r36351;
        double r36360 = r36357 / r36359;
        return r36360;
}

double f(double a, double b, double c) {
        double r36361 = 1.0;
        double r36362 = b;
        double r36363 = -r36362;
        double r36364 = 4.0;
        double r36365 = a;
        double r36366 = r36364 * r36365;
        double r36367 = c;
        double r36368 = r36366 * r36367;
        double r36369 = r36363 / r36368;
        double r36370 = r36361 / r36366;
        double r36371 = r36362 * r36362;
        double r36372 = r36371 - r36368;
        double r36373 = sqrt(r36372);
        double r36374 = r36373 / r36367;
        double r36375 = r36370 * r36374;
        double r36376 = r36369 - r36375;
        double r36377 = r36361 / r36376;
        double r36378 = 2.0;
        double r36379 = r36378 * r36365;
        double r36380 = r36377 / r36379;
        return r36380;
}

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 43.9

    \[\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-+43.9

    \[\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.4

    \[\leadsto \frac{\frac{\color{blue}{b \cdot \left(b - b\right) + 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 clear-num0.5

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020043 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))