Average Error: 52.3 → 0.1
Time: 5.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{c}{1}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{c}{1}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r84986 = b;
        double r84987 = -r84986;
        double r84988 = r84986 * r84986;
        double r84989 = 3.0;
        double r84990 = a;
        double r84991 = r84989 * r84990;
        double r84992 = c;
        double r84993 = r84991 * r84992;
        double r84994 = r84988 - r84993;
        double r84995 = sqrt(r84994);
        double r84996 = r84987 + r84995;
        double r84997 = r84996 / r84991;
        return r84997;
}

double f(double a, double b, double c) {
        double r84998 = c;
        double r84999 = 1.0;
        double r85000 = r84998 / r84999;
        double r85001 = b;
        double r85002 = -r85001;
        double r85003 = r85001 * r85001;
        double r85004 = 3.0;
        double r85005 = a;
        double r85006 = r85004 * r85005;
        double r85007 = r85006 * r84998;
        double r85008 = r85003 - r85007;
        double r85009 = sqrt(r85008);
        double r85010 = r85002 - r85009;
        double r85011 = r85000 / r85010;
        return r85011;
}

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

    \[\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 *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{3 \cdot a}\]
  7. Applied *-un-lft-identity0.5

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \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 \cdot a}\]
  9. Applied times-frac0.6

    \[\leadsto \color{blue}{\frac{\frac{1}{1}}{3} \cdot \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}}}{a}}\]
  10. Simplified0.6

    \[\leadsto \color{blue}{\frac{1}{3}} \cdot \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}}}{a}\]
  11. Simplified0.6

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\frac{\frac{3 \cdot \left(a \cdot c\right)}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity0.6

    \[\leadsto \frac{1}{3} \cdot \frac{\frac{3 \cdot \left(a \cdot c\right)}{a}}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  14. Applied *-un-lft-identity0.6

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

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

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\left(\frac{\frac{3}{1}}{1} \cdot \frac{\frac{a \cdot c}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}\]
  17. Applied associate-*r*0.2

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

    \[\leadsto \color{blue}{1} \cdot \frac{\frac{a \cdot c}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
  19. Using strategy rm
  20. Applied *-un-lft-identity0.2

    \[\leadsto 1 \cdot \frac{\frac{a \cdot c}{a}}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  21. Applied associate-/r*0.2

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

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

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

Reproduce

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