Average Error: 43.6 → 0.2
Time: 16.3s
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{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
\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 - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r88568 = b;
        double r88569 = -r88568;
        double r88570 = r88568 * r88568;
        double r88571 = 3.0;
        double r88572 = a;
        double r88573 = r88571 * r88572;
        double r88574 = c;
        double r88575 = r88573 * r88574;
        double r88576 = r88570 - r88575;
        double r88577 = sqrt(r88576);
        double r88578 = r88569 + r88577;
        double r88579 = r88578 / r88573;
        return r88579;
}

double f(double a, double b, double c) {
        double r88580 = c;
        double r88581 = b;
        double r88582 = -r88581;
        double r88583 = r88581 * r88581;
        double r88584 = 3.0;
        double r88585 = a;
        double r88586 = r88584 * r88585;
        double r88587 = r88586 * r88580;
        double r88588 = r88583 - r88587;
        double r88589 = sqrt(r88588);
        double r88590 = r88582 - r88589;
        double r88591 = r88580 / r88590;
        return r88591;
}

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.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-+43.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.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 clear-num0.6

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

    \[\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. Using strategy rm
  9. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{1}{\color{blue}{1 \cdot \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}\]
  10. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot 1}}{1 \cdot \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}\]
  11. Applied times-frac0.5

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{1}{\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}\]
  12. Applied associate-/l*0.5

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

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}\]
  14. Using strategy rm
  15. Applied div-inv0.3

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

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

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

Reproduce

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