Average Error: 43.9 → 0.5
Time: 11.9s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{1 \cdot 4}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{2 \cdot a}{a \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{1 \cdot 4}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{2 \cdot a}{a \cdot c}}
double f(double a, double b, double c) {
        double r44611 = b;
        double r44612 = -r44611;
        double r44613 = r44611 * r44611;
        double r44614 = 4.0;
        double r44615 = a;
        double r44616 = r44614 * r44615;
        double r44617 = c;
        double r44618 = r44616 * r44617;
        double r44619 = r44613 - r44618;
        double r44620 = sqrt(r44619);
        double r44621 = r44612 + r44620;
        double r44622 = 2.0;
        double r44623 = r44622 * r44615;
        double r44624 = r44621 / r44623;
        return r44624;
}

double f(double a, double b, double c) {
        double r44625 = 1.0;
        double r44626 = 4.0;
        double r44627 = r44625 * r44626;
        double r44628 = b;
        double r44629 = -r44628;
        double r44630 = r44628 * r44628;
        double r44631 = a;
        double r44632 = r44626 * r44631;
        double r44633 = c;
        double r44634 = r44632 * r44633;
        double r44635 = r44630 - r44634;
        double r44636 = sqrt(r44635);
        double r44637 = r44629 - r44636;
        double r44638 = r44627 / r44637;
        double r44639 = 2.0;
        double r44640 = r44639 * r44631;
        double r44641 = r44631 * r44633;
        double r44642 = r44640 / r44641;
        double r44643 = r44638 / r44642;
        return r44643;
}

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}{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 flip-+0.5

    \[\leadsto \frac{\frac{\color{blue}{\frac{0 \cdot 0 - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{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}\]
  7. Applied associate-/l/0.5

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

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

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

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

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

Reproduce

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