Average Error: 5.5 → 4.3
Time: 38.9s
Precision: 64
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -9.143945423632256 \cdot 10^{-114}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(y \cdot \left(x \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t \le 1.2277333728362376 \cdot 10^{-143}:\\ \;\;\;\;\mathsf{fma}\left(\left(4.0 \cdot \left(-a\right)\right), t, \left(b \cdot c - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(4.0 \cdot x\right) \cdot i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(x \cdot \left(y \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\right)\right)\right)\right)\\ \end{array}\]
\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \le -9.143945423632256 \cdot 10^{-114}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(y \cdot \left(x \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\right)\right)\right)\right)\\

\mathbf{elif}\;t \le 1.2277333728362376 \cdot 10^{-143}:\\
\;\;\;\;\mathsf{fma}\left(\left(4.0 \cdot \left(-a\right)\right), t, \left(b \cdot c - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(4.0 \cdot x\right) \cdot i\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(x \cdot \left(y \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\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 r4353234 = x;
        double r4353235 = 18.0;
        double r4353236 = r4353234 * r4353235;
        double r4353237 = y;
        double r4353238 = r4353236 * r4353237;
        double r4353239 = z;
        double r4353240 = r4353238 * r4353239;
        double r4353241 = t;
        double r4353242 = r4353240 * r4353241;
        double r4353243 = a;
        double r4353244 = 4.0;
        double r4353245 = r4353243 * r4353244;
        double r4353246 = r4353245 * r4353241;
        double r4353247 = r4353242 - r4353246;
        double r4353248 = b;
        double r4353249 = c;
        double r4353250 = r4353248 * r4353249;
        double r4353251 = r4353247 + r4353250;
        double r4353252 = r4353234 * r4353244;
        double r4353253 = i;
        double r4353254 = r4353252 * r4353253;
        double r4353255 = r4353251 - r4353254;
        double r4353256 = j;
        double r4353257 = 27.0;
        double r4353258 = r4353256 * r4353257;
        double r4353259 = k;
        double r4353260 = r4353258 * r4353259;
        double r4353261 = r4353255 - r4353260;
        return r4353261;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r4353262 = t;
        double r4353263 = -9.143945423632256e-114;
        bool r4353264 = r4353262 <= r4353263;
        double r4353265 = y;
        double r4353266 = x;
        double r4353267 = z;
        double r4353268 = r4353266 * r4353267;
        double r4353269 = r4353265 * r4353268;
        double r4353270 = 18.0;
        double r4353271 = r4353269 * r4353270;
        double r4353272 = a;
        double r4353273 = 4.0;
        double r4353274 = r4353272 * r4353273;
        double r4353275 = r4353271 - r4353274;
        double r4353276 = b;
        double r4353277 = c;
        double r4353278 = r4353276 * r4353277;
        double r4353279 = 27.0;
        double r4353280 = k;
        double r4353281 = j;
        double r4353282 = r4353280 * r4353281;
        double r4353283 = i;
        double r4353284 = r4353283 * r4353266;
        double r4353285 = r4353273 * r4353284;
        double r4353286 = fma(r4353279, r4353282, r4353285);
        double r4353287 = r4353278 - r4353286;
        double r4353288 = fma(r4353275, r4353262, r4353287);
        double r4353289 = 1.2277333728362376e-143;
        bool r4353290 = r4353262 <= r4353289;
        double r4353291 = -r4353272;
        double r4353292 = r4353273 * r4353291;
        double r4353293 = r4353279 * r4353281;
        double r4353294 = r4353273 * r4353266;
        double r4353295 = r4353294 * r4353283;
        double r4353296 = fma(r4353280, r4353293, r4353295);
        double r4353297 = r4353278 - r4353296;
        double r4353298 = fma(r4353292, r4353262, r4353297);
        double r4353299 = r4353265 * r4353267;
        double r4353300 = r4353266 * r4353299;
        double r4353301 = r4353300 * r4353270;
        double r4353302 = r4353301 - r4353274;
        double r4353303 = fma(r4353302, r4353262, r4353287);
        double r4353304 = r4353290 ? r4353298 : r4353303;
        double r4353305 = r4353264 ? r4353288 : r4353304;
        return r4353305;
}

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 t < -9.143945423632256e-114

    1. Initial program 3.0

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified3.0

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z - a \cdot 4.0\right), t, \left(c \cdot b - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(x \cdot 4.0\right) \cdot i\right)\right)\right)\right)}\]
    3. Taylor expanded around -inf 3.4

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

      \[\leadsto \mathsf{fma}\left(\left(18.0 \cdot \left(x \cdot \left(z \cdot y\right)\right) - a \cdot 4.0\right), t, \left(c \cdot b - \color{blue}{\left(27.0 \cdot \left(j \cdot k\right) + 4.0 \cdot \left(i \cdot x\right)\right)}\right)\right)\]
    5. Simplified3.4

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

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

    if -9.143945423632256e-114 < t < 1.2277333728362376e-143

    1. Initial program 9.3

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified9.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z - a \cdot 4.0\right), t, \left(c \cdot b - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(x \cdot 4.0\right) \cdot i\right)\right)\right)\right)}\]
    3. Taylor expanded around -inf 9.8

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

      \[\leadsto \mathsf{fma}\left(\left(\color{blue}{0} - a \cdot 4.0\right), t, \left(c \cdot b - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(x \cdot 4.0\right) \cdot i\right)\right)\right)\right)\]

    if 1.2277333728362376e-143 < t

    1. Initial program 3.4

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified3.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z - a \cdot 4.0\right), t, \left(c \cdot b - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(x \cdot 4.0\right) \cdot i\right)\right)\right)\right)}\]
    3. Taylor expanded around -inf 4.0

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

      \[\leadsto \mathsf{fma}\left(\left(18.0 \cdot \left(x \cdot \left(z \cdot y\right)\right) - a \cdot 4.0\right), t, \left(c \cdot b - \color{blue}{\left(27.0 \cdot \left(j \cdot k\right) + 4.0 \cdot \left(i \cdot x\right)\right)}\right)\right)\]
    5. Simplified3.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -9.143945423632256 \cdot 10^{-114}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(y \cdot \left(x \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\right)\right)\right)\right)\\ \mathbf{elif}\;t \le 1.2277333728362376 \cdot 10^{-143}:\\ \;\;\;\;\mathsf{fma}\left(\left(4.0 \cdot \left(-a\right)\right), t, \left(b \cdot c - \mathsf{fma}\left(k, \left(27.0 \cdot j\right), \left(\left(4.0 \cdot x\right) \cdot i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(x \cdot \left(y \cdot z\right)\right) \cdot 18.0 - a \cdot 4.0\right), t, \left(b \cdot c - \mathsf{fma}\left(27.0, \left(k \cdot j\right), \left(4.0 \cdot \left(i \cdot x\right)\right)\right)\right)\right)\\ \end{array}\]

Reproduce

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