Average Error: 44.0 → 43.3
Time: 24.5s
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}\]
\[\sqrt[3]{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a} \cdot \frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\sqrt[3]{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a} \cdot \frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(\left(-3 \cdot a\right) \cdot c\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}{3 \cdot a}}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r1887083 = b;
        double r1887084 = -r1887083;
        double r1887085 = r1887083 * r1887083;
        double r1887086 = 3.0;
        double r1887087 = a;
        double r1887088 = r1887086 * r1887087;
        double r1887089 = c;
        double r1887090 = r1887088 * r1887089;
        double r1887091 = r1887085 - r1887090;
        double r1887092 = sqrt(r1887091);
        double r1887093 = r1887084 + r1887092;
        double r1887094 = r1887093 / r1887088;
        return r1887094;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r1887095 = b;
        double r1887096 = -3.0;
        double r1887097 = a;
        double r1887098 = r1887096 * r1887097;
        double r1887099 = c;
        double r1887100 = r1887098 * r1887099;
        double r1887101 = fma(r1887095, r1887095, r1887100);
        double r1887102 = sqrt(r1887101);
        double r1887103 = sqrt(r1887102);
        double r1887104 = r1887095 * r1887095;
        double r1887105 = fma(r1887099, r1887098, r1887104);
        double r1887106 = sqrt(r1887105);
        double r1887107 = sqrt(r1887106);
        double r1887108 = -r1887095;
        double r1887109 = fma(r1887103, r1887107, r1887108);
        double r1887110 = 3.0;
        double r1887111 = r1887110 * r1887097;
        double r1887112 = r1887109 / r1887111;
        double r1887113 = r1887112 * r1887112;
        double r1887114 = cbrt(r1887113);
        double r1887115 = cbrt(r1887112);
        double r1887116 = r1887114 * r1887115;
        return r1887116;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Initial program 44.0

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

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt44.0

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

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

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(\sqrt{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}}\right), \left(-b\right)\right)}}{3 \cdot a}\]
  7. Taylor expanded around -inf 43.4

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

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

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

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

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

Reproduce

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