Average Error: 43.9 → 0.2
Time: 30.9s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{\left(-b\right) - \sqrt{b \cdot b - c \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{c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}
double f(double a, double b, double c) {
        double r2536346 = b;
        double r2536347 = -r2536346;
        double r2536348 = r2536346 * r2536346;
        double r2536349 = 3.0;
        double r2536350 = a;
        double r2536351 = r2536349 * r2536350;
        double r2536352 = c;
        double r2536353 = r2536351 * r2536352;
        double r2536354 = r2536348 - r2536353;
        double r2536355 = sqrt(r2536354);
        double r2536356 = r2536347 + r2536355;
        double r2536357 = r2536356 / r2536351;
        return r2536357;
}

double f(double a, double b, double c) {
        double r2536358 = c;
        double r2536359 = b;
        double r2536360 = -r2536359;
        double r2536361 = r2536359 * r2536359;
        double r2536362 = 3.0;
        double r2536363 = a;
        double r2536364 = r2536362 * r2536363;
        double r2536365 = r2536358 * r2536364;
        double r2536366 = r2536361 - r2536365;
        double r2536367 = sqrt(r2536366);
        double r2536368 = r2536360 - r2536367;
        double r2536369 = r2536358 / r2536368;
        return r2536369;
}

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 43.9

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

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

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\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}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{1}{\frac{\left(-b\right) - \color{blue}{1 \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}\]
  10. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{1}{\frac{\left(-\color{blue}{1 \cdot b}\right) - 1 \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}\]
  11. Applied distribute-rgt-neg-in0.5

    \[\leadsto \frac{\frac{1}{\frac{\color{blue}{1 \cdot \left(-b\right)} - 1 \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}\]
  12. Applied distribute-lft-out--0.5

    \[\leadsto \frac{\frac{1}{\frac{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right)}}{c \cdot \left(3 \cdot a\right)}}}{3 \cdot a}\]
  13. Applied times-frac0.5

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{1}{c} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{3 \cdot a}}}}{3 \cdot a}\]
  14. Applied associate-/r*0.5

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

    \[\leadsto \frac{\frac{\color{blue}{c}}{\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}{3 \cdot a}}}{3 \cdot a}\]
  16. Using strategy rm
  17. Applied associate-/r/0.2

    \[\leadsto \frac{\color{blue}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} \cdot \left(3 \cdot a\right)}}{3 \cdot a}\]
  18. Applied associate-/l*0.2

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

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

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

Reproduce

herbie shell --seed 2019143 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))