Average Error: 28.3 → 0.4
Time: 19.0s
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{\left(a \cdot c\right) \cdot 4}{\left(-\left(a \cdot \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(\left(4 \cdot a\right) \cdot c, \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right), {b}^{4}\right)}} + a \cdot b\right)\right) \cdot 2}\]
\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}{\left(-\left(a \cdot \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(\left(4 \cdot a\right) \cdot c, \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right), {b}^{4}\right)}} + a \cdot b\right)\right) \cdot 2}
double f(double a, double b, double c) {
        double r40156 = b;
        double r40157 = -r40156;
        double r40158 = r40156 * r40156;
        double r40159 = 4.0;
        double r40160 = a;
        double r40161 = r40159 * r40160;
        double r40162 = c;
        double r40163 = r40161 * r40162;
        double r40164 = r40158 - r40163;
        double r40165 = sqrt(r40164);
        double r40166 = r40157 + r40165;
        double r40167 = 2.0;
        double r40168 = r40167 * r40160;
        double r40169 = r40166 / r40168;
        return r40169;
}

double f(double a, double b, double c) {
        double r40170 = a;
        double r40171 = c;
        double r40172 = r40170 * r40171;
        double r40173 = 4.0;
        double r40174 = r40172 * r40173;
        double r40175 = b;
        double r40176 = 6.0;
        double r40177 = pow(r40175, r40176);
        double r40178 = r40173 * r40170;
        double r40179 = r40178 * r40171;
        double r40180 = 3.0;
        double r40181 = pow(r40179, r40180);
        double r40182 = r40177 - r40181;
        double r40183 = r40173 * r40172;
        double r40184 = fma(r40175, r40175, r40183);
        double r40185 = 4.0;
        double r40186 = pow(r40175, r40185);
        double r40187 = fma(r40179, r40184, r40186);
        double r40188 = r40182 / r40187;
        double r40189 = sqrt(r40188);
        double r40190 = r40170 * r40189;
        double r40191 = r40170 * r40175;
        double r40192 = r40190 + r40191;
        double r40193 = -r40192;
        double r40194 = 2.0;
        double r40195 = r40193 * r40194;
        double r40196 = r40174 / r40195;
        return r40196;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.3

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

    \[\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(a \cdot c\right) \cdot 4}}{\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(a \cdot c\right) \cdot 4\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied associate-/l*0.5

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

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\color{blue}{\left(a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \cdot 2}}\]
  9. Using strategy rm
  10. Applied sub-neg0.4

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\left(a \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)}\right) \cdot 2}\]
  11. Applied distribute-lft-in0.4

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

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\left(\color{blue}{\left(-a\right) \cdot b} + a \cdot \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \cdot 2}\]
  13. Using strategy rm
  14. Applied flip3--0.4

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\left(\left(-a\right) \cdot b + a \cdot \left(-\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)}}}\right)\right) \cdot 2}\]
  15. Simplified0.5

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\left(\left(-a\right) \cdot b + a \cdot \left(-\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)}}\right)\right) \cdot 2}\]
  16. Simplified0.4

    \[\leadsto \frac{0 + \left(a \cdot c\right) \cdot 4}{\left(\left(-a\right) \cdot b + a \cdot \left(-\sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\color{blue}{\mathsf{fma}\left(\left(4 \cdot a\right) \cdot c, \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right), {b}^{4}\right)}}}\right)\right) \cdot 2}\]
  17. Final simplification0.4

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(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)))