Average Error: 52.7 → 51.7
Time: 47.2s
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}\]
\[\sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right) \cdot \left(\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)\right)}}{3 \cdot a} \cdot \left(\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)}{3 \cdot a} \cdot \frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)}{3 \cdot a}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\sqrt[3]{\frac{\sqrt[3]{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right) \cdot \left(\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right) \cdot \mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)\right)}}{3 \cdot a} \cdot \left(\frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)}{3 \cdot a} \cdot \frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)}}\right), \left({\left(\mathsf{fma}\left(-3, \left(a \cdot c\right), \left(b \cdot b\right)\right)\right)}^{\frac{1}{4}}\right), \left(-b\right)\right)}{3 \cdot a}\right)}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r16795810 = b;
        double r16795811 = -r16795810;
        double r16795812 = r16795810 * r16795810;
        double r16795813 = 3.0;
        double r16795814 = a;
        double r16795815 = r16795813 * r16795814;
        double r16795816 = c;
        double r16795817 = r16795815 * r16795816;
        double r16795818 = r16795812 - r16795817;
        double r16795819 = sqrt(r16795818);
        double r16795820 = r16795811 + r16795819;
        double r16795821 = r16795820 / r16795815;
        return r16795821;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r16795822 = -3.0;
        double r16795823 = a;
        double r16795824 = c;
        double r16795825 = r16795823 * r16795824;
        double r16795826 = b;
        double r16795827 = r16795826 * r16795826;
        double r16795828 = fma(r16795822, r16795825, r16795827);
        double r16795829 = sqrt(r16795828);
        double r16795830 = sqrt(r16795829);
        double r16795831 = 0.25;
        double r16795832 = pow(r16795828, r16795831);
        double r16795833 = -r16795826;
        double r16795834 = fma(r16795830, r16795832, r16795833);
        double r16795835 = r16795834 * r16795834;
        double r16795836 = r16795834 * r16795835;
        double r16795837 = cbrt(r16795836);
        double r16795838 = 3.0;
        double r16795839 = r16795838 * r16795823;
        double r16795840 = r16795837 / r16795839;
        double r16795841 = r16795834 / r16795839;
        double r16795842 = r16795841 * r16795841;
        double r16795843 = r16795840 * r16795842;
        double r16795844 = cbrt(r16795843);
        return r16795844;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Initial program 52.7

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

    \[\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-sqrt52.7

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

    \[\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}\]
  6. Applied fma-neg51.8

    \[\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}\]
  7. Using strategy rm
  8. Applied pow1/251.8

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

    \[\leadsto \frac{\mathsf{fma}\left(\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}}\right), \color{blue}{\left({\left(\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}, \left(-b\right)\right)}{3 \cdot a}\]
  10. Using strategy rm
  11. Applied add-cbrt-cube51.7

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

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

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

Reproduce

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