Average Error: 28.9 → 27.7
Time: 37.8s
Precision: 64
\[1.0536712127723509 \cdot 10^{-08} \lt a \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt b \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt c \lt 94906265.62425156\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right)}}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot b + \mathsf{fma}\left(-3, c \cdot a, b \cdot 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{\frac{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right), \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \left(-b\right) \cdot \left(b \cdot b\right)\right)}}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, b \cdot b + \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{a \cdot 3}
double f(double a, double b, double c) {
        double r4015979 = b;
        double r4015980 = -r4015979;
        double r4015981 = r4015979 * r4015979;
        double r4015982 = 3.0;
        double r4015983 = a;
        double r4015984 = r4015982 * r4015983;
        double r4015985 = c;
        double r4015986 = r4015984 * r4015985;
        double r4015987 = r4015981 - r4015986;
        double r4015988 = sqrt(r4015987);
        double r4015989 = r4015980 + r4015988;
        double r4015990 = r4015989 / r4015984;
        return r4015990;
}

double f(double a, double b, double c) {
        double r4015991 = -3.0;
        double r4015992 = c;
        double r4015993 = a;
        double r4015994 = r4015992 * r4015993;
        double r4015995 = b;
        double r4015996 = r4015995 * r4015995;
        double r4015997 = fma(r4015991, r4015994, r4015996);
        double r4015998 = sqrt(r4015997);
        double r4015999 = -r4015995;
        double r4016000 = r4015999 * r4015996;
        double r4016001 = fma(r4015997, r4015998, r4016000);
        double r4016002 = cbrt(r4016001);
        double r4016003 = r4016001 * r4016001;
        double r4016004 = cbrt(r4016003);
        double r4016005 = r4016002 * r4016004;
        double r4016006 = r4015996 + r4015997;
        double r4016007 = fma(r4015995, r4015998, r4016006);
        double r4016008 = r4016005 / r4016007;
        double r4016009 = 3.0;
        double r4016010 = r4015993 * r4016009;
        double r4016011 = r4016008 / r4016010;
        return r4016011;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.9

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

    \[\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 flip3--29.0

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019151 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))