Average Error: 52.7 → 52.0
Time: 31.3s
Precision: 64
\[4.930380657631324 \cdot 10^{-32} \lt a \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt b \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt c \lt 2.028240960365167 \cdot 10^{+31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{\left(\sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{\left(\sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(a \cdot -4\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}
double f(double a, double b, double c) {
        double r863231 = b;
        double r863232 = -r863231;
        double r863233 = r863231 * r863231;
        double r863234 = 4.0;
        double r863235 = a;
        double r863236 = r863234 * r863235;
        double r863237 = c;
        double r863238 = r863236 * r863237;
        double r863239 = r863233 - r863238;
        double r863240 = sqrt(r863239);
        double r863241 = r863232 + r863240;
        double r863242 = 2.0;
        double r863243 = r863242 * r863235;
        double r863244 = r863241 / r863243;
        return r863244;
}

double f(double a, double b, double c) {
        double r863245 = c;
        double r863246 = a;
        double r863247 = -4.0;
        double r863248 = r863246 * r863247;
        double r863249 = b;
        double r863250 = r863249 * r863249;
        double r863251 = fma(r863245, r863248, r863250);
        double r863252 = sqrt(r863251);
        double r863253 = sqrt(r863252);
        double r863254 = -r863249;
        double r863255 = fma(r863253, r863253, r863254);
        double r863256 = cbrt(r863255);
        double r863257 = 2.0;
        double r863258 = r863256 / r863257;
        double r863259 = cbrt(r863246);
        double r863260 = log1p(r863259);
        double r863261 = expm1(r863260);
        double r863262 = cbrt(r863261);
        double r863263 = r863262 * r863262;
        double r863264 = r863263 * r863262;
        double r863265 = r863258 / r863264;
        double r863266 = r863256 * r863256;
        double r863267 = r863259 * r863259;
        double r863268 = r863266 / r863267;
        double r863269 = r863265 * r863268;
        return r863269;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.7

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

    \[\leadsto \color{blue}{\frac{\frac{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)} - b}{2}}{a}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt52.7

    \[\leadsto \frac{\frac{\sqrt{\color{blue}{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)} \cdot \sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}} - b}{2}}{a}\]
  5. Applied sqrt-prod52.6

    \[\leadsto \frac{\frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}} - b}{2}}{a}\]
  6. Applied fma-neg52.0

    \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{a}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt52.0

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{2}}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
  9. Applied *-un-lft-identity52.0

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{\color{blue}{1 \cdot 2}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
  10. Applied add-cube-cbrt52.0

    \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}}{1 \cdot 2}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
  11. Applied times-frac52.0

    \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{1} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
  12. Applied times-frac52.0

    \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{1}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{\sqrt[3]{a}}}\]
  13. Using strategy rm
  14. Applied expm1-log1p-u52.0

    \[\leadsto \frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{1}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{\color{blue}{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}}\]
  15. Using strategy rm
  16. Applied add-cube-cbrt52.0

    \[\leadsto \frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{1}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-4 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{2}}{\color{blue}{\left(\sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\sqrt[3]{a}\right)\right)\right)\right)}}}\]
  17. Final simplification52.0

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

Reproduce

herbie shell --seed 2019133 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))