Average Error: 5.5 → 4.4
Time: 26.8s
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}\;i \le 5.682409937816479661124069200231017736832 \cdot 10^{-235}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right)\right) \cdot y - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot j\right) \cdot k\right)\right)\\ \mathbf{elif}\;i \le 324706090785267736481278698476279955456:\\ \;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(\left(z \cdot y\right) \cdot \left(x \cdot t\right)\right) - \mathsf{fma}\left(k \cdot j, 27, 4 \cdot \mathsf{fma}\left(a, t, x \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\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)\\ \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}\;i \le 5.682409937816479661124069200231017736832 \cdot 10^{-235}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot \left(z \cdot \left(x \cdot t\right)\right)\right) \cdot y - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot j\right) \cdot k\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\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)\\

\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 r5336155 = x;
        double r5336156 = 18.0;
        double r5336157 = r5336155 * r5336156;
        double r5336158 = y;
        double r5336159 = r5336157 * r5336158;
        double r5336160 = z;
        double r5336161 = r5336159 * r5336160;
        double r5336162 = t;
        double r5336163 = r5336161 * r5336162;
        double r5336164 = a;
        double r5336165 = 4.0;
        double r5336166 = r5336164 * r5336165;
        double r5336167 = r5336166 * r5336162;
        double r5336168 = r5336163 - r5336167;
        double r5336169 = b;
        double r5336170 = c;
        double r5336171 = r5336169 * r5336170;
        double r5336172 = r5336168 + r5336171;
        double r5336173 = r5336155 * r5336165;
        double r5336174 = i;
        double r5336175 = r5336173 * r5336174;
        double r5336176 = r5336172 - r5336175;
        double r5336177 = j;
        double r5336178 = 27.0;
        double r5336179 = r5336177 * r5336178;
        double r5336180 = k;
        double r5336181 = r5336179 * r5336180;
        double r5336182 = r5336176 - r5336181;
        return r5336182;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r5336183 = i;
        double r5336184 = 5.68240993781648e-235;
        bool r5336185 = r5336183 <= r5336184;
        double r5336186 = b;
        double r5336187 = c;
        double r5336188 = 18.0;
        double r5336189 = z;
        double r5336190 = x;
        double r5336191 = t;
        double r5336192 = r5336190 * r5336191;
        double r5336193 = r5336189 * r5336192;
        double r5336194 = r5336188 * r5336193;
        double r5336195 = y;
        double r5336196 = r5336194 * r5336195;
        double r5336197 = 4.0;
        double r5336198 = a;
        double r5336199 = r5336190 * r5336183;
        double r5336200 = fma(r5336191, r5336198, r5336199);
        double r5336201 = 27.0;
        double r5336202 = j;
        double r5336203 = r5336201 * r5336202;
        double r5336204 = k;
        double r5336205 = r5336203 * r5336204;
        double r5336206 = fma(r5336197, r5336200, r5336205);
        double r5336207 = r5336196 - r5336206;
        double r5336208 = fma(r5336186, r5336187, r5336207);
        double r5336209 = 3.2470609078526774e+38;
        bool r5336210 = r5336183 <= r5336209;
        double r5336211 = r5336189 * r5336195;
        double r5336212 = r5336211 * r5336192;
        double r5336213 = r5336188 * r5336212;
        double r5336214 = r5336204 * r5336202;
        double r5336215 = fma(r5336198, r5336191, r5336199);
        double r5336216 = r5336197 * r5336215;
        double r5336217 = fma(r5336214, r5336201, r5336216);
        double r5336218 = r5336213 - r5336217;
        double r5336219 = fma(r5336186, r5336187, r5336218);
        double r5336220 = r5336189 * r5336190;
        double r5336221 = r5336191 * r5336220;
        double r5336222 = r5336195 * r5336221;
        double r5336223 = r5336188 * r5336222;
        double r5336224 = r5336223 - r5336206;
        double r5336225 = fma(r5336186, r5336187, r5336224);
        double r5336226 = r5336210 ? r5336219 : r5336225;
        double r5336227 = r5336185 ? r5336208 : r5336226;
        return r5336227;
}

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 i < 5.68240993781648e-235

    1. Initial program 5.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. Simplified5.0

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

      \[\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)\]
    4. Using strategy rm
    5. Applied associate-*r*6.3

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

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

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

    if 5.68240993781648e-235 < i < 3.2470609078526774e+38

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

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

      \[\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)\]
    4. Using strategy rm
    5. Applied associate-*r*6.4

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

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

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

    if 3.2470609078526774e+38 < i

    1. Initial program 4.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.9

      \[\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 7.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)\]
    4. Using strategy rm
    5. Applied associate-*r*7.0

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

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

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

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

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

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

Reproduce

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