Average Error: 12.1 → 10.7
Time: 35.8s
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}\;i \le -1.523975838926437049325436985847517895838 \cdot 10^{-47}:\\ \;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i\right) \cdot \left(a \cdot b\right)\right)\right)\\ \mathbf{elif}\;i \le 1.870505158309469934760476205535225084234 \cdot 10^{-21}:\\ \;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-i \cdot a\right) \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)\\ \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}\;i \le -1.523975838926437049325436985847517895838 \cdot 10^{-47}:\\
\;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i\right) \cdot \left(a \cdot b\right)\right)\right)\\

\mathbf{elif}\;i \le 1.870505158309469934760476205535225084234 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-i \cdot a\right) \cdot b\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\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 r106076 = x;
        double r106077 = y;
        double r106078 = z;
        double r106079 = r106077 * r106078;
        double r106080 = t;
        double r106081 = a;
        double r106082 = r106080 * r106081;
        double r106083 = r106079 - r106082;
        double r106084 = r106076 * r106083;
        double r106085 = b;
        double r106086 = c;
        double r106087 = r106086 * r106078;
        double r106088 = i;
        double r106089 = r106088 * r106081;
        double r106090 = r106087 - r106089;
        double r106091 = r106085 * r106090;
        double r106092 = r106084 - r106091;
        double r106093 = j;
        double r106094 = r106086 * r106080;
        double r106095 = r106088 * r106077;
        double r106096 = r106094 - r106095;
        double r106097 = r106093 * r106096;
        double r106098 = r106092 + r106097;
        return r106098;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r106099 = i;
        double r106100 = -1.523975838926437e-47;
        bool r106101 = r106099 <= r106100;
        double r106102 = j;
        double r106103 = c;
        double r106104 = t;
        double r106105 = r106103 * r106104;
        double r106106 = y;
        double r106107 = r106099 * r106106;
        double r106108 = r106105 - r106107;
        double r106109 = r106102 * r106108;
        double r106110 = x;
        double r106111 = z;
        double r106112 = r106106 * r106111;
        double r106113 = a;
        double r106114 = r106104 * r106113;
        double r106115 = r106112 - r106114;
        double r106116 = r106110 * r106115;
        double r106117 = b;
        double r106118 = r106117 * r106103;
        double r106119 = r106111 * r106118;
        double r106120 = -r106099;
        double r106121 = r106113 * r106117;
        double r106122 = r106120 * r106121;
        double r106123 = r106119 + r106122;
        double r106124 = r106116 - r106123;
        double r106125 = r106109 + r106124;
        double r106126 = 1.87050515830947e-21;
        bool r106127 = r106099 <= r106126;
        double r106128 = r106111 * r106117;
        double r106129 = r106128 * r106103;
        double r106130 = r106099 * r106113;
        double r106131 = -r106130;
        double r106132 = r106131 * r106117;
        double r106133 = r106129 + r106132;
        double r106134 = r106116 - r106133;
        double r106135 = fma(r106102, r106108, r106134);
        double r106136 = r106102 * r106103;
        double r106137 = r106104 * r106136;
        double r106138 = r106102 * r106106;
        double r106139 = r106099 * r106138;
        double r106140 = -r106139;
        double r106141 = r106137 + r106140;
        double r106142 = r106119 + r106132;
        double r106143 = r106116 - r106142;
        double r106144 = r106141 + r106143;
        double r106145 = r106127 ? r106135 : r106144;
        double r106146 = r106101 ? r106125 : r106145;
        return r106146;
}

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 3 regimes
  2. if i < -1.523975838926437e-47

    1. Initial program 14.5

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

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

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-i \cdot a\right)\right)}\right)\]
    5. Applied distribute-lft-in14.5

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-i \cdot a\right)\right)}\right)\]
    6. Simplified14.0

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{z \cdot \left(b \cdot c\right)} + b \cdot \left(-i \cdot a\right)\right)\right)\]
    7. Simplified14.0

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

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)}\]
    10. Using strategy rm
    11. Applied distribute-lft-neg-in14.0

      \[\leadsto j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(\left(-i\right) \cdot a\right)} \cdot b\right)\right)\]
    12. Applied associate-*l*11.0

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

    if -1.523975838926437e-47 < i < 1.87050515830947e-21

    1. Initial program 9.4

      \[\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. Simplified9.4

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

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-i \cdot a\right)\right)}\right)\]
    5. Applied distribute-lft-in9.4

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-i \cdot a\right)\right)}\right)\]
    6. Simplified10.3

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

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-i \cdot a\right) \cdot b}\right)\right)\]
    8. Using strategy rm
    9. Applied associate-*r*10.2

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

    if 1.87050515830947e-21 < i

    1. Initial program 16.0

      \[\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. Simplified16.0

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

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-i \cdot a\right)\right)}\right)\]
    5. Applied distribute-lft-in16.0

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

      \[\leadsto \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{z \cdot \left(b \cdot c\right)} + b \cdot \left(-i \cdot a\right)\right)\right)\]
    7. Simplified15.6

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

      \[\leadsto \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)}\]
    10. Using strategy rm
    11. Applied sub-neg15.6

      \[\leadsto j \cdot \color{blue}{\left(c \cdot t + \left(-i \cdot y\right)\right)} + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)\]
    12. Applied distribute-lft-in15.6

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

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

      \[\leadsto \left(t \cdot \left(j \cdot c\right) + \color{blue}{\left(-i \cdot \left(j \cdot y\right)\right)}\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le -1.523975838926437049325436985847517895838 \cdot 10^{-47}:\\ \;\;\;\;j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i\right) \cdot \left(a \cdot b\right)\right)\right)\\ \mathbf{elif}\;i \le 1.870505158309469934760476205535225084234 \cdot 10^{-21}:\\ \;\;\;\;\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-i \cdot a\right) \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-i \cdot a\right) \cdot b\right)\right)\\ \end{array}\]

Reproduce

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