Average Error: 52.5 → 0.1
Time: 21.8s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{c \cdot 4}{2 \cdot \left(\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{c \cdot 4}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r41059 = b;
        double r41060 = -r41059;
        double r41061 = r41059 * r41059;
        double r41062 = 4.0;
        double r41063 = a;
        double r41064 = r41062 * r41063;
        double r41065 = c;
        double r41066 = r41064 * r41065;
        double r41067 = r41061 - r41066;
        double r41068 = sqrt(r41067);
        double r41069 = r41060 + r41068;
        double r41070 = 2.0;
        double r41071 = r41070 * r41063;
        double r41072 = r41069 / r41071;
        return r41072;
}

double f(double a, double b, double c) {
        double r41073 = c;
        double r41074 = 4.0;
        double r41075 = r41073 * r41074;
        double r41076 = 2.0;
        double r41077 = b;
        double r41078 = -r41077;
        double r41079 = r41077 * r41077;
        double r41080 = a;
        double r41081 = r41074 * r41080;
        double r41082 = r41081 * r41073;
        double r41083 = r41079 - r41082;
        double r41084 = sqrt(r41083);
        double r41085 = r41078 - r41084;
        double r41086 = r41076 * r41085;
        double r41087 = r41075 / r41086;
        return r41087;
}

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

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

Reproduce

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