Average Error: 43.9 → 0.5
Time: 11.0s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\left(a \cdot c\right) \cdot 4}{2} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\left(c \cdot \left(4 \cdot a\right)\right) \cdot \left(b \cdot b + \left(4 \cdot a\right) \cdot c\right) + {b}^{4}}}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\left(a \cdot c\right) \cdot 4}{2} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\left(c \cdot \left(4 \cdot a\right)\right) \cdot \left(b \cdot b + \left(4 \cdot a\right) \cdot c\right) + {b}^{4}}}}}{a}
double f(double a, double b, double c) {
        double r35560 = b;
        double r35561 = -r35560;
        double r35562 = r35560 * r35560;
        double r35563 = 4.0;
        double r35564 = a;
        double r35565 = r35563 * r35564;
        double r35566 = c;
        double r35567 = r35565 * r35566;
        double r35568 = r35562 - r35567;
        double r35569 = sqrt(r35568);
        double r35570 = r35561 + r35569;
        double r35571 = 2.0;
        double r35572 = r35571 * r35564;
        double r35573 = r35570 / r35572;
        return r35573;
}

double f(double a, double b, double c) {
        double r35574 = a;
        double r35575 = c;
        double r35576 = r35574 * r35575;
        double r35577 = 4.0;
        double r35578 = r35576 * r35577;
        double r35579 = 2.0;
        double r35580 = r35578 / r35579;
        double r35581 = 1.0;
        double r35582 = b;
        double r35583 = -r35582;
        double r35584 = 6.0;
        double r35585 = pow(r35582, r35584);
        double r35586 = r35577 * r35574;
        double r35587 = r35586 * r35575;
        double r35588 = 3.0;
        double r35589 = pow(r35587, r35588);
        double r35590 = r35585 - r35589;
        double r35591 = r35575 * r35586;
        double r35592 = r35582 * r35582;
        double r35593 = r35592 + r35587;
        double r35594 = r35591 * r35593;
        double r35595 = 4.0;
        double r35596 = pow(r35582, r35595);
        double r35597 = r35594 + r35596;
        double r35598 = r35590 / r35597;
        double r35599 = sqrt(r35598);
        double r35600 = r35583 - r35599;
        double r35601 = r35581 / r35600;
        double r35602 = r35601 / r35574;
        double r35603 = r35580 * r35602;
        return r35603;
}

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 43.9

    \[\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-+43.8

    \[\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}{b \cdot \left(b - b\right) + 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(b \cdot \left(b - b\right) + 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 times-frac0.5

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

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

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

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

    \[\leadsto \frac{4 \cdot \left(a \cdot c\right) - 0}{2} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\color{blue}{\left(c \cdot \left(4 \cdot a\right)\right) \cdot \left(b \cdot b + \left(4 \cdot a\right) \cdot c\right) + {b}^{4}}}}}}{a}\]
  13. Final simplification0.5

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

Reproduce

herbie shell --seed 2020042 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))