Average Error: 11.9 → 10.4
Time: 28.6s
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}\;b \le -4.5537297373874334 \cdot 10^{-181}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)\\ \mathbf{elif}\;b \le 2.6161480995206308 \cdot 10^{-142}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - \left(t \cdot x\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\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}\;b \le -4.5537297373874334 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\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 r4245673 = x;
        double r4245674 = y;
        double r4245675 = z;
        double r4245676 = r4245674 * r4245675;
        double r4245677 = t;
        double r4245678 = a;
        double r4245679 = r4245677 * r4245678;
        double r4245680 = r4245676 - r4245679;
        double r4245681 = r4245673 * r4245680;
        double r4245682 = b;
        double r4245683 = c;
        double r4245684 = r4245683 * r4245675;
        double r4245685 = i;
        double r4245686 = r4245685 * r4245678;
        double r4245687 = r4245684 - r4245686;
        double r4245688 = r4245682 * r4245687;
        double r4245689 = r4245681 - r4245688;
        double r4245690 = j;
        double r4245691 = r4245683 * r4245677;
        double r4245692 = r4245685 * r4245674;
        double r4245693 = r4245691 - r4245692;
        double r4245694 = r4245690 * r4245693;
        double r4245695 = r4245689 + r4245694;
        return r4245695;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r4245696 = b;
        double r4245697 = -4.5537297373874334e-181;
        bool r4245698 = r4245696 <= r4245697;
        double r4245699 = t;
        double r4245700 = c;
        double r4245701 = r4245699 * r4245700;
        double r4245702 = y;
        double r4245703 = i;
        double r4245704 = r4245702 * r4245703;
        double r4245705 = r4245701 - r4245704;
        double r4245706 = j;
        double r4245707 = a;
        double r4245708 = r4245707 * r4245703;
        double r4245709 = z;
        double r4245710 = r4245700 * r4245709;
        double r4245711 = r4245708 - r4245710;
        double r4245712 = r4245702 * r4245709;
        double r4245713 = r4245699 * r4245707;
        double r4245714 = r4245712 - r4245713;
        double r4245715 = x;
        double r4245716 = r4245714 * r4245715;
        double r4245717 = fma(r4245711, r4245696, r4245716);
        double r4245718 = fma(r4245705, r4245706, r4245717);
        double r4245719 = 2.6161480995206308e-142;
        bool r4245720 = r4245696 <= r4245719;
        double r4245721 = r4245715 * r4245702;
        double r4245722 = r4245700 * r4245696;
        double r4245723 = r4245721 - r4245722;
        double r4245724 = r4245723 * r4245709;
        double r4245725 = r4245699 * r4245715;
        double r4245726 = r4245725 * r4245707;
        double r4245727 = r4245724 - r4245726;
        double r4245728 = fma(r4245705, r4245706, r4245727);
        double r4245729 = r4245720 ? r4245728 : r4245718;
        double r4245730 = r4245698 ? r4245718 : r4245729;
        return r4245730;
}

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 b < -4.5537297373874334e-181 or 2.6161480995206308e-142 < b

    1. Initial program 9.7

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

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

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

    if -4.5537297373874334e-181 < b < 2.6161480995206308e-142

    1. Initial program 16.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. Simplified16.8

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

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

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

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

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

Reproduce

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