Average Error: 53.0 → 52.1
Time: 29.7s
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}\]
\[\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(-3 \cdot a\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right) \cdot \left(\frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}} \cdot \left(\frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}} \cdot \frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}}\right)\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(-3 \cdot a\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right) \cdot \left(\frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}} \cdot \left(\frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}} \cdot \frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}}\right)\right)
double f(double a, double b, double c) {
        double r3824321 = b;
        double r3824322 = -r3824321;
        double r3824323 = r3824321 * r3824321;
        double r3824324 = 3.0;
        double r3824325 = a;
        double r3824326 = r3824324 * r3824325;
        double r3824327 = c;
        double r3824328 = r3824326 * r3824327;
        double r3824329 = r3824323 - r3824328;
        double r3824330 = sqrt(r3824329);
        double r3824331 = r3824322 + r3824330;
        double r3824332 = r3824331 / r3824326;
        return r3824332;
}

double f(double a, double b, double c) {
        double r3824333 = b;
        double r3824334 = -3.0;
        double r3824335 = a;
        double r3824336 = r3824334 * r3824335;
        double r3824337 = c;
        double r3824338 = r3824336 * r3824337;
        double r3824339 = fma(r3824333, r3824333, r3824338);
        double r3824340 = sqrt(r3824339);
        double r3824341 = sqrt(r3824340);
        double r3824342 = r3824335 * r3824337;
        double r3824343 = r3824333 * r3824333;
        double r3824344 = fma(r3824334, r3824342, r3824343);
        double r3824345 = sqrt(r3824344);
        double r3824346 = sqrt(r3824345);
        double r3824347 = -r3824333;
        double r3824348 = fma(r3824341, r3824346, r3824347);
        double r3824349 = 0.3333333333333333;
        double r3824350 = cbrt(r3824349);
        double r3824351 = cbrt(r3824335);
        double r3824352 = r3824350 / r3824351;
        double r3824353 = r3824352 * r3824352;
        double r3824354 = r3824352 * r3824353;
        double r3824355 = r3824348 * r3824354;
        return r3824355;
}

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

    \[\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. Taylor expanded around 0 52.2

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
  8. Simplified52.1

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \frac{1}{3 \cdot a}}\]
  11. Simplified52.1

    \[\leadsto \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \color{blue}{\frac{\frac{1}{3}}{a}}\]
  12. Using strategy rm
  13. Applied add-cube-cbrt52.1

    \[\leadsto \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \frac{\frac{1}{3}}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
  14. Applied add-cube-cbrt52.1

    \[\leadsto \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{1}{3}}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
  15. Applied times-frac52.1

    \[\leadsto \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}}\right)}\]
  16. Simplified52.1

    \[\leadsto \mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot -3\right) \cdot c\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right) \cdot \left(\color{blue}{\left(\frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}} \cdot \frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}}\right)} \cdot \frac{\sqrt[3]{\frac{1}{3}}}{\sqrt[3]{a}}\right)\]
  17. Final simplification52.1

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

Reproduce

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