Average Error: 5.6 → 2.2
Time: 28.4s
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}\;z \le -3.22480334132064979721719751753168462291 \cdot 10^{67}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot x\right) \cdot t\right) \cdot y\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\ \mathbf{elif}\;z \le 3.708681601048053467557901564726162283421 \cdot 10^{124}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) \cdot 18 - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot t\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \sqrt[3]{k} \cdot \left(\left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right) \cdot \left(27 \cdot j\right)\right)\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}\;z \le -3.22480334132064979721719751753168462291 \cdot 10^{67}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot x\right) \cdot t\right) \cdot y\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(18 \cdot x\right) \cdot y\right) \cdot t\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \sqrt[3]{k} \cdot \left(\left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right) \cdot \left(27 \cdot j\right)\right)\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 r5265984 = x;
        double r5265985 = 18.0;
        double r5265986 = r5265984 * r5265985;
        double r5265987 = y;
        double r5265988 = r5265986 * r5265987;
        double r5265989 = z;
        double r5265990 = r5265988 * r5265989;
        double r5265991 = t;
        double r5265992 = r5265990 * r5265991;
        double r5265993 = a;
        double r5265994 = 4.0;
        double r5265995 = r5265993 * r5265994;
        double r5265996 = r5265995 * r5265991;
        double r5265997 = r5265992 - r5265996;
        double r5265998 = b;
        double r5265999 = c;
        double r5266000 = r5265998 * r5265999;
        double r5266001 = r5265997 + r5266000;
        double r5266002 = r5265984 * r5265994;
        double r5266003 = i;
        double r5266004 = r5266002 * r5266003;
        double r5266005 = r5266001 - r5266004;
        double r5266006 = j;
        double r5266007 = 27.0;
        double r5266008 = r5266006 * r5266007;
        double r5266009 = k;
        double r5266010 = r5266008 * r5266009;
        double r5266011 = r5266005 - r5266010;
        return r5266011;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r5266012 = z;
        double r5266013 = -3.22480334132065e+67;
        bool r5266014 = r5266012 <= r5266013;
        double r5266015 = b;
        double r5266016 = c;
        double r5266017 = 18.0;
        double r5266018 = x;
        double r5266019 = r5266017 * r5266018;
        double r5266020 = t;
        double r5266021 = r5266019 * r5266020;
        double r5266022 = y;
        double r5266023 = r5266021 * r5266022;
        double r5266024 = r5266023 * r5266012;
        double r5266025 = 4.0;
        double r5266026 = a;
        double r5266027 = i;
        double r5266028 = r5266027 * r5266018;
        double r5266029 = fma(r5266020, r5266026, r5266028);
        double r5266030 = 27.0;
        double r5266031 = j;
        double r5266032 = r5266030 * r5266031;
        double r5266033 = k;
        double r5266034 = r5266032 * r5266033;
        double r5266035 = fma(r5266025, r5266029, r5266034);
        double r5266036 = r5266024 - r5266035;
        double r5266037 = fma(r5266015, r5266016, r5266036);
        double r5266038 = 3.7086816010480535e+124;
        bool r5266039 = r5266012 <= r5266038;
        double r5266040 = r5266012 * r5266022;
        double r5266041 = r5266040 * r5266018;
        double r5266042 = r5266020 * r5266041;
        double r5266043 = r5266042 * r5266017;
        double r5266044 = r5266043 - r5266035;
        double r5266045 = fma(r5266015, r5266016, r5266044);
        double r5266046 = r5266019 * r5266022;
        double r5266047 = r5266046 * r5266020;
        double r5266048 = r5266047 * r5266012;
        double r5266049 = cbrt(r5266033);
        double r5266050 = r5266049 * r5266049;
        double r5266051 = r5266050 * r5266032;
        double r5266052 = r5266049 * r5266051;
        double r5266053 = fma(r5266025, r5266029, r5266052);
        double r5266054 = r5266048 - r5266053;
        double r5266055 = fma(r5266015, r5266016, r5266054);
        double r5266056 = r5266039 ? r5266045 : r5266055;
        double r5266057 = r5266014 ? r5266037 : r5266056;
        return r5266057;
}

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 z < -3.22480334132065e+67

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

      \[\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-*r*1.5

      \[\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), \left(27 \cdot j\right) \cdot k\right)\right)\]
    5. Using strategy rm
    6. Applied associate-*r*2.4

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

    if -3.22480334132065e+67 < z < 3.7086816010480535e+124

    1. Initial program 4.6

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

      \[\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. Taylor expanded around inf 2.3

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

    if 3.7086816010480535e+124 < z

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

      \[\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-*r*1.2

      \[\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), \left(27 \cdot j\right) \cdot k\right)\right)\]
    5. Using strategy rm
    6. Applied add-cube-cbrt1.5

      \[\leadsto \mathsf{fma}\left(b, c, \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), \left(27 \cdot j\right) \cdot \color{blue}{\left(\left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right) \cdot \sqrt[3]{k}\right)}\right)\right)\]
    7. Applied associate-*r*1.5

      \[\leadsto \mathsf{fma}\left(b, c, \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), \color{blue}{\left(\left(27 \cdot j\right) \cdot \left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right)\right) \cdot \sqrt[3]{k}}\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.2

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

Reproduce

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