Average Error: 44.1 → 37.5
Time: 36.4s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \left(b \cdot b\right) \cdot \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)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}, b \cdot b\right) + \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, 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{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \left(b \cdot b\right) \cdot \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)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}, b \cdot b\right) + \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}
double f(double a, double b, double c) {
        double r5408508 = b;
        double r5408509 = -r5408508;
        double r5408510 = r5408508 * r5408508;
        double r5408511 = 3.0;
        double r5408512 = a;
        double r5408513 = r5408511 * r5408512;
        double r5408514 = c;
        double r5408515 = r5408513 * r5408514;
        double r5408516 = r5408510 - r5408515;
        double r5408517 = sqrt(r5408516);
        double r5408518 = r5408509 + r5408517;
        double r5408519 = r5408518 / r5408513;
        return r5408519;
}

double f(double a, double b, double c) {
        double r5408520 = a;
        double r5408521 = c;
        double r5408522 = r5408520 * r5408521;
        double r5408523 = -3.0;
        double r5408524 = b;
        double r5408525 = r5408524 * r5408524;
        double r5408526 = fma(r5408522, r5408523, r5408525);
        double r5408527 = sqrt(r5408526);
        double r5408528 = r5408522 * r5408523;
        double r5408529 = r5408527 * r5408528;
        double r5408530 = fma(r5408523, r5408522, r5408525);
        double r5408531 = sqrt(r5408530);
        double r5408532 = r5408530 * r5408531;
        double r5408533 = r5408524 * r5408525;
        double r5408534 = r5408532 - r5408533;
        double r5408535 = fma(r5408524, r5408531, r5408525);
        double r5408536 = r5408535 + r5408530;
        double r5408537 = r5408534 / r5408536;
        double r5408538 = r5408525 * r5408537;
        double r5408539 = r5408529 + r5408538;
        double r5408540 = r5408525 + r5408526;
        double r5408541 = fma(r5408527, r5408524, r5408540);
        double r5408542 = r5408539 / r5408541;
        double r5408543 = 3.0;
        double r5408544 = r5408543 * r5408520;
        double r5408545 = r5408542 / r5408544;
        return r5408545;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 44.1

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

    \[\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--44.2

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

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

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

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \color{blue}{\left(\left(a \cdot c\right) \cdot -3 + b \cdot b\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right) + b \cdot b\right)}}{3 \cdot a}\]
  9. Applied distribute-lft-in43.7

    \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(b \cdot b\right)\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right) + b \cdot b\right)}}{3 \cdot a}\]
  10. Applied associate--l+38.0

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

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

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \left(b \cdot b\right) \cdot \color{blue}{\frac{{\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}\right)}^{3} - {b}^{3}}{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot b\right)}}}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right) + b \cdot b\right)}}{3 \cdot a}\]
  15. Simplified37.5

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

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))