Average Error: 43.9 → 12.0
Time: 8.1s
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}\]
\[-1 \cdot \frac{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
-1 \cdot \frac{c}{b}
double f(double a, double b, double c) {
        double r26781 = b;
        double r26782 = -r26781;
        double r26783 = r26781 * r26781;
        double r26784 = 4.0;
        double r26785 = a;
        double r26786 = r26784 * r26785;
        double r26787 = c;
        double r26788 = r26786 * r26787;
        double r26789 = r26783 - r26788;
        double r26790 = sqrt(r26789);
        double r26791 = r26782 + r26790;
        double r26792 = 2.0;
        double r26793 = r26792 * r26785;
        double r26794 = r26791 / r26793;
        return r26794;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r26795 = -1.0;
        double r26796 = c;
        double r26797 = b;
        double r26798 = r26796 / r26797;
        double r26799 = r26795 * r26798;
        return r26799;
}

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{2}}{a}}\]
  3. Taylor expanded around inf 12.0

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}}\]
  4. Final simplification12.0

    \[\leadsto -1 \cdot \frac{c}{b}\]

Reproduce

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