Average Error: 52.6 → 0.4
Time: 17.9s
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{c \cdot \left(a \cdot 3\right) + \left(b \cdot b - b \cdot b\right)}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{c \cdot \left(a \cdot 3\right) + \left(b \cdot b - b \cdot b\right)}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}
double f(double a, double b, double c) {
        double r109408 = b;
        double r109409 = -r109408;
        double r109410 = r109408 * r109408;
        double r109411 = 3.0;
        double r109412 = a;
        double r109413 = r109411 * r109412;
        double r109414 = c;
        double r109415 = r109413 * r109414;
        double r109416 = r109410 - r109415;
        double r109417 = sqrt(r109416);
        double r109418 = r109409 + r109417;
        double r109419 = r109418 / r109413;
        return r109419;
}

double f(double a, double b, double c) {
        double r109420 = c;
        double r109421 = a;
        double r109422 = 3.0;
        double r109423 = r109421 * r109422;
        double r109424 = r109420 * r109423;
        double r109425 = b;
        double r109426 = r109425 * r109425;
        double r109427 = r109426 - r109426;
        double r109428 = r109424 + r109427;
        double r109429 = -r109425;
        double r109430 = r109426 - r109424;
        double r109431 = sqrt(r109430);
        double r109432 = r109429 - r109431;
        double r109433 = r109428 / r109432;
        double r109434 = r109433 / r109423;
        return r109434;
}

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) + c \cdot \left(a \cdot 3\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Simplified0.4

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

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

Reproduce

herbie shell --seed 2019196 
(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)))