Average Error: 52.5 → 0.4
Time: 5.4s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\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}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\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}
double f(double a, double b, double c) {
        double r32692 = b;
        double r32693 = -r32692;
        double r32694 = r32692 * r32692;
        double r32695 = 4.0;
        double r32696 = a;
        double r32697 = r32695 * r32696;
        double r32698 = c;
        double r32699 = r32697 * r32698;
        double r32700 = r32694 - r32699;
        double r32701 = sqrt(r32700);
        double r32702 = r32693 + r32701;
        double r32703 = 2.0;
        double r32704 = r32703 * r32696;
        double r32705 = r32702 / r32704;
        return r32705;
}

double f(double a, double b, double c) {
        double r32706 = 0.0;
        double r32707 = 4.0;
        double r32708 = a;
        double r32709 = c;
        double r32710 = r32708 * r32709;
        double r32711 = r32707 * r32710;
        double r32712 = r32706 + r32711;
        double r32713 = b;
        double r32714 = -r32713;
        double r32715 = r32713 * r32713;
        double r32716 = r32707 * r32708;
        double r32717 = r32716 * r32709;
        double r32718 = r32715 - r32717;
        double r32719 = sqrt(r32718);
        double r32720 = r32714 - r32719;
        double r32721 = r32712 / r32720;
        double r32722 = 2.0;
        double r32723 = r32722 * r32708;
        double r32724 = r32721 / r32723;
        return r32724;
}

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 52.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-+52.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.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. Final simplification0.4

    \[\leadsto \frac{\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}\]

Reproduce

herbie shell --seed 2020018 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :precision binary64
  :pre (and (< 4.9303800000000003e-32 a 2.02824e+31) (< 4.9303800000000003e-32 b 2.02824e+31) (< 4.9303800000000003e-32 c 2.02824e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))