Average Error: 43.6 → 0.4
Time: 4.1m
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\frac{4}{2} \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\frac{4}{2} \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r42626 = b;
        double r42627 = -r42626;
        double r42628 = r42626 * r42626;
        double r42629 = 4.0;
        double r42630 = a;
        double r42631 = r42629 * r42630;
        double r42632 = c;
        double r42633 = r42631 * r42632;
        double r42634 = r42628 - r42633;
        double r42635 = sqrt(r42634);
        double r42636 = r42627 + r42635;
        double r42637 = 2.0;
        double r42638 = r42637 * r42630;
        double r42639 = r42636 / r42638;
        return r42639;
}

double f(double a, double b, double c) {
        double r42640 = 4.0;
        double r42641 = 2.0;
        double r42642 = r42640 / r42641;
        double r42643 = a;
        double r42644 = c;
        double r42645 = r42643 * r42644;
        double r42646 = r42642 * r42645;
        double r42647 = b;
        double r42648 = -r42647;
        double r42649 = r42647 * r42647;
        double r42650 = r42640 * r42643;
        double r42651 = r42650 * r42644;
        double r42652 = r42649 - r42651;
        double r42653 = sqrt(r42652);
        double r42654 = r42648 - r42653;
        double r42655 = r42646 / r42654;
        double r42656 = r42655 / r42643;
        return r42656;
}

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

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

    \[\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 + \left(4 \cdot a\right) \cdot c}}{\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 + \left(4 \cdot a\right) \cdot c\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{0 + \left(4 \cdot a\right) \cdot c}{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}{\frac{2}{a \cdot c}}} \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 *-un-lft-identity0.5

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

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

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

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

Reproduce

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