Average Error: 5.3 → 0.8
Time: 28.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}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\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}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\

\mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\
\;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\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 r4561438 = x;
        double r4561439 = 18.0;
        double r4561440 = r4561438 * r4561439;
        double r4561441 = y;
        double r4561442 = r4561440 * r4561441;
        double r4561443 = z;
        double r4561444 = r4561442 * r4561443;
        double r4561445 = t;
        double r4561446 = r4561444 * r4561445;
        double r4561447 = a;
        double r4561448 = 4.0;
        double r4561449 = r4561447 * r4561448;
        double r4561450 = r4561449 * r4561445;
        double r4561451 = r4561446 - r4561450;
        double r4561452 = b;
        double r4561453 = c;
        double r4561454 = r4561452 * r4561453;
        double r4561455 = r4561451 + r4561454;
        double r4561456 = r4561438 * r4561448;
        double r4561457 = i;
        double r4561458 = r4561456 * r4561457;
        double r4561459 = r4561455 - r4561458;
        double r4561460 = j;
        double r4561461 = 27.0;
        double r4561462 = r4561460 * r4561461;
        double r4561463 = k;
        double r4561464 = r4561462 * r4561463;
        double r4561465 = r4561459 - r4561464;
        return r4561465;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r4561466 = t;
        double r4561467 = x;
        double r4561468 = 18.0;
        double r4561469 = r4561467 * r4561468;
        double r4561470 = y;
        double r4561471 = r4561469 * r4561470;
        double r4561472 = z;
        double r4561473 = r4561471 * r4561472;
        double r4561474 = r4561466 * r4561473;
        double r4561475 = a;
        double r4561476 = 4.0;
        double r4561477 = r4561475 * r4561476;
        double r4561478 = r4561477 * r4561466;
        double r4561479 = r4561474 - r4561478;
        double r4561480 = c;
        double r4561481 = b;
        double r4561482 = r4561480 * r4561481;
        double r4561483 = r4561479 + r4561482;
        double r4561484 = r4561467 * r4561476;
        double r4561485 = i;
        double r4561486 = r4561484 * r4561485;
        double r4561487 = r4561483 - r4561486;
        double r4561488 = 27.0;
        double r4561489 = j;
        double r4561490 = r4561488 * r4561489;
        double r4561491 = k;
        double r4561492 = r4561490 * r4561491;
        double r4561493 = r4561487 - r4561492;
        double r4561494 = -inf.0;
        bool r4561495 = r4561493 <= r4561494;
        double r4561496 = r4561466 * r4561472;
        double r4561497 = r4561470 * r4561468;
        double r4561498 = r4561496 * r4561497;
        double r4561499 = r4561498 * r4561467;
        double r4561500 = r4561467 * r4561485;
        double r4561501 = fma(r4561466, r4561475, r4561500);
        double r4561502 = r4561491 * r4561489;
        double r4561503 = r4561502 * r4561488;
        double r4561504 = fma(r4561476, r4561501, r4561503);
        double r4561505 = r4561499 - r4561504;
        double r4561506 = fma(r4561481, r4561480, r4561505);
        double r4561507 = 2.0918175593925538e+304;
        bool r4561508 = r4561493 <= r4561507;
        double r4561509 = r4561508 ? r4561493 : r4561506;
        double r4561510 = r4561495 ? r4561506 : r4561509;
        return r4561510;
}

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 55.7

      \[\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. Simplified14.5

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

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

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

      \[\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.0\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    8. Using strategy rm
    9. Applied pow111.1

      \[\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.0}^{1}}\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    10. Applied pow111.1

      \[\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.0}^{1}\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    11. Applied pow-prod-down11.1

      \[\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.0\right)}^{1}} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    12. Applied pow111.1

      \[\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.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    13. Applied pow111.1

      \[\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.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    14. Applied pow111.1

      \[\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.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    15. Applied pow-prod-down11.1

      \[\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.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    16. Applied pow-prod-down11.1

      \[\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.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    17. Applied pow-prod-down11.1

      \[\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.0\right)\right)}^{1}} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    18. Simplified6.0

      \[\leadsto \mathsf{fma}\left(b, c, {\color{blue}{\left(x \cdot \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right)\right)}}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \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.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\]
  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.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\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)))