Average Error: 43.8 → 43.3
Time: 29.5s
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)}}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{a}\right)\right)} \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)} \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}}}{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)}}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{a}\right)\right)} \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)} \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}}}{2}
double f(double a, double b, double c) {
        double r2014036 = b;
        double r2014037 = -r2014036;
        double r2014038 = r2014036 * r2014036;
        double r2014039 = 4.0;
        double r2014040 = a;
        double r2014041 = r2014039 * r2014040;
        double r2014042 = c;
        double r2014043 = r2014041 * r2014042;
        double r2014044 = r2014038 - r2014043;
        double r2014045 = sqrt(r2014044);
        double r2014046 = r2014037 + r2014045;
        double r2014047 = 2.0;
        double r2014048 = r2014047 * r2014040;
        double r2014049 = r2014046 / r2014048;
        return r2014049;
}

double f(double a, double b, double c) {
        double r2014050 = c;
        double r2014051 = a;
        double r2014052 = r2014050 * r2014051;
        double r2014053 = -4.0;
        double r2014054 = b;
        double r2014055 = r2014054 * r2014054;
        double r2014056 = fma(r2014052, r2014053, r2014055);
        double r2014057 = sqrt(r2014056);
        double r2014058 = sqrt(r2014057);
        double r2014059 = -r2014054;
        double r2014060 = fma(r2014058, r2014058, r2014059);
        double r2014061 = cbrt(r2014060);
        double r2014062 = cbrt(r2014051);
        double r2014063 = log1p(r2014062);
        double r2014064 = expm1(r2014063);
        double r2014065 = r2014061 / r2014064;
        double r2014066 = r2014061 * r2014061;
        double r2014067 = r2014062 * r2014062;
        double r2014068 = r2014066 / r2014067;
        double r2014069 = r2014065 * r2014068;
        double r2014070 = 2.0;
        double r2014071 = r2014069 / r2014070;
        return r2014071;
}

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.9

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

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

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

    \[\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 expm1-log1p-u43.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}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{a}\right)\right)}}}{2}\]
  13. 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)}}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{a}\right)\right)} \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)} \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}}}{2}\]

Reproduce

herbie shell --seed 2019163 +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)))