Average Error: 5.7 → 3.5
Time: 29.5s
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 -3.308576004970711423906714916915033699205 \cdot 10^{-41}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 925478270354778253145669632:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(z \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \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}\;t \le -3.308576004970711423906714916915033699205 \cdot 10^{-41}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(j \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 r9671512 = x;
        double r9671513 = 18.0;
        double r9671514 = r9671512 * r9671513;
        double r9671515 = y;
        double r9671516 = r9671514 * r9671515;
        double r9671517 = z;
        double r9671518 = r9671516 * r9671517;
        double r9671519 = t;
        double r9671520 = r9671518 * r9671519;
        double r9671521 = a;
        double r9671522 = 4.0;
        double r9671523 = r9671521 * r9671522;
        double r9671524 = r9671523 * r9671519;
        double r9671525 = r9671520 - r9671524;
        double r9671526 = b;
        double r9671527 = c;
        double r9671528 = r9671526 * r9671527;
        double r9671529 = r9671525 + r9671528;
        double r9671530 = r9671512 * r9671522;
        double r9671531 = i;
        double r9671532 = r9671530 * r9671531;
        double r9671533 = r9671529 - r9671532;
        double r9671534 = j;
        double r9671535 = 27.0;
        double r9671536 = r9671534 * r9671535;
        double r9671537 = k;
        double r9671538 = r9671536 * r9671537;
        double r9671539 = r9671533 - r9671538;
        return r9671539;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r9671540 = t;
        double r9671541 = -3.3085760049707114e-41;
        bool r9671542 = r9671540 <= r9671541;
        double r9671543 = b;
        double r9671544 = c;
        double r9671545 = x;
        double r9671546 = 18.0;
        double r9671547 = r9671545 * r9671546;
        double r9671548 = y;
        double r9671549 = z;
        double r9671550 = r9671548 * r9671549;
        double r9671551 = r9671547 * r9671550;
        double r9671552 = r9671551 * r9671540;
        double r9671553 = 4.0;
        double r9671554 = a;
        double r9671555 = i;
        double r9671556 = r9671555 * r9671545;
        double r9671557 = fma(r9671540, r9671554, r9671556);
        double r9671558 = 27.0;
        double r9671559 = j;
        double r9671560 = k;
        double r9671561 = r9671559 * r9671560;
        double r9671562 = r9671558 * r9671561;
        double r9671563 = fma(r9671553, r9671557, r9671562);
        double r9671564 = r9671552 - r9671563;
        double r9671565 = fma(r9671543, r9671544, r9671564);
        double r9671566 = 9.254782703547783e+26;
        bool r9671567 = r9671540 <= r9671566;
        double r9671568 = r9671547 * r9671548;
        double r9671569 = r9671549 * r9671540;
        double r9671570 = r9671568 * r9671569;
        double r9671571 = r9671570 - r9671563;
        double r9671572 = fma(r9671543, r9671544, r9671571);
        double r9671573 = r9671567 ? r9671572 : r9671565;
        double r9671574 = r9671542 ? r9671565 : r9671573;
        return r9671574;
}

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 < -3.3085760049707114e-41 or 9.254782703547783e+26 < t

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

      \[\leadsto \color{blue}{\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(j \cdot 27\right) \cdot k\right)\right)}\]
    3. Taylor expanded around 0 1.7

      \[\leadsto \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), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    4. Using strategy rm
    5. Applied associate-*l*2.1

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

    if -3.3085760049707114e-41 < t < 9.254782703547783e+26

    1. Initial program 8.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. Simplified8.1

      \[\leadsto \color{blue}{\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(j \cdot 27\right) \cdot k\right)\right)}\]
    3. Taylor expanded around 0 8.0

      \[\leadsto \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), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]
    4. Using strategy rm
    5. Applied associate-*l*4.3

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

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

Reproduce

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