Average Error: 52.7 → 0.4
Time: 21.3s
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{\frac{c \cdot a}{\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{c \cdot a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r91852 = b;
        double r91853 = -r91852;
        double r91854 = r91852 * r91852;
        double r91855 = 3.0;
        double r91856 = a;
        double r91857 = r91855 * r91856;
        double r91858 = c;
        double r91859 = r91857 * r91858;
        double r91860 = r91854 - r91859;
        double r91861 = sqrt(r91860);
        double r91862 = r91853 + r91861;
        double r91863 = r91862 / r91857;
        return r91863;
}

double f(double a, double b, double c) {
        double r91864 = c;
        double r91865 = a;
        double r91866 = r91864 * r91865;
        double r91867 = b;
        double r91868 = -r91867;
        double r91869 = r91867 * r91867;
        double r91870 = 3.0;
        double r91871 = r91870 * r91865;
        double r91872 = r91871 * r91864;
        double r91873 = r91869 - r91872;
        double r91874 = sqrt(r91873);
        double r91875 = r91868 - r91874;
        double r91876 = r91866 / r91875;
        double r91877 = r91876 / r91865;
        return r91877;
}

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

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

    \[\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 + \left(a \cdot c\right) \cdot 3}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Using strategy rm
  6. Applied div-inv0.6

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

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

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

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

    \[\leadsto \color{blue}{{\left(\frac{3 \cdot \left(a \cdot c\right)}{3}\right)}^{1}} \cdot {\left(\frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\right)}^{1}\]
  12. Applied pow-prod-down0.5

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

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

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

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :precision binary64
  :pre (and (< 4.93038e-32 a 2.02824e+31) (< 4.93038e-32 b 2.02824e+31) (< 4.93038e-32 c 2.02824e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))