Average Error: 53.0 → 52.2
Time: 29.5s
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{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}{\frac{a \cdot 3}{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}{\frac{a \cdot 3}{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}}}
double f(double a, double b, double c) {
        double r2864970 = b;
        double r2864971 = -r2864970;
        double r2864972 = r2864970 * r2864970;
        double r2864973 = 3.0;
        double r2864974 = a;
        double r2864975 = r2864973 * r2864974;
        double r2864976 = c;
        double r2864977 = r2864975 * r2864976;
        double r2864978 = r2864972 - r2864977;
        double r2864979 = sqrt(r2864978);
        double r2864980 = r2864971 + r2864979;
        double r2864981 = r2864980 / r2864975;
        return r2864981;
}

double f(double a, double b, double c) {
        double r2864982 = -3.0;
        double r2864983 = a;
        double r2864984 = c;
        double r2864985 = r2864983 * r2864984;
        double r2864986 = b;
        double r2864987 = r2864986 * r2864986;
        double r2864988 = fma(r2864982, r2864985, r2864987);
        double r2864989 = sqrt(r2864988);
        double r2864990 = sqrt(r2864989);
        double r2864991 = -r2864986;
        double r2864992 = fma(r2864990, r2864990, r2864991);
        double r2864993 = cbrt(r2864992);
        double r2864994 = r2864993 * r2864993;
        double r2864995 = r2864993 * r2864994;
        double r2864996 = cbrt(r2864995);
        double r2864997 = r2864996 * r2864993;
        double r2864998 = 3.0;
        double r2864999 = r2864983 * r2864998;
        double r2865000 = cbrt(r2864994);
        double r2865001 = cbrt(r2864993);
        double r2865002 = r2865000 * r2865001;
        double r2865003 = r2864999 / r2865002;
        double r2865004 = r2864997 / r2865003;
        return r2865004;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 53.0

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

    \[\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-sqrt53.0

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

    \[\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}\]
  6. Applied fma-neg52.2

    \[\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}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt52.2

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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}\]
  9. Applied associate-/l*52.2

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}}{\frac{3 \cdot a}{\sqrt[3]{\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)}}}}\]
  10. Using strategy rm
  11. Applied add-cube-cbrt52.2

    \[\leadsto \frac{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}}{\frac{3 \cdot a}{\sqrt[3]{\color{blue}{\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}}}}}\]
  12. Applied cbrt-prod52.2

    \[\leadsto \frac{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}}{\frac{3 \cdot a}{\color{blue}{\sqrt[3]{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}} \cdot \sqrt[3]{\sqrt[3]{\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)}}}}}\]
  13. Using strategy rm
  14. Applied add-cube-cbrt52.2

    \[\leadsto \frac{\sqrt[3]{\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)} \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}}}}{\frac{3 \cdot a}{\sqrt[3]{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}} \cdot \sqrt[3]{\sqrt[3]{\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)}}}}\]
  15. Final simplification52.2

    \[\leadsto \frac{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}{\frac{a \cdot 3}{\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\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(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}}}}\]

Reproduce

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