Average Error: 28.1 → 0.3
Time: 15.5s
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}\]
\[\left(\frac{c}{\left(-b\right) - \sqrt{\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)}^{3}}}} \cdot 4\right) \cdot \frac{1}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\left(\frac{c}{\left(-b\right) - \sqrt{\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)}^{3}}}} \cdot 4\right) \cdot \frac{1}{2}
double f(double a, double b, double c) {
        double r46088 = b;
        double r46089 = -r46088;
        double r46090 = r46088 * r46088;
        double r46091 = 4.0;
        double r46092 = a;
        double r46093 = r46091 * r46092;
        double r46094 = c;
        double r46095 = r46093 * r46094;
        double r46096 = r46090 - r46095;
        double r46097 = sqrt(r46096);
        double r46098 = r46089 + r46097;
        double r46099 = 2.0;
        double r46100 = r46099 * r46092;
        double r46101 = r46098 / r46100;
        return r46101;
}

double f(double a, double b, double c) {
        double r46102 = c;
        double r46103 = b;
        double r46104 = -r46103;
        double r46105 = 4.0;
        double r46106 = a;
        double r46107 = r46105 * r46106;
        double r46108 = r46107 * r46102;
        double r46109 = -r46108;
        double r46110 = fma(r46103, r46103, r46109);
        double r46111 = 3.0;
        double r46112 = pow(r46110, r46111);
        double r46113 = cbrt(r46112);
        double r46114 = sqrt(r46113);
        double r46115 = r46104 - r46114;
        double r46116 = r46102 / r46115;
        double r46117 = r46116 * r46105;
        double r46118 = 1.0;
        double r46119 = 2.0;
        double r46120 = r46118 / r46119;
        double r46121 = r46117 * r46120;
        return r46121;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.1

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

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

    \[\leadsto \frac{\frac{\color{blue}{0 + c \cdot \left(4 \cdot a\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{0 + c \cdot \left(4 \cdot a\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}}{2 \cdot a}\]
  7. Applied *-un-lft-identity0.5

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{0 + c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  9. Applied times-frac0.5

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

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

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\left(4 \cdot a\right) \cdot c}{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  12. Using strategy rm
  13. Applied times-frac0.3

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

    \[\leadsto \frac{1}{2} \cdot \left(\color{blue}{\frac{4}{1}} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right)\]
  15. Using strategy rm
  16. Applied add-cbrt-cube0.3

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

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

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

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))