Average Error: 5.4 → 5.2
Time: 37.4s
Precision: 64
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -7.711355120201642 \cdot 10^{-286}:\\ \;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot x\right) \cdot \left(y \cdot z\right) - a \cdot 4.0, t, \mathsf{fma}\left(c, b, \left(\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) + \mathsf{fma}\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right)\right)\right)\\ \mathbf{elif}\;t \le 3.939674472181009 \cdot 10^{-99}:\\ \;\;\;\;\mathsf{fma}\left(\left(-4.0\right) \cdot a, t, b \cdot c - \mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot \left(x \cdot z\right)\right) \cdot y - a \cdot 4.0, t, b \cdot c - \left(\left(4.0 \cdot x\right) \cdot i + \left(27.0 \cdot k\right) \cdot j\right)\right)\\ \end{array}\]
\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \le -7.711355120201642 \cdot 10^{-286}:\\
\;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot x\right) \cdot \left(y \cdot z\right) - a \cdot 4.0, t, \mathsf{fma}\left(c, b, \left(\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) + \mathsf{fma}\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right)\right)\right)\\

\mathbf{elif}\;t \le 3.939674472181009 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(\left(-4.0\right) \cdot a, t, b \cdot c - \mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot \left(x \cdot z\right)\right) \cdot y - a \cdot 4.0, t, b \cdot c - \left(\left(4.0 \cdot x\right) \cdot i + \left(27.0 \cdot k\right) \cdot j\right)\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r5430787 = x;
        double r5430788 = 18.0;
        double r5430789 = r5430787 * r5430788;
        double r5430790 = y;
        double r5430791 = r5430789 * r5430790;
        double r5430792 = z;
        double r5430793 = r5430791 * r5430792;
        double r5430794 = t;
        double r5430795 = r5430793 * r5430794;
        double r5430796 = a;
        double r5430797 = 4.0;
        double r5430798 = r5430796 * r5430797;
        double r5430799 = r5430798 * r5430794;
        double r5430800 = r5430795 - r5430799;
        double r5430801 = b;
        double r5430802 = c;
        double r5430803 = r5430801 * r5430802;
        double r5430804 = r5430800 + r5430803;
        double r5430805 = r5430787 * r5430797;
        double r5430806 = i;
        double r5430807 = r5430805 * r5430806;
        double r5430808 = r5430804 - r5430807;
        double r5430809 = j;
        double r5430810 = 27.0;
        double r5430811 = r5430809 * r5430810;
        double r5430812 = k;
        double r5430813 = r5430811 * r5430812;
        double r5430814 = r5430808 - r5430813;
        return r5430814;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r5430815 = t;
        double r5430816 = -7.711355120201642e-286;
        bool r5430817 = r5430815 <= r5430816;
        double r5430818 = 18.0;
        double r5430819 = x;
        double r5430820 = r5430818 * r5430819;
        double r5430821 = y;
        double r5430822 = z;
        double r5430823 = r5430821 * r5430822;
        double r5430824 = r5430820 * r5430823;
        double r5430825 = a;
        double r5430826 = 4.0;
        double r5430827 = r5430825 * r5430826;
        double r5430828 = r5430824 - r5430827;
        double r5430829 = c;
        double r5430830 = b;
        double r5430831 = 27.0;
        double r5430832 = j;
        double r5430833 = k;
        double r5430834 = r5430832 * r5430833;
        double r5430835 = r5430826 * r5430819;
        double r5430836 = i;
        double r5430837 = r5430835 * r5430836;
        double r5430838 = fma(r5430831, r5430834, r5430837);
        double r5430839 = cbrt(r5430838);
        double r5430840 = -r5430839;
        double r5430841 = r5430840 * r5430839;
        double r5430842 = r5430841 * r5430839;
        double r5430843 = fma(r5430829, r5430830, r5430842);
        double r5430844 = r5430839 * r5430839;
        double r5430845 = r5430839 * r5430844;
        double r5430846 = fma(r5430840, r5430844, r5430845);
        double r5430847 = r5430843 + r5430846;
        double r5430848 = fma(r5430828, r5430815, r5430847);
        double r5430849 = 3.939674472181009e-99;
        bool r5430850 = r5430815 <= r5430849;
        double r5430851 = -r5430826;
        double r5430852 = r5430851 * r5430825;
        double r5430853 = r5430830 * r5430829;
        double r5430854 = r5430853 - r5430838;
        double r5430855 = fma(r5430852, r5430815, r5430854);
        double r5430856 = r5430819 * r5430822;
        double r5430857 = r5430818 * r5430856;
        double r5430858 = r5430857 * r5430821;
        double r5430859 = r5430858 - r5430827;
        double r5430860 = r5430831 * r5430833;
        double r5430861 = r5430860 * r5430832;
        double r5430862 = r5430837 + r5430861;
        double r5430863 = r5430853 - r5430862;
        double r5430864 = fma(r5430859, r5430815, r5430863);
        double r5430865 = r5430850 ? r5430855 : r5430864;
        double r5430866 = r5430817 ? r5430848 : r5430865;
        return r5430866;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Bits error versus j

Bits error versus k

Derivation

  1. Split input into 3 regimes
  2. if t < -7.711355120201642e-286

    1. Initial program 5.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified5.6

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt6.1

      \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}}\right)\]
    5. Applied prod-diff6.1

      \[\leadsto \mathsf{fma}\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0, t, \color{blue}{\mathsf{fma}\left(c, b, -\sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)}\right)\right)}\right)\]

    if -7.711355120201642e-286 < t < 3.939674472181009e-99

    1. Initial program 8.4

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified10.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*8.7

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(z \cdot \left(x \cdot 18.0\right)\right)} - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)\]
    5. Taylor expanded around 0 6.0

      \[\leadsto \mathsf{fma}\left(\color{blue}{0} - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)\]

    if 3.939674472181009e-99 < t

    1. Initial program 2.7

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified3.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*3.1

      \[\leadsto \mathsf{fma}\left(\color{blue}{y \cdot \left(z \cdot \left(x \cdot 18.0\right)\right)} - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)\]
    5. Using strategy rm
    6. Applied associate-*r*3.1

      \[\leadsto \mathsf{fma}\left(y \cdot \color{blue}{\left(\left(z \cdot x\right) \cdot 18.0\right)} - a \cdot 4.0, t, c \cdot b - \mathsf{fma}\left(27.0, k \cdot j, \left(x \cdot 4.0\right) \cdot i\right)\right)\]
    7. Using strategy rm
    8. Applied fma-udef3.1

      \[\leadsto \mathsf{fma}\left(y \cdot \left(\left(z \cdot x\right) \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \color{blue}{\left(27.0 \cdot \left(k \cdot j\right) + \left(x \cdot 4.0\right) \cdot i\right)}\right)\]
    9. Using strategy rm
    10. Applied associate-*r*3.2

      \[\leadsto \mathsf{fma}\left(y \cdot \left(\left(z \cdot x\right) \cdot 18.0\right) - a \cdot 4.0, t, c \cdot b - \left(\color{blue}{\left(27.0 \cdot k\right) \cdot j} + \left(x \cdot 4.0\right) \cdot i\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification5.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.711355120201642 \cdot 10^{-286}:\\ \;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot x\right) \cdot \left(y \cdot z\right) - a \cdot 4.0, t, \mathsf{fma}\left(c, b, \left(\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right) + \mathsf{fma}\left(-\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}, \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)} \cdot \sqrt[3]{\mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)}\right)\right)\right)\\ \mathbf{elif}\;t \le 3.939674472181009 \cdot 10^{-99}:\\ \;\;\;\;\mathsf{fma}\left(\left(-4.0\right) \cdot a, t, b \cdot c - \mathsf{fma}\left(27.0, j \cdot k, \left(4.0 \cdot x\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(18.0 \cdot \left(x \cdot z\right)\right) \cdot y - a \cdot 4.0, t, b \cdot c - \left(\left(4.0 \cdot x\right) \cdot i + \left(27.0 \cdot k\right) \cdot j\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019143 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))