Average Error: 52.5 → 0.4
Time: 22.2s
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{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{\mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right)}}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{\mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right)}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r34206 = b;
        double r34207 = -r34206;
        double r34208 = r34206 * r34206;
        double r34209 = 4.0;
        double r34210 = a;
        double r34211 = r34209 * r34210;
        double r34212 = c;
        double r34213 = r34211 * r34212;
        double r34214 = r34208 - r34213;
        double r34215 = sqrt(r34214);
        double r34216 = r34207 + r34215;
        double r34217 = 2.0;
        double r34218 = r34217 * r34210;
        double r34219 = r34216 / r34218;
        return r34219;
}

double f(double a, double b, double c) {
        double r34220 = 4.0;
        double r34221 = a;
        double r34222 = r34220 * r34221;
        double r34223 = c;
        double r34224 = r34222 * r34223;
        double r34225 = b;
        double r34226 = -r34225;
        double r34227 = 4.0;
        double r34228 = pow(r34225, r34227);
        double r34229 = r34224 * r34224;
        double r34230 = r34228 - r34229;
        double r34231 = fma(r34225, r34225, r34224);
        double r34232 = r34230 / r34231;
        double r34233 = sqrt(r34232);
        double r34234 = r34226 - r34233;
        double r34235 = r34224 / r34234;
        double r34236 = 2.0;
        double r34237 = r34236 * r34221;
        double r34238 = r34235 / r34237;
        return r34238;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

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 + \left(4 \cdot a\right) \cdot c}}{\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.4

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

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

    \[\leadsto \frac{\frac{0 + \left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{\color{blue}{\mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right)}}}}}{2 \cdot a}\]
  9. Final simplification0.4

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

Reproduce

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