Average Error: 44.1 → 0.3
Time: 21.8s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{3 \cdot \left(-a\right)}{-1} \cdot \frac{\frac{c}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}{\mathsf{fma}\left(3 \cdot \left(a \cdot c\right), \mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right), {b}^{4}\right)}}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{3 \cdot \left(-a\right)}{-1} \cdot \frac{\frac{c}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}{\mathsf{fma}\left(3 \cdot \left(a \cdot c\right), \mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right), {b}^{4}\right)}}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r81173 = b;
        double r81174 = -r81173;
        double r81175 = r81173 * r81173;
        double r81176 = 3.0;
        double r81177 = a;
        double r81178 = r81176 * r81177;
        double r81179 = c;
        double r81180 = r81178 * r81179;
        double r81181 = r81175 - r81180;
        double r81182 = sqrt(r81181);
        double r81183 = r81174 + r81182;
        double r81184 = r81183 / r81178;
        return r81184;
}

double f(double a, double b, double c) {
        double r81185 = 3.0;
        double r81186 = a;
        double r81187 = -r81186;
        double r81188 = r81185 * r81187;
        double r81189 = -1.0;
        double r81190 = r81188 / r81189;
        double r81191 = c;
        double r81192 = b;
        double r81193 = -r81192;
        double r81194 = 6.0;
        double r81195 = pow(r81192, r81194);
        double r81196 = r81186 * r81191;
        double r81197 = r81185 * r81196;
        double r81198 = 3.0;
        double r81199 = pow(r81197, r81198);
        double r81200 = r81195 - r81199;
        double r81201 = fma(r81192, r81192, r81197);
        double r81202 = 4.0;
        double r81203 = pow(r81192, r81202);
        double r81204 = fma(r81197, r81201, r81203);
        double r81205 = r81200 / r81204;
        double r81206 = sqrt(r81205);
        double r81207 = r81193 - r81206;
        double r81208 = r81191 / r81207;
        double r81209 = r81185 * r81186;
        double r81210 = r81208 / r81209;
        double r81211 = r81190 * r81210;
        return r81211;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 44.1

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+44.1

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

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

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

    \[\leadsto \frac{\color{blue}{-\frac{\left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{-3 \cdot a}\]
  8. Using strategy rm
  9. Applied neg-mul-10.4

    \[\leadsto \frac{-\frac{\left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{\color{blue}{-1 \cdot \left(3 \cdot a\right)}}\]
  10. Applied *-un-lft-identity0.4

    \[\leadsto \frac{-\frac{\left(3 \cdot a\right) \cdot c}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{-1 \cdot \left(3 \cdot a\right)}\]
  11. Applied times-frac0.2

    \[\leadsto \frac{-\color{blue}{\frac{3 \cdot a}{1} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{-1 \cdot \left(3 \cdot a\right)}\]
  12. Applied distribute-lft-neg-in0.2

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

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

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

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

    \[\leadsto \frac{3 \cdot \left(-a\right)}{-1} \cdot \frac{\frac{c}{\left(-b\right) - \sqrt{\frac{\color{blue}{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}}{\left(b \cdot b\right) \cdot \left(b \cdot b\right) + \left(\left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right) + \left(b \cdot b\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)\right)}}}}{3 \cdot a}\]
  18. Simplified0.3

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

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e15) (< 1.11022e-16 b 9.0072e15) (< 1.11022e-16 c 9.0072e15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))