Average Error: 43.9 → 0.2
Time: 17.6s
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{c \cdot 4}{2 \cdot \left(-\left(b + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{c \cdot 4}{2 \cdot \left(-\left(b + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)}
double f(double a, double b, double c) {
        double r44652 = b;
        double r44653 = -r44652;
        double r44654 = r44652 * r44652;
        double r44655 = 4.0;
        double r44656 = a;
        double r44657 = r44655 * r44656;
        double r44658 = c;
        double r44659 = r44657 * r44658;
        double r44660 = r44654 - r44659;
        double r44661 = sqrt(r44660);
        double r44662 = r44653 + r44661;
        double r44663 = 2.0;
        double r44664 = r44663 * r44656;
        double r44665 = r44662 / r44664;
        return r44665;
}

double f(double a, double b, double c) {
        double r44666 = c;
        double r44667 = 4.0;
        double r44668 = r44666 * r44667;
        double r44669 = 2.0;
        double r44670 = b;
        double r44671 = r44670 * r44670;
        double r44672 = a;
        double r44673 = r44667 * r44672;
        double r44674 = r44673 * r44666;
        double r44675 = r44671 - r44674;
        double r44676 = sqrt(r44675);
        double r44677 = r44670 + r44676;
        double r44678 = -r44677;
        double r44679 = r44669 * r44678;
        double r44680 = r44668 / r44679;
        return r44680;
}

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

    \[\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 sub-neg0.4

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

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

Reproduce

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