Average Error: 28.9 → 27.7
Time: 41.2s
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{\frac{\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)}, b \cdot \left(-b \cdot b\right)\right)}{\sqrt[3]{\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)} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\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)}\right)\right)}}{\sqrt[3]{\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)}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{\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)}, b \cdot \left(-b \cdot b\right)\right)}{\sqrt[3]{\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)} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\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)}\right)\right)}}{\sqrt[3]{\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)}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r2949275 = b;
        double r2949276 = -r2949275;
        double r2949277 = r2949275 * r2949275;
        double r2949278 = 3.0;
        double r2949279 = a;
        double r2949280 = r2949278 * r2949279;
        double r2949281 = c;
        double r2949282 = r2949280 * r2949281;
        double r2949283 = r2949277 - r2949282;
        double r2949284 = sqrt(r2949283);
        double r2949285 = r2949276 + r2949284;
        double r2949286 = r2949285 / r2949280;
        return r2949286;
}

double f(double a, double b, double c) {
        double r2949287 = -3.0;
        double r2949288 = c;
        double r2949289 = a;
        double r2949290 = r2949288 * r2949289;
        double r2949291 = b;
        double r2949292 = r2949291 * r2949291;
        double r2949293 = fma(r2949287, r2949290, r2949292);
        double r2949294 = sqrt(r2949293);
        double r2949295 = -r2949292;
        double r2949296 = r2949291 * r2949295;
        double r2949297 = fma(r2949293, r2949294, r2949296);
        double r2949298 = r2949292 + r2949293;
        double r2949299 = fma(r2949291, r2949294, r2949298);
        double r2949300 = cbrt(r2949299);
        double r2949301 = log1p(r2949300);
        double r2949302 = expm1(r2949301);
        double r2949303 = r2949300 * r2949302;
        double r2949304 = r2949297 / r2949303;
        double r2949305 = r2949304 / r2949300;
        double r2949306 = 3.0;
        double r2949307 = r2949306 * r2949289;
        double r2949308 = r2949305 / r2949307;
        return r2949308;
}

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--28.9

    \[\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-cube-cbrt27.7

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

    \[\leadsto \frac{\color{blue}{\frac{\frac{\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)}{\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}}}{\sqrt[3]{\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}\]
  12. Using strategy rm
  13. Applied expm1-log1p-u27.7

    \[\leadsto \frac{\frac{\frac{\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)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\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)}\right)\right)} \cdot \sqrt[3]{\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)}}}{\sqrt[3]{\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}\]
  14. Final simplification27.7

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

Reproduce

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