Average Error: 43.8 → 43.3
Time: 27.9s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\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(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}\right)}}{{a}^{\frac{1}{3}}}}{2}\]
\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(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}\right)}}{{a}^{\frac{1}{3}}}}{2}
double f(double a, double b, double c) {
        double r2003234 = b;
        double r2003235 = -r2003234;
        double r2003236 = r2003234 * r2003234;
        double r2003237 = 4.0;
        double r2003238 = a;
        double r2003239 = r2003237 * r2003238;
        double r2003240 = c;
        double r2003241 = r2003239 * r2003240;
        double r2003242 = r2003236 - r2003241;
        double r2003243 = sqrt(r2003242);
        double r2003244 = r2003235 + r2003243;
        double r2003245 = 2.0;
        double r2003246 = r2003245 * r2003238;
        double r2003247 = r2003244 / r2003246;
        return r2003247;
}

double f(double a, double b, double c) {
        double r2003248 = c;
        double r2003249 = a;
        double r2003250 = r2003248 * r2003249;
        double r2003251 = -4.0;
        double r2003252 = b;
        double r2003253 = r2003252 * r2003252;
        double r2003254 = fma(r2003250, r2003251, r2003253);
        double r2003255 = sqrt(r2003254);
        double r2003256 = sqrt(r2003255);
        double r2003257 = -r2003252;
        double r2003258 = fma(r2003256, r2003256, r2003257);
        double r2003259 = cbrt(r2003258);
        double r2003260 = r2003259 * r2003259;
        double r2003261 = cbrt(r2003249);
        double r2003262 = r2003261 * r2003261;
        double r2003263 = r2003260 / r2003262;
        double r2003264 = r2003259 * r2003260;
        double r2003265 = cbrt(r2003264);
        double r2003266 = 0.3333333333333333;
        double r2003267 = pow(r2003249, r2003266);
        double r2003268 = r2003265 / r2003267;
        double r2003269 = r2003263 * r2003268;
        double r2003270 = 2.0;
        double r2003271 = r2003269 / r2003270;
        return r2003271;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 43.8

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c \cdot a, -4, b \cdot b\right)}}, -b\right)}}{\sqrt[3]{a}}}}{2}\]
  11. Using strategy rm
  12. Applied pow1/343.3

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

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

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))