Average Error: 52.6 → 0.4
Time: 31.6s
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(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{1}{\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r5205403 = b;
        double r5205404 = -r5205403;
        double r5205405 = r5205403 * r5205403;
        double r5205406 = 3.0;
        double r5205407 = a;
        double r5205408 = r5205406 * r5205407;
        double r5205409 = c;
        double r5205410 = r5205408 * r5205409;
        double r5205411 = r5205405 - r5205410;
        double r5205412 = sqrt(r5205411);
        double r5205413 = r5205404 + r5205412;
        double r5205414 = r5205413 / r5205408;
        return r5205414;
}

double f(double a, double b, double c) {
        double r5205415 = 1.0;
        double r5205416 = b;
        double r5205417 = -r5205416;
        double r5205418 = r5205416 * r5205416;
        double r5205419 = c;
        double r5205420 = 3.0;
        double r5205421 = a;
        double r5205422 = r5205420 * r5205421;
        double r5205423 = r5205419 * r5205422;
        double r5205424 = r5205418 - r5205423;
        double r5205425 = sqrt(r5205424);
        double r5205426 = r5205417 - r5205425;
        double r5205427 = r5205426 / r5205423;
        double r5205428 = r5205415 / r5205427;
        double r5205429 = r5205428 / r5205422;
        return r5205429;
}

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+52.6

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

    \[\leadsto \frac{\frac{\color{blue}{\left(b \cdot b - b \cdot b\right) + \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Using strategy rm
  6. Applied clear-num0.4

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

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

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

Reproduce

herbie shell --seed 2019170 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))