Average Error: 43.9 → 43.4
Time: 39.6s
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{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{a \cdot 3}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r13498077 = b;
        double r13498078 = -r13498077;
        double r13498079 = r13498077 * r13498077;
        double r13498080 = 3.0;
        double r13498081 = a;
        double r13498082 = r13498080 * r13498081;
        double r13498083 = c;
        double r13498084 = r13498082 * r13498083;
        double r13498085 = r13498079 - r13498084;
        double r13498086 = sqrt(r13498085);
        double r13498087 = r13498078 + r13498086;
        double r13498088 = r13498087 / r13498082;
        return r13498088;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r13498089 = -3.0;
        double r13498090 = a;
        double r13498091 = c;
        double r13498092 = r13498090 * r13498091;
        double r13498093 = b;
        double r13498094 = r13498093 * r13498093;
        double r13498095 = fma(r13498089, r13498092, r13498094);
        double r13498096 = r13498095 * r13498095;
        double r13498097 = r13498096 * r13498095;
        double r13498098 = cbrt(r13498097);
        double r13498099 = sqrt(r13498098);
        double r13498100 = sqrt(r13498099);
        double r13498101 = sqrt(r13498095);
        double r13498102 = sqrt(r13498101);
        double r13498103 = -r13498093;
        double r13498104 = fma(r13498100, r13498102, r13498103);
        double r13498105 = cbrt(r13498104);
        double r13498106 = r13498104 * r13498104;
        double r13498107 = cbrt(r13498106);
        double r13498108 = r13498105 * r13498107;
        double r13498109 = 3.0;
        double r13498110 = r13498090 * r13498109;
        double r13498111 = r13498108 / r13498110;
        return r13498111;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

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, \left(c \cdot a\right), \left(b \cdot b\right)\right)} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt43.9

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

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

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

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\sqrt[3]{\left(\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}}{3 \cdot a}\]
  10. Using strategy rm
  11. Applied cbrt-prod43.4

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

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

Reproduce

herbie shell --seed 2019121 +o rules:numerics
(FPCore (a b c d)
  :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)))