Average Error: 52.5 → 0.5
Time: 6.1s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\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}}{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
\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}}{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r105789 = b;
        double r105790 = -r105789;
        double r105791 = r105789 * r105789;
        double r105792 = 3.0;
        double r105793 = a;
        double r105794 = r105792 * r105793;
        double r105795 = c;
        double r105796 = r105794 * r105795;
        double r105797 = r105791 - r105796;
        double r105798 = sqrt(r105797);
        double r105799 = r105790 + r105798;
        double r105800 = r105799 / r105794;
        return r105800;
}

double f(double a, double b, double c) {
        double r105801 = 3.0;
        double r105802 = a;
        double r105803 = c;
        double r105804 = r105802 * r105803;
        double r105805 = r105801 * r105804;
        double r105806 = r105805 / r105801;
        double r105807 = b;
        double r105808 = -r105807;
        double r105809 = r105807 * r105807;
        double r105810 = r105801 * r105802;
        double r105811 = r105810 * r105803;
        double r105812 = r105809 - r105811;
        double r105813 = sqrt(r105812);
        double r105814 = r105808 - r105813;
        double r105815 = r105802 * r105814;
        double r105816 = r105806 / r105815;
        return r105816;
}

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

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

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

    \[\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. Applied associate-/l*0.5

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

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

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

Reproduce

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