Average Error: 52.7 → 0.1
Time: 5.6s
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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{1}{\frac{2}{4}} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{\frac{2}{4}} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r31860 = b;
        double r31861 = -r31860;
        double r31862 = r31860 * r31860;
        double r31863 = 4.0;
        double r31864 = a;
        double r31865 = r31863 * r31864;
        double r31866 = c;
        double r31867 = r31865 * r31866;
        double r31868 = r31862 - r31867;
        double r31869 = sqrt(r31868);
        double r31870 = r31861 + r31869;
        double r31871 = 2.0;
        double r31872 = r31871 * r31864;
        double r31873 = r31870 / r31872;
        return r31873;
}

double f(double a, double b, double c) {
        double r31874 = 1.0;
        double r31875 = 2.0;
        double r31876 = 4.0;
        double r31877 = r31875 / r31876;
        double r31878 = r31874 / r31877;
        double r31879 = c;
        double r31880 = b;
        double r31881 = -r31880;
        double r31882 = r31880 * r31880;
        double r31883 = a;
        double r31884 = r31876 * r31883;
        double r31885 = r31884 * r31879;
        double r31886 = r31882 - r31885;
        double r31887 = sqrt(r31886);
        double r31888 = r31881 - r31887;
        double r31889 = r31879 / r31888;
        double r31890 = r31878 * r31889;
        return r31890;
}

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(4 \cdot a\right) \cdot c}}{2 \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(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  4. Simplified0.4

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\frac{2}{4} \cdot \frac{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}{a \cdot c}}}\]
  12. Using strategy rm
  13. Applied add-sqr-sqrt0.4

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

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

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

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

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

Reproduce

herbie shell --seed 2020049 
(FPCore (a b c)
  :name "Quadratic roots, 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) (* (* 4 a) c)))) (* 2 a)))