Average Error: 52.7 → 51.9
Time: 28.6s
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]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)\right)}}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, 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]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right) \cdot \left(\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right) \cdot \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)\right)}}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}\right)}{a \cdot 3}
double f(double a, double b, double c) {
        double r4058947 = b;
        double r4058948 = -r4058947;
        double r4058949 = r4058947 * r4058947;
        double r4058950 = 3.0;
        double r4058951 = a;
        double r4058952 = r4058950 * r4058951;
        double r4058953 = c;
        double r4058954 = r4058952 * r4058953;
        double r4058955 = r4058949 - r4058954;
        double r4058956 = sqrt(r4058955);
        double r4058957 = r4058948 + r4058956;
        double r4058958 = r4058957 / r4058952;
        return r4058958;
}

double f(double a, double b, double c) {
        double r4058959 = -3.0;
        double r4058960 = a;
        double r4058961 = r4058959 * r4058960;
        double r4058962 = c;
        double r4058963 = b;
        double r4058964 = r4058963 * r4058963;
        double r4058965 = fma(r4058961, r4058962, r4058964);
        double r4058966 = sqrt(r4058965);
        double r4058967 = sqrt(r4058966);
        double r4058968 = -r4058963;
        double r4058969 = fma(r4058967, r4058967, r4058968);
        double r4058970 = cbrt(r4058969);
        double r4058971 = r4058969 * r4058969;
        double r4058972 = r4058969 * r4058971;
        double r4058973 = cbrt(r4058972);
        double r4058974 = cbrt(r4058973);
        double r4058975 = r4058970 * r4058974;
        double r4058976 = cbrt(r4058975);
        double r4058977 = cbrt(r4058970);
        double r4058978 = r4058976 * r4058977;
        double r4058979 = r4058970 * r4058970;
        double r4058980 = r4058978 * r4058979;
        double r4058981 = 3.0;
        double r4058982 = r4058960 * r4058981;
        double r4058983 = r4058980 / r4058982;
        return r4058983;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.7

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

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

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

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

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

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

    \[\leadsto \frac{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}}}}{3 \cdot a}\]
  11. Applied cbrt-prod51.9

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

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

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

Reproduce

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