Average Error: 52.4 → 0.5
Time: 19.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{3 \cdot \left(a \cdot c\right)}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(3 \cdot a\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{3 \cdot \left(a \cdot c\right)}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(3 \cdot a\right)}
double f(double a, double b, double c) {
        double r82454 = b;
        double r82455 = -r82454;
        double r82456 = r82454 * r82454;
        double r82457 = 3.0;
        double r82458 = a;
        double r82459 = r82457 * r82458;
        double r82460 = c;
        double r82461 = r82459 * r82460;
        double r82462 = r82456 - r82461;
        double r82463 = sqrt(r82462);
        double r82464 = r82455 + r82463;
        double r82465 = r82464 / r82459;
        return r82465;
}

double f(double a, double b, double c) {
        double r82466 = 3.0;
        double r82467 = a;
        double r82468 = c;
        double r82469 = r82467 * r82468;
        double r82470 = r82466 * r82469;
        double r82471 = b;
        double r82472 = -r82471;
        double r82473 = r82471 * r82471;
        double r82474 = r82466 * r82467;
        double r82475 = r82474 * r82468;
        double r82476 = r82473 - r82475;
        double r82477 = sqrt(r82476);
        double r82478 = r82472 - r82477;
        double r82479 = r82478 * r82474;
        double r82480 = r82470 / r82479;
        return r82480;
}

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

    \[\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.4

    \[\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.5

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

    \[\leadsto \frac{\color{blue}{\left(0 + \left(a \cdot c\right) \cdot 3\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  7. Applied associate-/l*0.6

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

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

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3 a) c)))) (* 3 a)))