Linear.Matrix:det33 from linear-1.19.1.3

Percentage Accurate: 73.2% → 76.5%
Time: 18.6s
Alternatives: 28
Speedup: 0.9×

Specification

?
\[\begin{array}{l} \\ \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) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
  (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 28 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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) \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (+
  (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
  (* j (- (* c t) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
real(8) function code(x, y, z, t, a, b, c, i, j)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j):
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
function code(x, y, z, t, a, b, c, i, j)
	return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y))))
end
function tmp = code(x, y, z, t, a, b, c, i, j)
	tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)
\end{array}

Alternative 1: 76.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-x, t, i \cdot b\right)\\ \mathbf{if}\;b \leq -1.25 \cdot 10^{+223}:\\ \;\;\;\;t\_1 \cdot a\\ \mathbf{elif}\;b \leq -2.2 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-b, z, j \cdot t\right), c, \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\right) - \mathsf{fma}\left(-b, a, j \cdot y\right) \cdot i\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{+109}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, a, \mathsf{fma}\left(\mathsf{fma}\left(-c, b, y \cdot x\right), z, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (fma (- x) t (* i b))))
   (if (<= b -1.25e+223)
     (* t_1 a)
     (if (<= b -2.2e-10)
       (-
        (fma (fma (- b) z (* j t)) c (* (fma (- t) a (* z y)) x))
        (* (fma (- b) a (* j y)) i))
       (if (<= b 3.5e+109)
         (fma t_1 a (fma (fma (- c) b (* y x)) z (* (fma (- i) y (* c t)) j)))
         (-
          (* (* c t) j)
          (- (* (- (* a t) (* z y)) x) (* (- (* i a) (* c z)) b))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = fma(-x, t, (i * b));
	double tmp;
	if (b <= -1.25e+223) {
		tmp = t_1 * a;
	} else if (b <= -2.2e-10) {
		tmp = fma(fma(-b, z, (j * t)), c, (fma(-t, a, (z * y)) * x)) - (fma(-b, a, (j * y)) * i);
	} else if (b <= 3.5e+109) {
		tmp = fma(t_1, a, fma(fma(-c, b, (y * x)), z, (fma(-i, y, (c * t)) * j)));
	} else {
		tmp = ((c * t) * j) - ((((a * t) - (z * y)) * x) - (((i * a) - (c * z)) * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = fma(Float64(-x), t, Float64(i * b))
	tmp = 0.0
	if (b <= -1.25e+223)
		tmp = Float64(t_1 * a);
	elseif (b <= -2.2e-10)
		tmp = Float64(fma(fma(Float64(-b), z, Float64(j * t)), c, Float64(fma(Float64(-t), a, Float64(z * y)) * x)) - Float64(fma(Float64(-b), a, Float64(j * y)) * i));
	elseif (b <= 3.5e+109)
		tmp = fma(t_1, a, fma(fma(Float64(-c), b, Float64(y * x)), z, Float64(fma(Float64(-i), y, Float64(c * t)) * j)));
	else
		tmp = Float64(Float64(Float64(c * t) * j) - Float64(Float64(Float64(Float64(a * t) - Float64(z * y)) * x) - Float64(Float64(Float64(i * a) - Float64(c * z)) * b)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-x) * t + N[(i * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e+223], N[(t$95$1 * a), $MachinePrecision], If[LessEqual[b, -2.2e-10], N[(N[(N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision] * c + N[(N[((-t) * a + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - N[(N[((-b) * a + N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e+109], N[(t$95$1 * a + N[(N[((-c) * b + N[(y * x), $MachinePrecision]), $MachinePrecision] * z + N[(N[((-i) * y + N[(c * t), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * t), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(N[(a * t), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-x, t, i \cdot b\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+223}:\\
\;\;\;\;t\_1 \cdot a\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.24999999999999996e223

    1. Initial program 66.6%

      \[\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. Add Preprocessing
    3. Taylor expanded in a around inf

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(t \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(t \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot a} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(t \cdot x\right) - -1 \cdot \left(b \cdot i\right)\right) \cdot a} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \left(t \cdot x\right) + \left(\mathsf{neg}\left(-1 \cdot \left(b \cdot i\right)\right)\right)\right)} \cdot a \]
      4. *-commutativeN/A

        \[\leadsto \left(-1 \cdot \color{blue}{\left(x \cdot t\right)} + \left(\mathsf{neg}\left(-1 \cdot \left(b \cdot i\right)\right)\right)\right) \cdot a \]
      5. associate-*r*N/A

        \[\leadsto \left(\color{blue}{\left(-1 \cdot x\right) \cdot t} + \left(\mathsf{neg}\left(-1 \cdot \left(b \cdot i\right)\right)\right)\right) \cdot a \]
      6. mul-1-negN/A

        \[\leadsto \left(\left(-1 \cdot x\right) \cdot t + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(b \cdot i\right)\right)}\right)\right)\right) \cdot a \]
      7. remove-double-negN/A

        \[\leadsto \left(\left(-1 \cdot x\right) \cdot t + \color{blue}{b \cdot i}\right) \cdot a \]
      8. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot x, t, b \cdot i\right)} \cdot a \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, t, b \cdot i\right) \cdot a \]
      10. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(x\right)}, t, b \cdot i\right) \cdot a \]
      11. lower-*.f6484.4

        \[\leadsto \mathsf{fma}\left(-x, t, \color{blue}{b \cdot i}\right) \cdot a \]
    5. Applied rewrites84.4%

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

    if -1.24999999999999996e223 < b < -2.1999999999999999e-10

    1. Initial program 65.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. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto \color{blue}{\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + \left(c \cdot \left(j \cdot t - b \cdot z\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)\right) - -1 \cdot \left(a \cdot \left(b \cdot i\right)\right)} \]
    4. Applied rewrites85.9%

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

    if -2.1999999999999999e-10 < b < 3.49999999999999983e109

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in z around 0

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

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

    if 3.49999999999999983e109 < b

    1. Initial program 75.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. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\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}{c \cdot \left(j \cdot t\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + c \cdot \color{blue}{\left(t \cdot j\right)} \]
      2. associate-*r*N/A

        \[\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(c \cdot t\right) \cdot j} \]
      3. lower-*.f64N/A

        \[\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(c \cdot t\right) \cdot j} \]
      4. *-commutativeN/A

        \[\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 c\right)} \cdot j \]
      5. lower-*.f6490.1

        \[\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 c\right)} \cdot j \]
    5. Applied rewrites90.1%

      \[\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 c\right) \cdot j} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification84.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+223}:\\ \;\;\;\;\mathsf{fma}\left(-x, t, i \cdot b\right) \cdot a\\ \mathbf{elif}\;b \leq -2.2 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-b, z, j \cdot t\right), c, \mathsf{fma}\left(-t, a, z \cdot y\right) \cdot x\right) - \mathsf{fma}\left(-b, a, j \cdot y\right) \cdot i\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{+109}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-x, t, i \cdot b\right), a, \mathsf{fma}\left(\mathsf{fma}\left(-c, b, y \cdot x\right), z, \mathsf{fma}\left(-i, y, c \cdot t\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot t\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 83.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(c \cdot t - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, \frac{t \cdot x}{y}, \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(-b, z, j \cdot t\right)}{y}, z \cdot x\right)\right) \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1
         (-
          (* (- (* c t) (* i y)) j)
          (- (* (- (* a t) (* z y)) x) (* (- (* i a) (* c z)) b)))))
   (if (<= t_1 INFINITY)
     t_1
     (*
      (fma (- a) (/ (* t x) y) (fma c (/ (fma (- b) z (* j t)) y) (* z x)))
      y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = (((c * t) - (i * y)) * j) - ((((a * t) - (z * y)) * x) - (((i * a) - (c * z)) * b));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(-a, ((t * x) / y), fma(c, (fma(-b, z, (j * t)) / y), (z * x))) * y;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j)
	t_1 = Float64(Float64(Float64(Float64(c * t) - Float64(i * y)) * j) - Float64(Float64(Float64(Float64(a * t) - Float64(z * y)) * x) - Float64(Float64(Float64(i * a) - Float64(c * z)) * b)))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(fma(Float64(-a), Float64(Float64(t * x) / y), fma(c, Float64(fma(Float64(-b), z, Float64(j * t)) / y), Float64(z * x))) * y);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(N[(a * t), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-a) * N[(N[(t * x), $MachinePrecision] / y), $MachinePrecision] + N[(c * N[(N[((-b) * z + N[(j * t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(c \cdot t - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0

    1. Initial program 90.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. Add Preprocessing

    if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y))))

    1. Initial program 0.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. Add Preprocessing
    3. Taylor expanded in i around 0

      \[\leadsto \color{blue}{\left(c \cdot \left(j \cdot t\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right) - b \cdot \left(c \cdot z\right)} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{c \cdot \left(j \cdot t\right) + \left(x \cdot \left(y \cdot z - a \cdot t\right) - b \cdot \left(c \cdot z\right)\right)} \]
      2. sub-negN/A

        \[\leadsto c \cdot \left(j \cdot t\right) + \color{blue}{\left(x \cdot \left(y \cdot z - a \cdot t\right) + \left(\mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right)\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto c \cdot \left(j \cdot t\right) + \color{blue}{\left(\left(\mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right)\right) + x \cdot \left(y \cdot z - a \cdot t\right)\right)} \]
      4. associate-+r+N/A

        \[\leadsto \color{blue}{\left(c \cdot \left(j \cdot t\right) + \left(\mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right)\right)\right) + x \cdot \left(y \cdot z - a \cdot t\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(j \cdot t\right) \cdot c} + \left(\mathsf{neg}\left(b \cdot \left(c \cdot z\right)\right)\right)\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      6. mul-1-negN/A

        \[\leadsto \left(\left(j \cdot t\right) \cdot c + \color{blue}{-1 \cdot \left(b \cdot \left(c \cdot z\right)\right)}\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      7. *-commutativeN/A

        \[\leadsto \left(\left(j \cdot t\right) \cdot c + -1 \cdot \left(b \cdot \color{blue}{\left(z \cdot c\right)}\right)\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      8. associate-*r*N/A

        \[\leadsto \left(\left(j \cdot t\right) \cdot c + -1 \cdot \color{blue}{\left(\left(b \cdot z\right) \cdot c\right)}\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      9. associate-*l*N/A

        \[\leadsto \left(\left(j \cdot t\right) \cdot c + \color{blue}{\left(-1 \cdot \left(b \cdot z\right)\right) \cdot c}\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      10. distribute-rgt-inN/A

        \[\leadsto \color{blue}{c \cdot \left(j \cdot t + -1 \cdot \left(b \cdot z\right)\right)} + x \cdot \left(y \cdot z - a \cdot t\right) \]
      11. mul-1-negN/A

        \[\leadsto c \cdot \left(j \cdot t + \color{blue}{\left(\mathsf{neg}\left(b \cdot z\right)\right)}\right) + x \cdot \left(y \cdot z - a \cdot t\right) \]
      12. sub-negN/A

        \[\leadsto c \cdot \color{blue}{\left(j \cdot t - b \cdot z\right)} + x \cdot \left(y \cdot z - a \cdot t\right) \]
      13. *-commutativeN/A

        \[\leadsto \color{blue}{\left(j \cdot t - b \cdot z\right) \cdot c} + x \cdot \left(y \cdot z - a \cdot t\right) \]
      14. lower-fma.f64N/A

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{a \cdot \left(t \cdot x\right)}{y} + \left(x \cdot z + \frac{c \cdot \left(-1 \cdot \left(b \cdot z\right) + j \cdot t\right)}{y}\right)\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites51.5%

        \[\leadsto \mathsf{fma}\left(-a, \frac{x \cdot t}{y}, \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(-b, z, t \cdot j\right)}{y}, z \cdot x\right)\right) \cdot \color{blue}{y} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification83.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot t - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right) \leq \infty:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j - \left(\left(a \cdot t - z \cdot y\right) \cdot x - \left(i \cdot a - c \cdot z\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, \frac{t \cdot x}{y}, \mathsf{fma}\left(c, \frac{\mathsf{fma}\left(-b, z, j \cdot t\right)}{y}, z \cdot x\right)\right) \cdot y\\ \end{array} \]
    10. Add Preprocessing

    Developer Target 1: 68.7% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\ t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i j)
     :precision binary64
     (let* ((t_1
             (+
              (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
              (/
               (* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
               (+ (* c t) (* i y)))))
            (t_2
             (-
              (* x (- (* z y) (* a t)))
              (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
       (if (< t -8.120978919195912e-33)
         t_2
         (if (< t -4.712553818218485e-169)
           t_1
           (if (< t -7.633533346031584e-308)
             t_2
             (if (< t 1.0535888557455487e-139) t_1 t_2))))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
    	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
    	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
    	double tmp;
    	if (t < -8.120978919195912e-33) {
    		tmp = t_2;
    	} else if (t < -4.712553818218485e-169) {
    		tmp = t_1;
    	} else if (t < -7.633533346031584e-308) {
    		tmp = t_2;
    	} else if (t < 1.0535888557455487e-139) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t, a, b, c, i, j)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8), intent (in) :: i
        real(8), intent (in) :: j
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
        t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
        if (t < (-8.120978919195912d-33)) then
            tmp = t_2
        else if (t < (-4.712553818218485d-169)) then
            tmp = t_1
        else if (t < (-7.633533346031584d-308)) then
            tmp = t_2
        else if (t < 1.0535888557455487d-139) then
            tmp = t_1
        else
            tmp = t_2
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
    	double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
    	double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
    	double tmp;
    	if (t < -8.120978919195912e-33) {
    		tmp = t_2;
    	} else if (t < -4.712553818218485e-169) {
    		tmp = t_1;
    	} else if (t < -7.633533346031584e-308) {
    		tmp = t_2;
    	} else if (t < 1.0535888557455487e-139) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b, c, i, j):
    	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y)))
    	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
    	tmp = 0
    	if t < -8.120978919195912e-33:
    		tmp = t_2
    	elif t < -4.712553818218485e-169:
    		tmp = t_1
    	elif t < -7.633533346031584e-308:
    		tmp = t_2
    	elif t < 1.0535888557455487e-139:
    		tmp = t_1
    	else:
    		tmp = t_2
    	return tmp
    
    function code(x, y, z, t, a, b, c, i, j)
    	t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y))))
    	t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j)))
    	tmp = 0.0
    	if (t < -8.120978919195912e-33)
    		tmp = t_2;
    	elseif (t < -4.712553818218485e-169)
    		tmp = t_1;
    	elseif (t < -7.633533346031584e-308)
    		tmp = t_2;
    	elseif (t < 1.0535888557455487e-139)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b, c, i, j)
    	t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y)));
    	t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
    	tmp = 0.0;
    	if (t < -8.120978919195912e-33)
    		tmp = t_2;
    	elseif (t < -4.712553818218485e-169)
    		tmp = t_1;
    	elseif (t < -7.633533346031584e-308)
    		tmp = t_2;
    	elseif (t < 1.0535888557455487e-139)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
    t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
    \mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    

    Reproduce

    ?
    herbie shell --seed 2024230 
    (FPCore (x y z t a b c i j)
      :name "Linear.Matrix:det33 from linear-1.19.1.3"
      :precision binary64
    
      :alt
      (! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
    
      (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))