Average Error: 52.6 → 0.4
Time: 17.2s
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{1}{-\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + b}{\frac{\frac{3 \cdot \left(c \cdot a\right)}{3}}{a}}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1}{-\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + b}{\frac{\frac{3 \cdot \left(c \cdot a\right)}{3}}{a}}}
double f(double a, double b, double c) {
        double r117695 = b;
        double r117696 = -r117695;
        double r117697 = r117695 * r117695;
        double r117698 = 3.0;
        double r117699 = a;
        double r117700 = r117698 * r117699;
        double r117701 = c;
        double r117702 = r117700 * r117701;
        double r117703 = r117697 - r117702;
        double r117704 = sqrt(r117703);
        double r117705 = r117696 + r117704;
        double r117706 = r117705 / r117700;
        return r117706;
}

double f(double a, double b, double c) {
        double r117707 = 1.0;
        double r117708 = b;
        double r117709 = r117708 * r117708;
        double r117710 = 3.0;
        double r117711 = c;
        double r117712 = a;
        double r117713 = r117711 * r117712;
        double r117714 = r117710 * r117713;
        double r117715 = r117709 - r117714;
        double r117716 = sqrt(r117715);
        double r117717 = r117716 + r117708;
        double r117718 = r117714 / r117710;
        double r117719 = r117718 / r117712;
        double r117720 = r117717 / r117719;
        double r117721 = -r117720;
        double r117722 = r117707 / r117721;
        return r117722;
}

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

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

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

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

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

    \[\leadsto \frac{\left(b \cdot b - b \cdot b\right) + c \cdot \left(a \cdot 3\right)}{\color{blue}{\left(a \cdot \left(-\left(b + \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}\right)\right)\right) \cdot 3}}\]
  10. Using strategy rm
  11. Applied clear-num0.6

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

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))