Average Error: 43.9 → 0.5
Time: 10.8s
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 r35580 = b;
        double r35581 = -r35580;
        double r35582 = r35580 * r35580;
        double r35583 = 4.0;
        double r35584 = a;
        double r35585 = r35583 * r35584;
        double r35586 = c;
        double r35587 = r35585 * r35586;
        double r35588 = r35582 - r35587;
        double r35589 = sqrt(r35588);
        double r35590 = r35581 + r35589;
        double r35591 = 2.0;
        double r35592 = r35591 * r35584;
        double r35593 = r35590 / r35592;
        return r35593;
}

double f(double a, double b, double c) {
        double r35594 = a;
        double r35595 = c;
        double r35596 = r35594 * r35595;
        double r35597 = 4.0;
        double r35598 = r35596 * r35597;
        double r35599 = 2.0;
        double r35600 = r35598 / r35599;
        double r35601 = 1.0;
        double r35602 = b;
        double r35603 = -r35602;
        double r35604 = 6.0;
        double r35605 = pow(r35602, r35604);
        double r35606 = r35597 * r35594;
        double r35607 = r35606 * r35595;
        double r35608 = 3.0;
        double r35609 = pow(r35607, r35608);
        double r35610 = r35605 - r35609;
        double r35611 = r35595 * r35606;
        double r35612 = r35602 * r35602;
        double r35613 = r35612 + r35607;
        double r35614 = r35611 * r35613;
        double r35615 = 4.0;
        double r35616 = pow(r35602, r35615);
        double r35617 = r35614 + r35616;
        double r35618 = r35610 / r35617;
        double r35619 = sqrt(r35618);
        double r35620 = r35603 - r35619;
        double r35621 = r35601 / r35620;
        double r35622 = r35621 / r35594;
        double r35623 = r35600 * r35622;
        return r35623;
}

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