Average Error: 52.9 → 52.1
Time: 28.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}\]
\[\sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)\right)}}{3 \cdot a}} \cdot \left(\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)\right)}}{3 \cdot a}}\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)\right)}}{3 \cdot a}} \cdot \left(\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}, -b\right)\right)}}{3 \cdot a}}\right)
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r2361505 = b;
        double r2361506 = -r2361505;
        double r2361507 = r2361505 * r2361505;
        double r2361508 = 3.0;
        double r2361509 = a;
        double r2361510 = r2361508 * r2361509;
        double r2361511 = c;
        double r2361512 = r2361510 * r2361511;
        double r2361513 = r2361507 - r2361512;
        double r2361514 = sqrt(r2361513);
        double r2361515 = r2361506 + r2361514;
        double r2361516 = r2361515 / r2361510;
        return r2361516;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r2361517 = c;
        double r2361518 = a;
        double r2361519 = -3.0;
        double r2361520 = r2361518 * r2361519;
        double r2361521 = b;
        double r2361522 = r2361521 * r2361521;
        double r2361523 = fma(r2361517, r2361520, r2361522);
        double r2361524 = sqrt(r2361523);
        double r2361525 = sqrt(r2361524);
        double r2361526 = -r2361521;
        double r2361527 = fma(r2361525, r2361525, r2361526);
        double r2361528 = r2361527 * r2361527;
        double r2361529 = r2361527 * r2361528;
        double r2361530 = cbrt(r2361529);
        double r2361531 = 3.0;
        double r2361532 = r2361531 * r2361518;
        double r2361533 = r2361530 / r2361532;
        double r2361534 = cbrt(r2361533);
        double r2361535 = r2361527 / r2361532;
        double r2361536 = cbrt(r2361535);
        double r2361537 = r2361536 * r2361534;
        double r2361538 = r2361534 * r2361537;
        return r2361538;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Initial program 52.9

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019135 +o rules:numerics
(FPCore (a b c d)
  :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)))