Average Error: 5.9 → 3.1
Time: 26.7s
Precision: 64
\[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -7.497416902329217719773679954021670957821 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot y\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 8.621654608286013508351055408676881547749 \cdot 10^{-206}:\\ \;\;\;\;\mathsf{fma}\left(b, c, z \cdot \left(\left(x \cdot t\right) \cdot \left(18 \cdot y\right)\right) - \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(\left(k \cdot \sqrt{27}\right) \cdot j\right) \cdot \sqrt{27}\right)\right)\\ \end{array}\]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \le -7.497416902329217719773679954021670957821 \cdot 10^{-90}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot y\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\

\mathbf{elif}\;t \le 8.621654608286013508351055408676881547749 \cdot 10^{-206}:\\
\;\;\;\;\mathsf{fma}\left(b, c, z \cdot \left(\left(x \cdot t\right) \cdot \left(18 \cdot y\right)\right) - \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(\left(k \cdot \sqrt{27}\right) \cdot j\right) \cdot \sqrt{27}\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 r119837 = x;
        double r119838 = 18.0;
        double r119839 = r119837 * r119838;
        double r119840 = y;
        double r119841 = r119839 * r119840;
        double r119842 = z;
        double r119843 = r119841 * r119842;
        double r119844 = t;
        double r119845 = r119843 * r119844;
        double r119846 = a;
        double r119847 = 4.0;
        double r119848 = r119846 * r119847;
        double r119849 = r119848 * r119844;
        double r119850 = r119845 - r119849;
        double r119851 = b;
        double r119852 = c;
        double r119853 = r119851 * r119852;
        double r119854 = r119850 + r119853;
        double r119855 = r119837 * r119847;
        double r119856 = i;
        double r119857 = r119855 * r119856;
        double r119858 = r119854 - r119857;
        double r119859 = j;
        double r119860 = 27.0;
        double r119861 = r119859 * r119860;
        double r119862 = k;
        double r119863 = r119861 * r119862;
        double r119864 = r119858 - r119863;
        return r119864;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r119865 = t;
        double r119866 = -7.497416902329218e-90;
        bool r119867 = r119865 <= r119866;
        double r119868 = b;
        double r119869 = c;
        double r119870 = 18.0;
        double r119871 = y;
        double r119872 = r119870 * r119871;
        double r119873 = x;
        double r119874 = r119872 * r119873;
        double r119875 = z;
        double r119876 = r119874 * r119875;
        double r119877 = r119876 * r119865;
        double r119878 = 4.0;
        double r119879 = a;
        double r119880 = i;
        double r119881 = r119880 * r119873;
        double r119882 = fma(r119865, r119879, r119881);
        double r119883 = 27.0;
        double r119884 = j;
        double r119885 = k;
        double r119886 = r119884 * r119885;
        double r119887 = r119883 * r119886;
        double r119888 = fma(r119878, r119882, r119887);
        double r119889 = r119877 - r119888;
        double r119890 = fma(r119868, r119869, r119889);
        double r119891 = 8.621654608286014e-206;
        bool r119892 = r119865 <= r119891;
        double r119893 = r119873 * r119865;
        double r119894 = r119893 * r119872;
        double r119895 = r119875 * r119894;
        double r119896 = r119885 * r119883;
        double r119897 = r119865 * r119879;
        double r119898 = fma(r119873, r119880, r119897);
        double r119899 = r119898 * r119878;
        double r119900 = fma(r119884, r119896, r119899);
        double r119901 = cbrt(r119900);
        double r119902 = r119901 * r119901;
        double r119903 = r119901 * r119902;
        double r119904 = r119895 - r119903;
        double r119905 = fma(r119868, r119869, r119904);
        double r119906 = r119870 * r119873;
        double r119907 = r119906 * r119871;
        double r119908 = r119907 * r119875;
        double r119909 = r119865 * r119908;
        double r119910 = sqrt(r119883);
        double r119911 = r119885 * r119910;
        double r119912 = r119911 * r119884;
        double r119913 = r119912 * r119910;
        double r119914 = fma(r119878, r119882, r119913);
        double r119915 = r119909 - r119914;
        double r119916 = fma(r119868, r119869, r119915);
        double r119917 = r119892 ? r119905 : r119916;
        double r119918 = r119867 ? r119890 : r119917;
        return r119918;
}

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.497416902329218e-90

    1. Initial program 2.7

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
    2. Simplified2.7

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

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    5. Using strategy rm
    6. Applied *-un-lft-identity2.6

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot \color{blue}{\left(1 \cdot z\right)}\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    7. Applied associate-*r*2.6

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \color{blue}{\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot 1\right) \cdot z\right)} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    8. Simplified2.6

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\color{blue}{\left(x \cdot \left(y \cdot 18\right)\right)} \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]

    if -7.497416902329218e-90 < t < 8.621654608286014e-206

    1. Initial program 10.2

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

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot y\right)\right) \cdot z} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    7. Simplified1.2

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\left(x \cdot t\right) \cdot \left(y \cdot 18\right)\right)} \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    8. Using strategy rm
    9. Applied add-cube-cbrt1.9

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(x \cdot t\right) \cdot \left(y \cdot 18\right)\right) \cdot z - \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)}}\right)\]
    10. Simplified2.0

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(x \cdot t\right) \cdot \left(y \cdot 18\right)\right) \cdot z - \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(j, 27 \cdot k, 4 \cdot \mathsf{fma}\left(x, i, a \cdot t\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(j, 27 \cdot k, 4 \cdot \mathsf{fma}\left(x, i, a \cdot t\right)\right)}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)}\right)\]
    11. Simplified2.0

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

    if 8.621654608286014e-206 < t

    1. Initial program 4.5

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
    2. Simplified4.4

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

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt4.3

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{\left(\sqrt{27} \cdot \sqrt{27}\right)} \cdot \left(j \cdot k\right)\right)\right)\]
    7. Applied associate-*l*4.4

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{\sqrt{27} \cdot \left(\sqrt{27} \cdot \left(j \cdot k\right)\right)}\right)\right)\]
    8. Simplified4.4

      \[\leadsto \mathsf{fma}\left(b, c, t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \sqrt{27} \cdot \color{blue}{\left(j \cdot \left(k \cdot \sqrt{27}\right)\right)}\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.497416902329217719773679954021670957821 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot y\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 8.621654608286013508351055408676881547749 \cdot 10^{-206}:\\ \;\;\;\;\mathsf{fma}\left(b, c, z \cdot \left(\left(x \cdot t\right) \cdot \left(18 \cdot y\right)\right) - \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \left(\sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)} \cdot \sqrt[3]{\mathsf{fma}\left(j, k \cdot 27, \mathsf{fma}\left(x, i, t \cdot a\right) \cdot 4\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t \cdot \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(\left(k \cdot \sqrt{27}\right) \cdot j\right) \cdot \sqrt{27}\right)\right)\\ \end{array}\]

Reproduce

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