Average Error: 5.8 → 1.4
Time: 28.7s
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 -5.771702439406874937861711724651597749554 \cdot 10^{51} \lor \neg \left(t \le 0.0965905518888733327642626136366743594408\right):\\ \;\;\;\;\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, i \cdot x\right), \left(\sqrt{27} \cdot j\right) \cdot \left(\sqrt{27} \cdot k\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(y \cdot \left(z \cdot \left(x \cdot t\right)\right)\right) \cdot 18 - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(j \cdot k\right) \cdot 27\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}\;t \le -5.771702439406874937861711724651597749554 \cdot 10^{51} \lor \neg \left(t \le 0.0965905518888733327642626136366743594408\right):\\
\;\;\;\;\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, i \cdot x\right), \left(\sqrt{27} \cdot j\right) \cdot \left(\sqrt{27} \cdot k\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(y \cdot \left(z \cdot \left(x \cdot t\right)\right)\right) \cdot 18 - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(j \cdot k\right) \cdot 27\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 r85119 = x;
        double r85120 = 18.0;
        double r85121 = r85119 * r85120;
        double r85122 = y;
        double r85123 = r85121 * r85122;
        double r85124 = z;
        double r85125 = r85123 * r85124;
        double r85126 = t;
        double r85127 = r85125 * r85126;
        double r85128 = a;
        double r85129 = 4.0;
        double r85130 = r85128 * r85129;
        double r85131 = r85130 * r85126;
        double r85132 = r85127 - r85131;
        double r85133 = b;
        double r85134 = c;
        double r85135 = r85133 * r85134;
        double r85136 = r85132 + r85135;
        double r85137 = r85119 * r85129;
        double r85138 = i;
        double r85139 = r85137 * r85138;
        double r85140 = r85136 - r85139;
        double r85141 = j;
        double r85142 = 27.0;
        double r85143 = r85141 * r85142;
        double r85144 = k;
        double r85145 = r85143 * r85144;
        double r85146 = r85140 - r85145;
        return r85146;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r85147 = t;
        double r85148 = -5.771702439406875e+51;
        bool r85149 = r85147 <= r85148;
        double r85150 = 0.09659055188887333;
        bool r85151 = r85147 <= r85150;
        double r85152 = !r85151;
        bool r85153 = r85149 || r85152;
        double r85154 = b;
        double r85155 = c;
        double r85156 = x;
        double r85157 = 18.0;
        double r85158 = r85156 * r85157;
        double r85159 = y;
        double r85160 = r85158 * r85159;
        double r85161 = z;
        double r85162 = r85160 * r85161;
        double r85163 = r85162 * r85147;
        double r85164 = 4.0;
        double r85165 = a;
        double r85166 = i;
        double r85167 = r85166 * r85156;
        double r85168 = fma(r85147, r85165, r85167);
        double r85169 = 27.0;
        double r85170 = sqrt(r85169);
        double r85171 = j;
        double r85172 = r85170 * r85171;
        double r85173 = k;
        double r85174 = r85170 * r85173;
        double r85175 = r85172 * r85174;
        double r85176 = fma(r85164, r85168, r85175);
        double r85177 = r85163 - r85176;
        double r85178 = fma(r85154, r85155, r85177);
        double r85179 = r85156 * r85147;
        double r85180 = r85161 * r85179;
        double r85181 = r85159 * r85180;
        double r85182 = r85181 * r85157;
        double r85183 = r85171 * r85173;
        double r85184 = r85183 * r85169;
        double r85185 = fma(r85164, r85168, r85184);
        double r85186 = r85182 - r85185;
        double r85187 = fma(r85154, r85155, r85186);
        double r85188 = r85153 ? r85178 : r85187;
        return r85188;
}

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 t < -5.771702439406875e+51 or 0.09659055188887333 < t

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

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

      \[\leadsto \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), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt1.2

      \[\leadsto \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), \color{blue}{\left(\sqrt{27} \cdot \sqrt{27}\right)} \cdot \left(j \cdot k\right)\right)\right)\]
    7. Applied associate-*l*1.2

      \[\leadsto \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), \color{blue}{\sqrt{27} \cdot \left(\sqrt{27} \cdot \left(j \cdot k\right)\right)}\right)\right)\]
    8. Simplified1.2

      \[\leadsto \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), \sqrt{27} \cdot \color{blue}{\left(k \cdot \left(j \cdot \sqrt{27}\right)\right)}\right)\right)\]
    9. Using strategy rm
    10. Applied associate-*r*1.2

      \[\leadsto \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), \color{blue}{\left(\sqrt{27} \cdot k\right) \cdot \left(j \cdot \sqrt{27}\right)}\right)\right)\]

    if -5.771702439406875e+51 < t < 0.09659055188887333

    1. Initial program 8.0

      \[\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.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. Using strategy rm
    4. Applied associate-*l*7.8

      \[\leadsto \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), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    5. Taylor expanded around inf 8.2

      \[\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), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    6. Simplified1.5

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

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

Reproduce

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