Average Error: 43.6 → 0.2
Time: 6.9s
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{1}{2} \cdot \left(4 \cdot \frac{\frac{c}{1}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2} \cdot \left(4 \cdot \frac{\frac{c}{1}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right)
double f(double a, double b, double c) {
        double r30621 = b;
        double r30622 = -r30621;
        double r30623 = r30621 * r30621;
        double r30624 = 4.0;
        double r30625 = a;
        double r30626 = r30624 * r30625;
        double r30627 = c;
        double r30628 = r30626 * r30627;
        double r30629 = r30623 - r30628;
        double r30630 = sqrt(r30629);
        double r30631 = r30622 + r30630;
        double r30632 = 2.0;
        double r30633 = r30632 * r30625;
        double r30634 = r30631 / r30633;
        return r30634;
}

double f(double a, double b, double c) {
        double r30635 = 1.0;
        double r30636 = 2.0;
        double r30637 = r30635 / r30636;
        double r30638 = 4.0;
        double r30639 = c;
        double r30640 = r30639 / r30635;
        double r30641 = b;
        double r30642 = -r30641;
        double r30643 = r30641 * r30641;
        double r30644 = a;
        double r30645 = r30638 * r30644;
        double r30646 = r30645 * r30639;
        double r30647 = r30643 - r30646;
        double r30648 = sqrt(r30647);
        double r30649 = r30642 - r30648;
        double r30650 = r30640 / r30649;
        double r30651 = r30638 * r30650;
        double r30652 = r30637 * r30651;
        return r30652;
}

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

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

    \[\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}{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 *-un-lft-identity0.4

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{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}\]
  9. Applied times-frac0.4

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

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

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{4 \cdot \left(a \cdot c\right)}{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  12. Using strategy rm
  13. Applied associate-/r*0.2

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020035 
(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)))