Average Error: 43.9 → 42.5
Time: 39.9s
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{1}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{3} \cdot \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}^{3}\right)}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{1}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{3} \cdot \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}^{3}\right)}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{a}
double f(double a, double b, double c) {
        double r4496114 = b;
        double r4496115 = -r4496114;
        double r4496116 = r4496114 * r4496114;
        double r4496117 = 3.0;
        double r4496118 = a;
        double r4496119 = r4496117 * r4496118;
        double r4496120 = c;
        double r4496121 = r4496119 * r4496120;
        double r4496122 = r4496116 - r4496121;
        double r4496123 = sqrt(r4496122);
        double r4496124 = r4496115 + r4496123;
        double r4496125 = r4496124 / r4496119;
        return r4496125;
}

double f(double a, double b, double c) {
        double r4496126 = 1.0;
        double r4496127 = b;
        double r4496128 = -3.0;
        double r4496129 = c;
        double r4496130 = a;
        double r4496131 = r4496129 * r4496130;
        double r4496132 = r4496127 * r4496127;
        double r4496133 = fma(r4496128, r4496131, r4496132);
        double r4496134 = sqrt(r4496133);
        double r4496135 = r4496127 + r4496134;
        double r4496136 = fma(r4496127, r4496135, r4496133);
        double r4496137 = cbrt(r4496136);
        double r4496138 = r4496137 * r4496137;
        double r4496139 = r4496126 / r4496138;
        double r4496140 = 3.0;
        double r4496141 = r4496139 / r4496140;
        double r4496142 = pow(r4496127, r4496140);
        double r4496143 = -r4496142;
        double r4496144 = fma(r4496133, r4496134, r4496143);
        double r4496145 = r4496144 / r4496137;
        double r4496146 = r4496145 / r4496130;
        double r4496147 = r4496141 * r4496146;
        return r4496147;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 43.9

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

    \[\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 flip3--44.0

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

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

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

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

    \[\leadsto \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 \color{blue}{{b}^{1}}\right)\right)}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{3 \cdot a}\]
  11. Applied pow142.4

    \[\leadsto \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(\color{blue}{{b}^{1}} \cdot {b}^{1}\right)\right)}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{3 \cdot a}\]
  12. Applied pow-prod-up42.4

    \[\leadsto \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 \color{blue}{{b}^{\left(1 + 1\right)}}\right)}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{3 \cdot a}\]
  13. Applied pow142.4

    \[\leadsto \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)}, -\color{blue}{{b}^{1}} \cdot {b}^{\left(1 + 1\right)}\right)}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{3 \cdot a}\]
  14. Applied pow-prod-up42.5

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

    \[\leadsto \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}^{\color{blue}{3}}\right)}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}{3 \cdot a}\]
  16. Using strategy rm
  17. Applied add-cube-cbrt42.5

    \[\leadsto \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}^{3}\right)}{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}}{3 \cdot a}\]
  18. Applied *-un-lft-identity42.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \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}^{3}\right)}}{\left(\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}{3 \cdot a}\]
  19. Applied times-frac42.5

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}} \cdot \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}^{3}\right)}{\sqrt[3]{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}, \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}}}}{3 \cdot a}\]
  20. Applied times-frac42.5

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

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

Reproduce

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