Average Error: 44.1 → 0.4
Time: 16.2s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\left(3 \cdot a\right) \cdot c}{\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{\left(3 \cdot a\right) \cdot c}{\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 r56352 = b;
        double r56353 = -r56352;
        double r56354 = r56352 * r56352;
        double r56355 = 3.0;
        double r56356 = a;
        double r56357 = r56355 * r56356;
        double r56358 = c;
        double r56359 = r56357 * r56358;
        double r56360 = r56354 - r56359;
        double r56361 = sqrt(r56360);
        double r56362 = r56353 + r56361;
        double r56363 = r56362 / r56357;
        return r56363;
}

double f(double a, double b, double c) {
        double r56364 = 3.0;
        double r56365 = a;
        double r56366 = r56364 * r56365;
        double r56367 = c;
        double r56368 = r56366 * r56367;
        double r56369 = b;
        double r56370 = -r56369;
        double r56371 = r56369 * r56369;
        double r56372 = r56371 - r56368;
        double r56373 = sqrt(r56372);
        double r56374 = r56370 - r56373;
        double r56375 = r56374 * r56366;
        double r56376 = r56368 / r56375;
        return r56376;
}

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 44.1

    \[\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-+44.1

    \[\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 + 3 \cdot \left(a \cdot c\right)}}{\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 + 3 \cdot \left(a \cdot c\right)\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 + 3 \cdot \left(a \cdot c\right)}{\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 + 3 \cdot \left(a \cdot c\right)}{\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. Using strategy rm
  10. Applied *-un-lft-identity0.5

    \[\leadsto \frac{0 + \color{blue}{\left(1 \cdot 3\right)} \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)}\]
  11. Applied associate-*l*0.5

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

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

    \[\leadsto \frac{\left(3 \cdot a\right) \cdot c}{\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, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))