Average Error: 43.6 → 0.5
Time: 7.5s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{3 \cdot \left(a \cdot c\right)}{3} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{3 \cdot \left(a \cdot c\right)}{3} \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r100491 = b;
        double r100492 = -r100491;
        double r100493 = r100491 * r100491;
        double r100494 = 3.0;
        double r100495 = a;
        double r100496 = r100494 * r100495;
        double r100497 = c;
        double r100498 = r100496 * r100497;
        double r100499 = r100493 - r100498;
        double r100500 = sqrt(r100499);
        double r100501 = r100492 + r100500;
        double r100502 = r100501 / r100496;
        return r100502;
}

double f(double a, double b, double c) {
        double r100503 = 3.0;
        double r100504 = a;
        double r100505 = c;
        double r100506 = r100504 * r100505;
        double r100507 = r100503 * r100506;
        double r100508 = r100507 / r100503;
        double r100509 = 1.0;
        double r100510 = b;
        double r100511 = -r100510;
        double r100512 = r100510 * r100510;
        double r100513 = r100503 * r100504;
        double r100514 = r100513 * r100505;
        double r100515 = r100512 - r100514;
        double r100516 = sqrt(r100515);
        double r100517 = r100511 - r100516;
        double r100518 = r100509 / r100517;
        double r100519 = r100508 * r100518;
        double r100520 = r100519 / r100504;
        return r100520;
}

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}{\left({b}^{2} - {b}^{2}\right) + 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 associate-/r*0.5

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

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

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

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

Reproduce

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