Average Error: 5.4 → 4.6
Time: 14.3s
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}\;x \le -2.128178469213580084801129175348611377707 \cdot 10^{-23}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(x \cdot \left(18 \cdot y\right)\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, j \cdot \left(27 \cdot k\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}\;x \le -2.128178469213580084801129175348611377707 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, \left(j \cdot 27\right) \cdot k\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(x \cdot \left(18 \cdot y\right)\right) \cdot z - a \cdot 4, b \cdot c - \mathsf{fma}\left(x, 4 \cdot i, j \cdot \left(27 \cdot k\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 r155092 = x;
        double r155093 = 18.0;
        double r155094 = r155092 * r155093;
        double r155095 = y;
        double r155096 = r155094 * r155095;
        double r155097 = z;
        double r155098 = r155096 * r155097;
        double r155099 = t;
        double r155100 = r155098 * r155099;
        double r155101 = a;
        double r155102 = 4.0;
        double r155103 = r155101 * r155102;
        double r155104 = r155103 * r155099;
        double r155105 = r155100 - r155104;
        double r155106 = b;
        double r155107 = c;
        double r155108 = r155106 * r155107;
        double r155109 = r155105 + r155108;
        double r155110 = r155092 * r155102;
        double r155111 = i;
        double r155112 = r155110 * r155111;
        double r155113 = r155109 - r155112;
        double r155114 = j;
        double r155115 = 27.0;
        double r155116 = r155114 * r155115;
        double r155117 = k;
        double r155118 = r155116 * r155117;
        double r155119 = r155113 - r155118;
        return r155119;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r155120 = x;
        double r155121 = -2.12817846921358e-23;
        bool r155122 = r155120 <= r155121;
        double r155123 = t;
        double r155124 = 18.0;
        double r155125 = r155120 * r155124;
        double r155126 = y;
        double r155127 = z;
        double r155128 = r155126 * r155127;
        double r155129 = r155125 * r155128;
        double r155130 = a;
        double r155131 = 4.0;
        double r155132 = r155130 * r155131;
        double r155133 = r155129 - r155132;
        double r155134 = b;
        double r155135 = c;
        double r155136 = r155134 * r155135;
        double r155137 = i;
        double r155138 = r155131 * r155137;
        double r155139 = j;
        double r155140 = 27.0;
        double r155141 = r155139 * r155140;
        double r155142 = k;
        double r155143 = r155141 * r155142;
        double r155144 = fma(r155120, r155138, r155143);
        double r155145 = r155136 - r155144;
        double r155146 = fma(r155123, r155133, r155145);
        double r155147 = r155124 * r155126;
        double r155148 = r155120 * r155147;
        double r155149 = r155148 * r155127;
        double r155150 = r155149 - r155132;
        double r155151 = r155140 * r155142;
        double r155152 = r155139 * r155151;
        double r155153 = fma(r155120, r155138, r155152);
        double r155154 = r155136 - r155153;
        double r155155 = fma(r155123, r155150, r155154);
        double r155156 = r155122 ? r155146 : r155155;
        return r155156;
}

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 2 regimes
  2. if x < -2.12817846921358e-23

    1. Initial program 11.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. Simplified11.2

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

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

    if -2.12817846921358e-23 < x

    1. Initial program 3.9

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

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

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

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

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

Reproduce

herbie shell --seed 2019352 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))