Average Error: 11.8 → 9.9
Time: 1.2m
Precision: 64
\[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.827232257640775845668916842368578499537 \cdot 10^{78}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\ \mathbf{elif}\;z \le 2.655468675482446383692527222545484495067 \cdot 10^{98}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\ \end{array}\]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\begin{array}{l}
\mathbf{if}\;z \le -5.827232257640775845668916842368578499537 \cdot 10^{78}:\\
\;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\

\mathbf{elif}\;z \le 2.655468675482446383692527222545484495067 \cdot 10^{98}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r4399695 = x;
        double r4399696 = y;
        double r4399697 = z;
        double r4399698 = r4399696 * r4399697;
        double r4399699 = t;
        double r4399700 = a;
        double r4399701 = r4399699 * r4399700;
        double r4399702 = r4399698 - r4399701;
        double r4399703 = r4399695 * r4399702;
        double r4399704 = b;
        double r4399705 = c;
        double r4399706 = r4399705 * r4399697;
        double r4399707 = i;
        double r4399708 = r4399707 * r4399700;
        double r4399709 = r4399706 - r4399708;
        double r4399710 = r4399704 * r4399709;
        double r4399711 = r4399703 - r4399710;
        double r4399712 = j;
        double r4399713 = r4399705 * r4399699;
        double r4399714 = r4399707 * r4399696;
        double r4399715 = r4399713 - r4399714;
        double r4399716 = r4399712 * r4399715;
        double r4399717 = r4399711 + r4399716;
        return r4399717;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r4399718 = z;
        double r4399719 = -5.827232257640776e+78;
        bool r4399720 = r4399718 <= r4399719;
        double r4399721 = x;
        double r4399722 = y;
        double r4399723 = r4399721 * r4399722;
        double r4399724 = b;
        double r4399725 = c;
        double r4399726 = r4399724 * r4399725;
        double r4399727 = r4399723 - r4399726;
        double r4399728 = r4399718 * r4399727;
        double r4399729 = t;
        double r4399730 = a;
        double r4399731 = r4399730 * r4399721;
        double r4399732 = r4399729 * r4399731;
        double r4399733 = r4399728 - r4399732;
        double r4399734 = r4399729 * r4399725;
        double r4399735 = i;
        double r4399736 = r4399722 * r4399735;
        double r4399737 = r4399734 - r4399736;
        double r4399738 = j;
        double r4399739 = r4399737 * r4399738;
        double r4399740 = r4399733 + r4399739;
        double r4399741 = 2.6554686754824464e+98;
        bool r4399742 = r4399718 <= r4399741;
        double r4399743 = r4399730 * r4399735;
        double r4399744 = r4399725 * r4399718;
        double r4399745 = r4399743 - r4399744;
        double r4399746 = r4399722 * r4399718;
        double r4399747 = r4399729 * r4399730;
        double r4399748 = r4399746 - r4399747;
        double r4399749 = r4399748 * r4399721;
        double r4399750 = fma(r4399745, r4399724, r4399749);
        double r4399751 = cbrt(r4399737);
        double r4399752 = r4399751 * r4399738;
        double r4399753 = r4399751 * r4399751;
        double r4399754 = r4399752 * r4399753;
        double r4399755 = r4399750 + r4399754;
        double r4399756 = r4399742 ? r4399755 : r4399740;
        double r4399757 = r4399720 ? r4399740 : r4399756;
        return r4399757;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -5.827232257640776e+78 or 2.6554686754824464e+98 < z

    1. Initial program 20.3

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    2. Simplified20.3

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

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

      \[\leadsto \left(t \cdot c - i \cdot y\right) \cdot j + \color{blue}{\left(x \cdot \left(z \cdot y\right) - \left(z \cdot \left(b \cdot c\right) + t \cdot \left(x \cdot a\right)\right)\right)}\]
    6. Simplified11.9

      \[\leadsto \left(t \cdot c - i \cdot y\right) \cdot j + \color{blue}{\left(z \cdot \left(y \cdot x - c \cdot b\right) - t \cdot \left(a \cdot x\right)\right)}\]

    if -5.827232257640776e+78 < z < 2.6554686754824464e+98

    1. Initial program 8.9

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    2. Simplified8.9

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

      \[\leadsto \color{blue}{\left(t \cdot c - i \cdot y\right) \cdot j + \mathsf{fma}\left(i \cdot a - z \cdot c, b, \left(z \cdot y - t \cdot a\right) \cdot x\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt9.3

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{t \cdot c - i \cdot y} \cdot \sqrt[3]{t \cdot c - i \cdot y}\right) \cdot \sqrt[3]{t \cdot c - i \cdot y}\right)} \cdot j + \mathsf{fma}\left(i \cdot a - z \cdot c, b, \left(z \cdot y - t \cdot a\right) \cdot x\right)\]
    7. Applied associate-*l*9.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.827232257640775845668916842368578499537 \cdot 10^{78}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\ \mathbf{elif}\;z \le 2.655468675482446383692527222545484495067 \cdot 10^{98}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y - b \cdot c\right) - t \cdot \left(a \cdot x\right)\right) + \left(t \cdot c - y \cdot i\right) \cdot j\\ \end{array}\]

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))