Average Error: 12.3 → 12.2
Time: 19.0s
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}\;x \le -2.022243485415823 \cdot 10^{-191} \lor \neg \left(x \le 4.52441735268922567 \cdot 10^{-150}\right):\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\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}\;x \le -2.022243485415823 \cdot 10^{-191} \lor \neg \left(x \le 4.52441735268922567 \cdot 10^{-150}\right):\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\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 r160096 = x;
        double r160097 = y;
        double r160098 = z;
        double r160099 = r160097 * r160098;
        double r160100 = t;
        double r160101 = a;
        double r160102 = r160100 * r160101;
        double r160103 = r160099 - r160102;
        double r160104 = r160096 * r160103;
        double r160105 = b;
        double r160106 = c;
        double r160107 = r160106 * r160098;
        double r160108 = i;
        double r160109 = r160108 * r160101;
        double r160110 = r160107 - r160109;
        double r160111 = r160105 * r160110;
        double r160112 = r160104 - r160111;
        double r160113 = j;
        double r160114 = r160106 * r160100;
        double r160115 = r160108 * r160097;
        double r160116 = r160114 - r160115;
        double r160117 = r160113 * r160116;
        double r160118 = r160112 + r160117;
        return r160118;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r160119 = x;
        double r160120 = -2.0222434854158232e-191;
        bool r160121 = r160119 <= r160120;
        double r160122 = 4.5244173526892257e-150;
        bool r160123 = r160119 <= r160122;
        double r160124 = !r160123;
        bool r160125 = r160121 || r160124;
        double r160126 = c;
        double r160127 = t;
        double r160128 = r160126 * r160127;
        double r160129 = i;
        double r160130 = y;
        double r160131 = r160129 * r160130;
        double r160132 = r160128 - r160131;
        double r160133 = j;
        double r160134 = z;
        double r160135 = a;
        double r160136 = r160135 * r160127;
        double r160137 = -r160136;
        double r160138 = fma(r160130, r160134, r160137);
        double r160139 = r160119 * r160138;
        double r160140 = -r160135;
        double r160141 = fma(r160140, r160127, r160136);
        double r160142 = r160119 * r160141;
        double r160143 = r160139 + r160142;
        double r160144 = b;
        double r160145 = r160126 * r160134;
        double r160146 = r160129 * r160135;
        double r160147 = r160145 - r160146;
        double r160148 = r160144 * r160147;
        double r160149 = r160135 * r160129;
        double r160150 = fma(r160140, r160129, r160149);
        double r160151 = r160144 * r160150;
        double r160152 = r160148 + r160151;
        double r160153 = r160143 - r160152;
        double r160154 = fma(r160132, r160133, r160153);
        double r160155 = 0.0;
        double r160156 = r160155 - r160152;
        double r160157 = fma(r160132, r160133, r160156);
        double r160158 = r160125 ? r160154 : r160157;
        return r160158;
}

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 x < -2.0222434854158232e-191 or 4.5244173526892257e-150 < x

    1. Initial program 10.2

      \[\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. Simplified10.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot t - i \cdot y, j, 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 prod-diff10.2

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

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

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

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

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

    if -2.0222434854158232e-191 < x < 4.5244173526892257e-150

    1. Initial program 17.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. Simplified17.4

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot t - i \cdot y, j, 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 prod-diff17.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.022243485415823 \cdot 10^{-191} \lor \neg \left(x \le 4.52441735268922567 \cdot 10^{-150}\right):\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right)\\ \end{array}\]

Reproduce

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