Average Error: 5.9 → 3.9
Time: 34.5s
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 -2.358815224477369630616150140951158939988 \cdot 10^{82}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(18 \cdot \left(x \cdot y\right)\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \sqrt{27} \cdot \left(\sqrt{27} \cdot \left(k \cdot j\right)\right)\right)\right)\\ \mathbf{elif}\;t \le 7.467946257651942711329108872973994392395 \cdot 10^{-123}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot \left(x \cdot y\right)\right) \cdot \left(z \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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\\ \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 -2.358815224477369630616150140951158939988 \cdot 10^{82}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(18 \cdot \left(x \cdot y\right)\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \sqrt{27} \cdot \left(\sqrt{27} \cdot \left(k \cdot j\right)\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\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\\

\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 r6367907 = x;
        double r6367908 = 18.0;
        double r6367909 = r6367907 * r6367908;
        double r6367910 = y;
        double r6367911 = r6367909 * r6367910;
        double r6367912 = z;
        double r6367913 = r6367911 * r6367912;
        double r6367914 = t;
        double r6367915 = r6367913 * r6367914;
        double r6367916 = a;
        double r6367917 = 4.0;
        double r6367918 = r6367916 * r6367917;
        double r6367919 = r6367918 * r6367914;
        double r6367920 = r6367915 - r6367919;
        double r6367921 = b;
        double r6367922 = c;
        double r6367923 = r6367921 * r6367922;
        double r6367924 = r6367920 + r6367923;
        double r6367925 = r6367907 * r6367917;
        double r6367926 = i;
        double r6367927 = r6367925 * r6367926;
        double r6367928 = r6367924 - r6367927;
        double r6367929 = j;
        double r6367930 = 27.0;
        double r6367931 = r6367929 * r6367930;
        double r6367932 = k;
        double r6367933 = r6367931 * r6367932;
        double r6367934 = r6367928 - r6367933;
        return r6367934;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r6367935 = t;
        double r6367936 = -2.3588152244773696e+82;
        bool r6367937 = r6367935 <= r6367936;
        double r6367938 = b;
        double r6367939 = c;
        double r6367940 = 18.0;
        double r6367941 = x;
        double r6367942 = y;
        double r6367943 = r6367941 * r6367942;
        double r6367944 = r6367940 * r6367943;
        double r6367945 = z;
        double r6367946 = r6367944 * r6367945;
        double r6367947 = r6367946 * r6367935;
        double r6367948 = 4.0;
        double r6367949 = a;
        double r6367950 = i;
        double r6367951 = r6367941 * r6367950;
        double r6367952 = fma(r6367935, r6367949, r6367951);
        double r6367953 = 27.0;
        double r6367954 = sqrt(r6367953);
        double r6367955 = k;
        double r6367956 = j;
        double r6367957 = r6367955 * r6367956;
        double r6367958 = r6367954 * r6367957;
        double r6367959 = r6367954 * r6367958;
        double r6367960 = fma(r6367948, r6367952, r6367959);
        double r6367961 = r6367947 - r6367960;
        double r6367962 = fma(r6367938, r6367939, r6367961);
        double r6367963 = 7.467946257651943e-123;
        bool r6367964 = r6367935 <= r6367963;
        double r6367965 = r6367945 * r6367935;
        double r6367966 = r6367944 * r6367965;
        double r6367967 = r6367953 * r6367957;
        double r6367968 = fma(r6367948, r6367952, r6367967);
        double r6367969 = r6367966 - r6367968;
        double r6367970 = fma(r6367938, r6367939, r6367969);
        double r6367971 = r6367941 * r6367940;
        double r6367972 = r6367971 * r6367942;
        double r6367973 = r6367972 * r6367945;
        double r6367974 = r6367973 * r6367935;
        double r6367975 = r6367949 * r6367948;
        double r6367976 = r6367975 * r6367935;
        double r6367977 = r6367974 - r6367976;
        double r6367978 = r6367938 * r6367939;
        double r6367979 = r6367977 + r6367978;
        double r6367980 = r6367941 * r6367948;
        double r6367981 = r6367980 * r6367950;
        double r6367982 = r6367979 - r6367981;
        double r6367983 = r6367956 * r6367953;
        double r6367984 = r6367983 * r6367955;
        double r6367985 = r6367982 - r6367984;
        double r6367986 = r6367964 ? r6367970 : r6367985;
        double r6367987 = r6367937 ? r6367962 : r6367986;
        return r6367987;
}

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 < -2.3588152244773696e+82

    1. Initial program 1.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. Simplified1.6

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

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

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

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

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

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

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

    if -2.3588152244773696e+82 < t < 7.467946257651943e-123

    1. Initial program 8.1

      \[\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. Simplified8.1

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

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

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

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

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

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

    if 7.467946257651943e-123 < t

    1. Initial program 3.4

      \[\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\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.358815224477369630616150140951158939988 \cdot 10^{82}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(18 \cdot \left(x \cdot y\right)\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \sqrt{27} \cdot \left(\sqrt{27} \cdot \left(k \cdot j\right)\right)\right)\right)\\ \mathbf{elif}\;t \le 7.467946257651942711329108872973994392395 \cdot 10^{-123}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot \left(x \cdot y\right)\right) \cdot \left(z \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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\\ \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)))