Average Error: 5.5 → 0.8
Time: 1.0m
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}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18\right)\right) \cdot x - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k \le 2.091817559392553810929566838550160622791 \cdot 10^{304}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18\right)\right) \cdot x - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\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}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k = -\infty:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18\right)\right) \cdot x - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27\right)\right)\\

\mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k \le 2.091817559392553810929566838550160622791 \cdot 10^{304}:\\
\;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4\right) \cdot i\right) - \left(27 \cdot j\right) \cdot k\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18\right)\right) \cdot x - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\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 r5085492 = x;
        double r5085493 = 18.0;
        double r5085494 = r5085492 * r5085493;
        double r5085495 = y;
        double r5085496 = r5085494 * r5085495;
        double r5085497 = z;
        double r5085498 = r5085496 * r5085497;
        double r5085499 = t;
        double r5085500 = r5085498 * r5085499;
        double r5085501 = a;
        double r5085502 = 4.0;
        double r5085503 = r5085501 * r5085502;
        double r5085504 = r5085503 * r5085499;
        double r5085505 = r5085500 - r5085504;
        double r5085506 = b;
        double r5085507 = c;
        double r5085508 = r5085506 * r5085507;
        double r5085509 = r5085505 + r5085508;
        double r5085510 = r5085492 * r5085502;
        double r5085511 = i;
        double r5085512 = r5085510 * r5085511;
        double r5085513 = r5085509 - r5085512;
        double r5085514 = j;
        double r5085515 = 27.0;
        double r5085516 = r5085514 * r5085515;
        double r5085517 = k;
        double r5085518 = r5085516 * r5085517;
        double r5085519 = r5085513 - r5085518;
        return r5085519;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r5085520 = t;
        double r5085521 = x;
        double r5085522 = 18.0;
        double r5085523 = r5085521 * r5085522;
        double r5085524 = y;
        double r5085525 = r5085523 * r5085524;
        double r5085526 = z;
        double r5085527 = r5085525 * r5085526;
        double r5085528 = r5085520 * r5085527;
        double r5085529 = a;
        double r5085530 = 4.0;
        double r5085531 = r5085529 * r5085530;
        double r5085532 = r5085531 * r5085520;
        double r5085533 = r5085528 - r5085532;
        double r5085534 = c;
        double r5085535 = b;
        double r5085536 = r5085534 * r5085535;
        double r5085537 = r5085533 + r5085536;
        double r5085538 = r5085521 * r5085530;
        double r5085539 = i;
        double r5085540 = r5085538 * r5085539;
        double r5085541 = r5085537 - r5085540;
        double r5085542 = 27.0;
        double r5085543 = j;
        double r5085544 = r5085542 * r5085543;
        double r5085545 = k;
        double r5085546 = r5085544 * r5085545;
        double r5085547 = r5085541 - r5085546;
        double r5085548 = -inf.0;
        bool r5085549 = r5085547 <= r5085548;
        double r5085550 = r5085520 * r5085526;
        double r5085551 = r5085524 * r5085522;
        double r5085552 = r5085550 * r5085551;
        double r5085553 = r5085552 * r5085521;
        double r5085554 = r5085521 * r5085539;
        double r5085555 = fma(r5085520, r5085529, r5085554);
        double r5085556 = r5085545 * r5085543;
        double r5085557 = r5085556 * r5085542;
        double r5085558 = fma(r5085530, r5085555, r5085557);
        double r5085559 = r5085553 - r5085558;
        double r5085560 = fma(r5085535, r5085534, r5085559);
        double r5085561 = 2.0918175593925538e+304;
        bool r5085562 = r5085547 <= r5085561;
        double r5085563 = r5085562 ? r5085547 : r5085560;
        double r5085564 = r5085549 ? r5085560 : r5085563;
        return r5085564;
}

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 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < -inf.0 or 2.0918175593925538e+304 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \left(\color{blue}{{y}^{1}} \cdot {18}^{1}\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\]
    11. Applied pow-prod-down11.7

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

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(y \cdot 18\right)}^{1} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\]
    15. Applied pow-prod-down11.7

      \[\leadsto \mathsf{fma}\left(b, c, \left(\color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(y \cdot 18\right)}^{1} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\]
    16. Applied pow-prod-down11.7

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{{\left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(y \cdot 18\right)}^{1} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(k \cdot j\right)\right)\right)\]
    17. Applied pow-prod-down11.7

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

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

    if -inf.0 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < 2.0918175593925538e+304

    1. Initial program 0.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\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

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

Reproduce

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