Average Error: 52.5 → 51.7
Time: 27.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(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right)}}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right)}}{a \cdot 3}
double f(double a, double b, double c) {
        double r2924510 = b;
        double r2924511 = -r2924510;
        double r2924512 = r2924510 * r2924510;
        double r2924513 = 3.0;
        double r2924514 = a;
        double r2924515 = r2924513 * r2924514;
        double r2924516 = c;
        double r2924517 = r2924515 * r2924516;
        double r2924518 = r2924512 - r2924517;
        double r2924519 = sqrt(r2924518);
        double r2924520 = r2924511 + r2924519;
        double r2924521 = r2924520 / r2924515;
        return r2924521;
}

double f(double a, double b, double c) {
        double r2924522 = b;
        double r2924523 = -3.0;
        double r2924524 = a;
        double r2924525 = c;
        double r2924526 = r2924524 * r2924525;
        double r2924527 = r2924523 * r2924526;
        double r2924528 = fma(r2924522, r2924522, r2924527);
        double r2924529 = sqrt(r2924528);
        double r2924530 = sqrt(r2924529);
        double r2924531 = r2924522 * r2924522;
        double r2924532 = fma(r2924523, r2924526, r2924531);
        double r2924533 = sqrt(r2924532);
        double r2924534 = sqrt(r2924533);
        double r2924535 = -r2924522;
        double r2924536 = fma(r2924530, r2924534, r2924535);
        double r2924537 = cbrt(r2924536);
        double r2924538 = r2924537 * r2924537;
        double r2924539 = r2924537 * r2924538;
        double r2924540 = cbrt(r2924539);
        double r2924541 = r2924538 * r2924540;
        double r2924542 = 3.0;
        double r2924543 = r2924524 * r2924542;
        double r2924544 = r2924541 / r2924543;
        return r2924544;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.5

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

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

    \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}} - b}{3 \cdot a}\]
  5. Applied fma-neg51.7

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}}{3 \cdot a}\]
  6. Taylor expanded around inf 51.7

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
  7. Simplified51.7

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

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}}}{3 \cdot a}\]
  10. Using strategy rm
  11. Applied add-cbrt-cube51.7

    \[\leadsto \frac{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}\right) \cdot \color{blue}{\sqrt[3]{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}}}}{3 \cdot a}\]
  12. Final simplification51.7

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

Reproduce

herbie shell --seed 2019149 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3 a) c)))) (* 3 a)))