Average Error: 12.5 → 12.3
Time: 8.1s
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 -3.0773273627394588 \cdot 10^{-176} \lor \neg \left(x \le 1.58691066146071069 \cdot 10^{-234}\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) - \left(b \cdot \left(z \cdot c - a \cdot i\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right) + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\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 -3.0773273627394588 \cdot 10^{-176} \lor \neg \left(x \le 1.58691066146071069 \cdot 10^{-234}\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) - \left(b \cdot \left(z \cdot c - a \cdot i\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right) + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r91446 = x;
        double r91447 = y;
        double r91448 = z;
        double r91449 = r91447 * r91448;
        double r91450 = t;
        double r91451 = a;
        double r91452 = r91450 * r91451;
        double r91453 = r91449 - r91452;
        double r91454 = r91446 * r91453;
        double r91455 = b;
        double r91456 = c;
        double r91457 = r91456 * r91448;
        double r91458 = i;
        double r91459 = r91458 * r91451;
        double r91460 = r91457 - r91459;
        double r91461 = r91455 * r91460;
        double r91462 = r91454 - r91461;
        double r91463 = j;
        double r91464 = r91456 * r91450;
        double r91465 = r91458 * r91447;
        double r91466 = r91464 - r91465;
        double r91467 = r91463 * r91466;
        double r91468 = r91462 + r91467;
        return r91468;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r91469 = x;
        double r91470 = -3.0773273627394588e-176;
        bool r91471 = r91469 <= r91470;
        double r91472 = 1.5869106614607107e-234;
        bool r91473 = r91469 <= r91472;
        double r91474 = !r91473;
        bool r91475 = r91471 || r91474;
        double r91476 = y;
        double r91477 = z;
        double r91478 = a;
        double r91479 = t;
        double r91480 = r91478 * r91479;
        double r91481 = -r91480;
        double r91482 = fma(r91476, r91477, r91481);
        double r91483 = r91469 * r91482;
        double r91484 = -r91478;
        double r91485 = fma(r91484, r91479, r91480);
        double r91486 = r91469 * r91485;
        double r91487 = r91483 + r91486;
        double r91488 = b;
        double r91489 = c;
        double r91490 = r91477 * r91489;
        double r91491 = i;
        double r91492 = r91478 * r91491;
        double r91493 = r91490 - r91492;
        double r91494 = r91488 * r91493;
        double r91495 = fma(r91484, r91491, r91492);
        double r91496 = r91488 * r91495;
        double r91497 = r91494 + r91496;
        double r91498 = r91487 - r91497;
        double r91499 = j;
        double r91500 = r91476 * r91491;
        double r91501 = -r91500;
        double r91502 = fma(r91489, r91479, r91501);
        double r91503 = r91499 * r91502;
        double r91504 = -r91476;
        double r91505 = fma(r91504, r91491, r91500);
        double r91506 = r91499 * r91505;
        double r91507 = r91503 + r91506;
        double r91508 = r91498 + r91507;
        double r91509 = 0.0;
        double r91510 = r91489 * r91477;
        double r91511 = r91491 * r91478;
        double r91512 = r91510 - r91511;
        double r91513 = r91488 * r91512;
        double r91514 = r91509 - r91513;
        double r91515 = r91489 * r91479;
        double r91516 = r91491 * r91476;
        double r91517 = r91515 - r91516;
        double r91518 = r91499 * r91517;
        double r91519 = r91514 + r91518;
        double r91520 = r91475 ? r91508 : r91519;
        return r91520;
}

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 < -3.0773273627394588e-176 or 1.5869106614607107e-234 < x

    1. Initial program 11.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. Using strategy rm
    3. Applied prod-diff11.0

      \[\leadsto \left(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) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    4. Applied distribute-lft-in11.0

      \[\leadsto \left(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) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Simplified11.0

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

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

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

      \[\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)} - \left(b \cdot \left(z \cdot c - a \cdot i\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right) + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\]
    11. Applied distribute-lft-in11.0

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

    if -3.0773273627394588e-176 < x < 1.5869106614607107e-234

    1. Initial program 17.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. Taylor expanded around 0 17.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3.0773273627394588 \cdot 10^{-176} \lor \neg \left(x \le 1.58691066146071069 \cdot 10^{-234}\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) - \left(b \cdot \left(z \cdot c - a \cdot i\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(j \cdot \mathsf{fma}\left(c, t, -y \cdot i\right) + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \end{array}\]

Reproduce

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