Average Error: 52.5 → 51.2
Time: 27.9s
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{\mathsf{fma}\left(\sqrt{\sqrt{{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\mathsf{fma}\left(\sqrt{\sqrt{{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}{3 \cdot a}
double f(double a, double b, double c) {
        double r2029326 = b;
        double r2029327 = -r2029326;
        double r2029328 = r2029326 * r2029326;
        double r2029329 = 3.0;
        double r2029330 = a;
        double r2029331 = r2029329 * r2029330;
        double r2029332 = c;
        double r2029333 = r2029331 * r2029332;
        double r2029334 = r2029328 - r2029333;
        double r2029335 = sqrt(r2029334);
        double r2029336 = r2029327 + r2029335;
        double r2029337 = r2029336 / r2029331;
        return r2029337;
}

double f(double a, double b, double c) {
        double r2029338 = -3.0;
        double r2029339 = a;
        double r2029340 = c;
        double r2029341 = r2029339 * r2029340;
        double r2029342 = b;
        double r2029343 = r2029342 * r2029342;
        double r2029344 = fma(r2029338, r2029341, r2029343);
        double r2029345 = r2029344 * r2029344;
        double r2029346 = log1p(r2029345);
        double r2029347 = expm1(r2029346);
        double r2029348 = r2029347 * r2029344;
        double r2029349 = 0.3333333333333333;
        double r2029350 = pow(r2029348, r2029349);
        double r2029351 = sqrt(r2029350);
        double r2029352 = sqrt(r2029351);
        double r2029353 = sqrt(r2029344);
        double r2029354 = sqrt(r2029353);
        double r2029355 = -r2029342;
        double r2029356 = fma(r2029352, r2029354, r2029355);
        double r2029357 = 3.0;
        double r2029358 = r2029357 * r2029339;
        double r2029359 = r2029356 / r2029358;
        return r2029359;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.5

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

    \[\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-sqrt52.5

    \[\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.3

    \[\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-neg51.7

    \[\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-cbrt-cube51.8

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right) \cdot \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. Using strategy rm
  10. Applied pow1/351.1

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\color{blue}{{\left(\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}^{\frac{1}{3}}}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied expm1-log1p-u51.2

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

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

Reproduce

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