Average Error: 52.3 → 0.1
Time: 19.9s
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 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c}}
double f(double a, double b, double c) {
        double r3403892 = b;
        double r3403893 = -r3403892;
        double r3403894 = r3403892 * r3403892;
        double r3403895 = 3.0;
        double r3403896 = a;
        double r3403897 = r3403895 * r3403896;
        double r3403898 = c;
        double r3403899 = r3403897 * r3403898;
        double r3403900 = r3403894 - r3403899;
        double r3403901 = sqrt(r3403900);
        double r3403902 = r3403893 + r3403901;
        double r3403903 = r3403902 / r3403897;
        return r3403903;
}

double f(double a, double b, double c) {
        double r3403904 = 1.0;
        double r3403905 = c;
        double r3403906 = r3403904 * r3403905;
        double r3403907 = b;
        double r3403908 = -r3403907;
        double r3403909 = r3403907 * r3403907;
        double r3403910 = a;
        double r3403911 = 3.0;
        double r3403912 = r3403910 * r3403911;
        double r3403913 = r3403912 * r3403905;
        double r3403914 = r3403909 - r3403913;
        double r3403915 = sqrt(r3403914);
        double r3403916 = r3403908 - r3403915;
        double r3403917 = r3403906 / r3403916;
        return r3403917;
}

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.3

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

    \[\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 associate-/l/0.4

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

    \[\leadsto \color{blue}{\frac{\frac{\left(b \cdot b - b \cdot b\right) + \left(3 \cdot a\right) \cdot c}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  9. Taylor expanded around 0 0.1

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

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

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(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)))