Average Error: 12.3 → 10.9
Time: 8.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}\;x \le -102312353715.8873748779296875 \lor \neg \left(x \le 1.577773213365093702302687766619045382813 \cdot 10^{60}\right):\\ \;\;\;\;\left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + x \cdot \left(-t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \mathsf{fma}\left(c, t, -y \cdot i\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 -102312353715.8873748779296875 \lor \neg \left(x \le 1.577773213365093702302687766619045382813 \cdot 10^{60}\right):\\
\;\;\;\;\left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r95408 = x;
        double r95409 = y;
        double r95410 = z;
        double r95411 = r95409 * r95410;
        double r95412 = t;
        double r95413 = a;
        double r95414 = r95412 * r95413;
        double r95415 = r95411 - r95414;
        double r95416 = r95408 * r95415;
        double r95417 = b;
        double r95418 = c;
        double r95419 = r95418 * r95410;
        double r95420 = i;
        double r95421 = r95420 * r95413;
        double r95422 = r95419 - r95421;
        double r95423 = r95417 * r95422;
        double r95424 = r95416 - r95423;
        double r95425 = j;
        double r95426 = r95418 * r95412;
        double r95427 = r95420 * r95409;
        double r95428 = r95426 - r95427;
        double r95429 = r95425 * r95428;
        double r95430 = r95424 + r95429;
        return r95430;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r95431 = x;
        double r95432 = -102312353715.88737;
        bool r95433 = r95431 <= r95432;
        double r95434 = 1.5777732133650937e+60;
        bool r95435 = r95431 <= r95434;
        double r95436 = !r95435;
        bool r95437 = r95433 || r95436;
        double r95438 = y;
        double r95439 = z;
        double r95440 = a;
        double r95441 = t;
        double r95442 = r95440 * r95441;
        double r95443 = -r95442;
        double r95444 = fma(r95438, r95439, r95443);
        double r95445 = r95431 * r95444;
        double r95446 = -r95440;
        double r95447 = fma(r95446, r95441, r95442);
        double r95448 = r95431 * r95447;
        double r95449 = r95445 + r95448;
        double r95450 = b;
        double r95451 = c;
        double r95452 = r95451 * r95439;
        double r95453 = i;
        double r95454 = r95453 * r95440;
        double r95455 = r95452 - r95454;
        double r95456 = r95450 * r95455;
        double r95457 = r95449 - r95456;
        double r95458 = j;
        double r95459 = r95438 * r95453;
        double r95460 = -r95459;
        double r95461 = fma(r95451, r95441, r95460);
        double r95462 = r95458 * r95461;
        double r95463 = r95457 + r95462;
        double r95464 = r95431 * r95438;
        double r95465 = r95464 * r95439;
        double r95466 = r95441 * r95440;
        double r95467 = -r95466;
        double r95468 = r95431 * r95467;
        double r95469 = r95465 + r95468;
        double r95470 = r95469 - r95456;
        double r95471 = r95470 + r95462;
        double r95472 = r95437 ? r95463 : r95471;
        return r95472;
}

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 < -102312353715.88737 or 1.5777732133650937e+60 < x

    1. Initial program 7.8

      \[\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. Taylor expanded around inf 8.2

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

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

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

      \[\leadsto \left(\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)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right)\]

    if -102312353715.88737 < x < 1.5777732133650937e+60

    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. Taylor expanded around inf 14.2

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

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

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

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

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

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

Reproduce

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