Average Error: 52.6 → 51.8
Time: 32.0s
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]{\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)}}{3} \cdot \frac{\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(\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)}}\right)}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\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)}}{3} \cdot \frac{\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(\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)}}\right)}{a}
double f(double a, double b, double c) {
        double r5414120 = b;
        double r5414121 = -r5414120;
        double r5414122 = r5414120 * r5414120;
        double r5414123 = 3.0;
        double r5414124 = a;
        double r5414125 = r5414123 * r5414124;
        double r5414126 = c;
        double r5414127 = r5414125 * r5414126;
        double r5414128 = r5414122 - r5414127;
        double r5414129 = sqrt(r5414128);
        double r5414130 = r5414121 + r5414129;
        double r5414131 = r5414130 / r5414125;
        return r5414131;
}

double f(double a, double b, double c) {
        double r5414132 = -3.0;
        double r5414133 = a;
        double r5414134 = r5414132 * r5414133;
        double r5414135 = c;
        double r5414136 = b;
        double r5414137 = r5414136 * r5414136;
        double r5414138 = fma(r5414134, r5414135, r5414137);
        double r5414139 = sqrt(r5414138);
        double r5414140 = sqrt(r5414139);
        double r5414141 = -r5414136;
        double r5414142 = fma(r5414140, r5414140, r5414141);
        double r5414143 = cbrt(r5414142);
        double r5414144 = r5414143 * r5414143;
        double r5414145 = 3.0;
        double r5414146 = r5414144 / r5414145;
        double r5414147 = cbrt(r5414143);
        double r5414148 = r5414147 * r5414147;
        double r5414149 = r5414147 * r5414148;
        double r5414150 = r5414149 / r5414133;
        double r5414151 = r5414146 * r5414150;
        return r5414151;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.6

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

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

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

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

    \[\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. Applied times-frac51.8

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

    \[\leadsto \frac{\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)}}{3} \cdot \frac{\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]{\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]{\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)}}}}{a}\]
  12. Final simplification51.8

    \[\leadsto \frac{\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)}}{3} \cdot \frac{\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(\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)}}\right)}{a}\]

Reproduce

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