Average Error: 12.2 → 6.2
Time: 15.0s
Precision: binary64
\[\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} t_1 := \sqrt{a \cdot \left(x \cdot t\right)}\\ t_2 := x \cdot \left(y \cdot z - t \cdot a\right)\\ t_3 := j \cdot \left(t \cdot c - y \cdot i\right)\\ t_4 := \left(t_2 - b \cdot \left(z \cdot c - a \cdot i\right)\right) + t_3\\ t_5 := c \cdot \left(z \cdot b\right) - i \cdot \left(a \cdot b\right)\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_3 + \left(\left(y \cdot \left(x \cdot z\right) - t_1 \cdot t_1\right) - t_5\right)\\ \mathbf{elif}\;t_4 \leq 5.397426652011775 \cdot 10^{+307}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\left(t_2 - t_5\right) + \left(c \cdot \left(t \cdot j\right) - i \cdot \left(y \cdot j\right)\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)))))
(FPCore (x y z t a b c i j)
 :precision binary64
 (let* ((t_1 (sqrt (* a (* x t))))
        (t_2 (* x (- (* y z) (* t a))))
        (t_3 (* j (- (* t c) (* y i))))
        (t_4 (+ (- t_2 (* b (- (* z c) (* a i)))) t_3))
        (t_5 (- (* c (* z b)) (* i (* a b)))))
   (if (<= t_4 (- INFINITY))
     (+ t_3 (- (- (* y (* x z)) (* t_1 t_1)) t_5))
     (if (<= t_4 5.397426652011775e+307)
       t_4
       (+ (- t_2 t_5) (- (* c (* t j)) (* i (* y j))))))))
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)));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double t_1 = sqrt((a * (x * t)));
	double t_2 = x * ((y * z) - (t * a));
	double t_3 = j * ((t * c) - (y * i));
	double t_4 = (t_2 - (b * ((z * c) - (a * i)))) + t_3;
	double t_5 = (c * (z * b)) - (i * (a * b));
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = t_3 + (((y * (x * z)) - (t_1 * t_1)) - t_5);
	} else if (t_4 <= 5.397426652011775e+307) {
		tmp = t_4;
	} else {
		tmp = (t_2 - t_5) + ((c * (t * j)) - (i * (y * j)));
	}
	return tmp;
}
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)));
}
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 = Math.sqrt((a * (x * t)));
	double t_2 = x * ((y * z) - (t * a));
	double t_3 = j * ((t * c) - (y * i));
	double t_4 = (t_2 - (b * ((z * c) - (a * i)))) + t_3;
	double t_5 = (c * (z * b)) - (i * (a * b));
	double tmp;
	if (t_4 <= -Double.POSITIVE_INFINITY) {
		tmp = t_3 + (((y * (x * z)) - (t_1 * t_1)) - t_5);
	} else if (t_4 <= 5.397426652011775e+307) {
		tmp = t_4;
	} else {
		tmp = (t_2 - t_5) + ((c * (t * j)) - (i * (y * j)));
	}
	return tmp;
}
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)))
def code(x, y, z, t, a, b, c, i, j):
	t_1 = math.sqrt((a * (x * t)))
	t_2 = x * ((y * z) - (t * a))
	t_3 = j * ((t * c) - (y * i))
	t_4 = (t_2 - (b * ((z * c) - (a * i)))) + t_3
	t_5 = (c * (z * b)) - (i * (a * b))
	tmp = 0
	if t_4 <= -math.inf:
		tmp = t_3 + (((y * (x * z)) - (t_1 * t_1)) - t_5)
	elif t_4 <= 5.397426652011775e+307:
		tmp = t_4
	else:
		tmp = (t_2 - t_5) + ((c * (t * j)) - (i * (y * j)))
	return tmp
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 code(x, y, z, t, a, b, c, i, j)
	t_1 = sqrt(Float64(a * Float64(x * t)))
	t_2 = Float64(x * Float64(Float64(y * z) - Float64(t * a)))
	t_3 = Float64(j * Float64(Float64(t * c) - Float64(y * i)))
	t_4 = Float64(Float64(t_2 - Float64(b * Float64(Float64(z * c) - Float64(a * i)))) + t_3)
	t_5 = Float64(Float64(c * Float64(z * b)) - Float64(i * Float64(a * b)))
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = Float64(t_3 + Float64(Float64(Float64(y * Float64(x * z)) - Float64(t_1 * t_1)) - t_5));
	elseif (t_4 <= 5.397426652011775e+307)
		tmp = t_4;
	else
		tmp = Float64(Float64(t_2 - t_5) + Float64(Float64(c * Float64(t * j)) - Float64(i * Float64(y * j))));
	end
	return tmp
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
function tmp_2 = code(x, y, z, t, a, b, c, i, j)
	t_1 = sqrt((a * (x * t)));
	t_2 = x * ((y * z) - (t * a));
	t_3 = j * ((t * c) - (y * i));
	t_4 = (t_2 - (b * ((z * c) - (a * i)))) + t_3;
	t_5 = (c * (z * b)) - (i * (a * b));
	tmp = 0.0;
	if (t_4 <= -Inf)
		tmp = t_3 + (((y * (x * z)) - (t_1 * t_1)) - t_5);
	elseif (t_4 <= 5.397426652011775e+307)
		tmp = t_4;
	else
		tmp = (t_2 - t_5) + ((c * (t * j)) - (i * (y * j)));
	end
	tmp_2 = tmp;
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]
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[Sqrt[N[(a * N[(x * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 - N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(c * N[(z * b), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(t$95$3 + N[(N[(N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5.397426652011775e+307], t$95$4, N[(N[(t$95$2 - t$95$5), $MachinePrecision] + N[(N[(c * N[(t * j), $MachinePrecision]), $MachinePrecision] - N[(i * N[(y * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\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}
t_1 := \sqrt{a \cdot \left(x \cdot t\right)}\\
t_2 := x \cdot \left(y \cdot z - t \cdot a\right)\\
t_3 := j \cdot \left(t \cdot c - y \cdot i\right)\\
t_4 := \left(t_2 - b \cdot \left(z \cdot c - a \cdot i\right)\right) + t_3\\
t_5 := c \cdot \left(z \cdot b\right) - i \cdot \left(a \cdot b\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_3 + \left(\left(y \cdot \left(x \cdot z\right) - t_1 \cdot t_1\right) - t_5\right)\\

\mathbf{elif}\;t_4 \leq 5.397426652011775 \cdot 10^{+307}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\left(t_2 - t_5\right) + \left(c \cdot \left(t \cdot j\right) - i \cdot \left(y \cdot j\right)\right)\\


\end{array}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original12.2
Target16.1
Herbie6.2
\[\begin{array}{l} \mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\ \;\;\;\;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{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\ \;\;\;\;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{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\ \;\;\;\;\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}\\ \mathbf{else}:\\ \;\;\;\;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)\\ \end{array} \]

Derivation

  1. Split input into 3 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 64.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. Taylor expanded in c around 0 44.2

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(c \cdot \left(b \cdot z\right) - i \cdot \left(a \cdot b\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    3. Taylor expanded in y around 0 27.7

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

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

    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)))) < 5.3974266520117751e307

    1. Initial program 0.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. Applied cancel-sign-sub-inv_binary640.9

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

    if 5.3974266520117751e307 < (+.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 63.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. Taylor expanded in c around 0 45.7

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(c \cdot \left(b \cdot z\right) - i \cdot \left(a \cdot b\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right) \]
    3. Taylor expanded in c around 0 26.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - a \cdot i\right)\right) + j \cdot \left(t \cdot c - y \cdot i\right) \leq -\infty:\\ \;\;\;\;j \cdot \left(t \cdot c - y \cdot i\right) + \left(\left(y \cdot \left(x \cdot z\right) - \sqrt{a \cdot \left(x \cdot t\right)} \cdot \sqrt{a \cdot \left(x \cdot t\right)}\right) - \left(c \cdot \left(z \cdot b\right) - i \cdot \left(a \cdot b\right)\right)\right)\\ \mathbf{elif}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - a \cdot i\right)\right) + j \cdot \left(t \cdot c - y \cdot i\right) \leq 5.397426652011775 \cdot 10^{+307}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - a \cdot i\right)\right) + j \cdot \left(t \cdot c - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(c \cdot \left(z \cdot b\right) - i \cdot \left(a \cdot b\right)\right)\right) + \left(c \cdot \left(t \cdot j\right) - i \cdot \left(y \cdot j\right)\right)\\ \end{array} \]

Reproduce

herbie shell --seed 2022130 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< t -8.120978919195912e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.712553818218485e-169) (+ (- (* 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)))) (if (< t -7.633533346031584e-308) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 1.0535888557455487e-139) (+ (- (* 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)))) (- (* 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)))))