Average Error: 5.7 → 4.0
Time: 27.1s
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.624852689735996891647709392603199582496 \cdot 10^{-74}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(z \cdot t\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{elif}\;z \le 2.780589155175302159079260840210876793124 \cdot 10^{-77}:\\ \;\;\;\;\mathsf{fma}\left(c, b, 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\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.624852689735996891647709392603199582496 \cdot 10^{-74}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(z \cdot t\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), j \cdot \left(27 \cdot k\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \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 r85138 = x;
        double r85139 = 18.0;
        double r85140 = r85138 * r85139;
        double r85141 = y;
        double r85142 = r85140 * r85141;
        double r85143 = z;
        double r85144 = r85142 * r85143;
        double r85145 = t;
        double r85146 = r85144 * r85145;
        double r85147 = a;
        double r85148 = 4.0;
        double r85149 = r85147 * r85148;
        double r85150 = r85149 * r85145;
        double r85151 = r85146 - r85150;
        double r85152 = b;
        double r85153 = c;
        double r85154 = r85152 * r85153;
        double r85155 = r85151 + r85154;
        double r85156 = r85138 * r85148;
        double r85157 = i;
        double r85158 = r85156 * r85157;
        double r85159 = r85155 - r85158;
        double r85160 = j;
        double r85161 = 27.0;
        double r85162 = r85160 * r85161;
        double r85163 = k;
        double r85164 = r85162 * r85163;
        double r85165 = r85159 - r85164;
        return r85165;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r85166 = z;
        double r85167 = -3.624852689735997e-74;
        bool r85168 = r85166 <= r85167;
        double r85169 = c;
        double r85170 = b;
        double r85171 = x;
        double r85172 = 18.0;
        double r85173 = r85171 * r85172;
        double r85174 = y;
        double r85175 = r85173 * r85174;
        double r85176 = t;
        double r85177 = r85166 * r85176;
        double r85178 = r85175 * r85177;
        double r85179 = fma(r85169, r85170, r85178);
        double r85180 = 4.0;
        double r85181 = a;
        double r85182 = i;
        double r85183 = r85171 * r85182;
        double r85184 = fma(r85176, r85181, r85183);
        double r85185 = j;
        double r85186 = 27.0;
        double r85187 = k;
        double r85188 = r85186 * r85187;
        double r85189 = r85185 * r85188;
        double r85190 = fma(r85180, r85184, r85189);
        double r85191 = r85179 - r85190;
        double r85192 = 2.780589155175302e-77;
        bool r85193 = r85166 <= r85192;
        double r85194 = r85166 * r85174;
        double r85195 = r85171 * r85194;
        double r85196 = r85176 * r85195;
        double r85197 = r85172 * r85196;
        double r85198 = fma(r85169, r85170, r85197);
        double r85199 = r85198 - r85190;
        double r85200 = r85175 * r85166;
        double r85201 = r85200 * r85176;
        double r85202 = fma(r85169, r85170, r85201);
        double r85203 = r85187 * r85185;
        double r85204 = r85186 * r85203;
        double r85205 = fma(r85180, r85184, r85204);
        double r85206 = r85202 - r85205;
        double r85207 = r85193 ? r85199 : r85206;
        double r85208 = r85168 ? r85191 : r85207;
        return r85208;
}

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.624852689735997e-74

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

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

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

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

    if -3.624852689735997e-74 < z < 2.780589155175302e-77

    1. Initial program 4.8

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

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

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

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

    if 2.780589155175302e-77 < z

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

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

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

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

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

Reproduce

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