Average Error: 28.5 → 0.5
Time: 19.2s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\left(4 \cdot c\right) \cdot a}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\left(4 \cdot c\right) \cdot a}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r43098 = b;
        double r43099 = -r43098;
        double r43100 = r43098 * r43098;
        double r43101 = 4.0;
        double r43102 = a;
        double r43103 = r43101 * r43102;
        double r43104 = c;
        double r43105 = r43103 * r43104;
        double r43106 = r43100 - r43105;
        double r43107 = sqrt(r43106);
        double r43108 = r43099 + r43107;
        double r43109 = 2.0;
        double r43110 = r43109 * r43102;
        double r43111 = r43108 / r43110;
        return r43111;
}

double f(double a, double b, double c) {
        double r43112 = 4.0;
        double r43113 = c;
        double r43114 = r43112 * r43113;
        double r43115 = a;
        double r43116 = r43114 * r43115;
        double r43117 = b;
        double r43118 = -r43117;
        double r43119 = 4.0;
        double r43120 = pow(r43117, r43119);
        double r43121 = r43113 * r43113;
        double r43122 = r43112 * r43115;
        double r43123 = r43122 * r43122;
        double r43124 = r43121 * r43123;
        double r43125 = r43120 - r43124;
        double r43126 = r43117 * r43117;
        double r43127 = r43122 * r43113;
        double r43128 = r43126 + r43127;
        double r43129 = r43125 / r43128;
        double r43130 = sqrt(r43129);
        double r43131 = r43118 - r43130;
        double r43132 = r43116 / r43131;
        double r43133 = 2.0;
        double r43134 = r43133 * r43115;
        double r43135 = r43132 / r43134;
        return r43135;
}

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 28.5

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

    \[\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 + a \cdot \left(4 \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 flip--0.5

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

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

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

Reproduce

herbie shell --seed 2019325 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))