| Alternative 1 | |
|---|---|
| Accuracy | 93.0% |
| Cost | 5705 |
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* y (- (* x z) (* i j))))
(t_2 (* c (* a j)))
(t_3
(+
(+ (* b (- (* t i) (* z c))) (* x (- (* y z) (* t a))))
(* j (- (* a c) (* y i))))))
(if (<= t_3 -5e+304)
(+ t_1 (- (- t_2 (* c (* z b))) (* t (* x a))))
(if (<= t_3 2e+301)
t_3
(+ t_1 (- (+ t_2 (* i (* t b))) (* a (* x t))))))))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) - (t * i)))) + (j * ((c * a) - (y * i)));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = y * ((x * z) - (i * j));
double t_2 = c * (a * j);
double t_3 = ((b * ((t * i) - (z * c))) + (x * ((y * z) - (t * a)))) + (j * ((a * c) - (y * i)));
double tmp;
if (t_3 <= -5e+304) {
tmp = t_1 + ((t_2 - (c * (z * b))) - (t * (x * a)));
} else if (t_3 <= 2e+301) {
tmp = t_3;
} else {
tmp = t_1 + ((t_2 + (i * (t * b))) - (a * (x * t)));
}
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
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) :: t_3
real(8) :: tmp
t_1 = y * ((x * z) - (i * j))
t_2 = c * (a * j)
t_3 = ((b * ((t * i) - (z * c))) + (x * ((y * z) - (t * a)))) + (j * ((a * c) - (y * i)))
if (t_3 <= (-5d+304)) then
tmp = t_1 + ((t_2 - (c * (z * b))) - (t * (x * a)))
else if (t_3 <= 2d+301) then
tmp = t_3
else
tmp = t_1 + ((t_2 + (i * (t * b))) - (a * (x * t)))
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) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
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 = y * ((x * z) - (i * j));
double t_2 = c * (a * j);
double t_3 = ((b * ((t * i) - (z * c))) + (x * ((y * z) - (t * a)))) + (j * ((a * c) - (y * i)));
double tmp;
if (t_3 <= -5e+304) {
tmp = t_1 + ((t_2 - (c * (z * b))) - (t * (x * a)));
} else if (t_3 <= 2e+301) {
tmp = t_3;
} else {
tmp = t_1 + ((t_2 + (i * (t * b))) - (a * (x * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
def code(x, y, z, t, a, b, c, i, j): t_1 = y * ((x * z) - (i * j)) t_2 = c * (a * j) t_3 = ((b * ((t * i) - (z * c))) + (x * ((y * z) - (t * a)))) + (j * ((a * c) - (y * i))) tmp = 0 if t_3 <= -5e+304: tmp = t_1 + ((t_2 - (c * (z * b))) - (t * (x * a))) elif t_3 <= 2e+301: tmp = t_3 else: tmp = t_1 + ((t_2 + (i * (t * b))) - (a * (x * t))) 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(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(y * Float64(Float64(x * z) - Float64(i * j))) t_2 = Float64(c * Float64(a * j)) t_3 = Float64(Float64(Float64(b * Float64(Float64(t * i) - Float64(z * c))) + Float64(x * Float64(Float64(y * z) - Float64(t * a)))) + Float64(j * Float64(Float64(a * c) - Float64(y * i)))) tmp = 0.0 if (t_3 <= -5e+304) tmp = Float64(t_1 + Float64(Float64(t_2 - Float64(c * Float64(z * b))) - Float64(t * Float64(x * a)))); elseif (t_3 <= 2e+301) tmp = t_3; else tmp = Float64(t_1 + Float64(Float64(t_2 + Float64(i * Float64(t * b))) - Float64(a * Float64(x * t)))); 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) - (t * i)))) + (j * ((c * a) - (y * i))); end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = y * ((x * z) - (i * j)); t_2 = c * (a * j); t_3 = ((b * ((t * i) - (z * c))) + (x * ((y * z) - (t * a)))) + (j * ((a * c) - (y * i))); tmp = 0.0; if (t_3 <= -5e+304) tmp = t_1 + ((t_2 - (c * (z * b))) - (t * (x * a))); elseif (t_3 <= 2e+301) tmp = t_3; else tmp = t_1 + ((t_2 + (i * (t * b))) - (a * (x * t))); 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[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(b * N[(N[(t * i), $MachinePrecision] - N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+304], N[(t$95$1 + N[(N[(t$95$2 - N[(c * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+301], t$95$3, N[(t$95$1 + N[(N[(t$95$2 + N[(i * N[(t * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\begin{array}{l}
t_1 := y \cdot \left(x \cdot z - i \cdot j\right)\\
t_2 := c \cdot \left(a \cdot j\right)\\
t_3 := \left(b \cdot \left(t \cdot i - z \cdot c\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+304}:\\
\;\;\;\;t_1 + \left(\left(t_2 - c \cdot \left(z \cdot b\right)\right) - t \cdot \left(x \cdot a\right)\right)\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(t_2 + i \cdot \left(t \cdot b\right)\right) - a \cdot \left(x \cdot t\right)\right)\\
\end{array}
Results
| Original | 81.1% |
|---|---|
| Target | 69.0% |
| Herbie | 92.9% |
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < -4.9999999999999997e304Initial program 4.2%
Simplified4.2%
[Start]4.2 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
|---|---|
sub-neg [=>]4.2 | \[ \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(-b \cdot \left(c \cdot z - t \cdot i\right)\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
+-commutative [=>]4.2 | \[ \color{blue}{\left(\left(-b \cdot \left(c \cdot z - t \cdot i\right)\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
associate-+l+ [=>]4.2 | \[ \color{blue}{\left(-b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) + j \cdot \left(c \cdot a - y \cdot i\right)\right)}
\] |
distribute-rgt-neg-in [=>]4.2 | \[ \color{blue}{b \cdot \left(-\left(c \cdot z - t \cdot i\right)\right)} + \left(x \cdot \left(y \cdot z - t \cdot a\right) + j \cdot \left(c \cdot a - y \cdot i\right)\right)
\] |
+-commutative [<=]4.2 | \[ b \cdot \left(-\left(c \cdot z - t \cdot i\right)\right) + \color{blue}{\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)}
\] |
fma-def [=>]4.2 | \[ \color{blue}{\mathsf{fma}\left(b, -\left(c \cdot z - t \cdot i\right), j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)}
\] |
sub-neg [=>]4.2 | \[ \mathsf{fma}\left(b, -\color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
+-commutative [=>]4.2 | \[ \mathsf{fma}\left(b, -\color{blue}{\left(\left(-t \cdot i\right) + c \cdot z\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
distribute-neg-in [=>]4.2 | \[ \mathsf{fma}\left(b, \color{blue}{\left(-\left(-t \cdot i\right)\right) + \left(-c \cdot z\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
unsub-neg [=>]4.2 | \[ \mathsf{fma}\left(b, \color{blue}{\left(-\left(-t \cdot i\right)\right) - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
remove-double-neg [=>]4.2 | \[ \mathsf{fma}\left(b, \color{blue}{t \cdot i} - c \cdot z, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
*-commutative [=>]4.2 | \[ \mathsf{fma}\left(b, t \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
Taylor expanded in y around 0 59.5%
Applied egg-rr51.8%
[Start]59.5 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
|---|---|
expm1-log1p-u [=>]51.8 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a \cdot \left(t \cdot x\right)\right)\right)} + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
expm1-udef [=>]51.8 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(a \cdot \left(t \cdot x\right)\right)} - 1\right)} + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
Simplified56.2%
[Start]51.8 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(e^{\mathsf{log1p}\left(a \cdot \left(t \cdot x\right)\right)} - 1\right) + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
|---|---|
expm1-def [=>]51.8 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(a \cdot \left(t \cdot x\right)\right)\right)} + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
expm1-log1p [=>]59.5 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)} + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]59.5 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(a \cdot \color{blue}{\left(x \cdot t\right)}\right) + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
associate-*r* [=>]56.2 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \color{blue}{\left(\left(a \cdot x\right) \cdot t\right)} + \left(\left(i \cdot t - c \cdot z\right) \cdot b + c \cdot \left(a \cdot j\right)\right)\right)
\] |
Taylor expanded in i around 0 67.0%
Simplified67.0%
[Start]67.0 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
|---|---|
mul-1-neg [=>]67.0 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(\color{blue}{\left(-c \cdot \left(b \cdot z\right)\right)} + c \cdot \left(a \cdot j\right)\right)\right)
\] |
distribute-rgt-neg-in [=>]67.0 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(\color{blue}{c \cdot \left(-b \cdot z\right)} + c \cdot \left(a \cdot j\right)\right)\right)
\] |
distribute-rgt-neg-in [=>]67.0 | \[ \left(z \cdot x + -1 \cdot \left(i \cdot j\right)\right) \cdot y + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \color{blue}{\left(b \cdot \left(-z\right)\right)} + c \cdot \left(a \cdot j\right)\right)\right)
\] |
Taylor expanded in z around 0 67.0%
Simplified67.0%
[Start]67.0 | \[ \left(y \cdot \left(z \cdot x\right) + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
|---|---|
*-commutative [<=]67.0 | \[ \left(y \cdot \color{blue}{\left(x \cdot z\right)} + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [<=]67.0 | \[ \left(\color{blue}{\left(x \cdot z\right) \cdot y} + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
associate-*r* [=>]67.0 | \[ \left(\left(x \cdot z\right) \cdot y + \color{blue}{\left(-1 \cdot y\right) \cdot \left(i \cdot j\right)}\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
mul-1-neg [=>]67.0 | \[ \left(\left(x \cdot z\right) \cdot y + \color{blue}{\left(-y\right)} \cdot \left(i \cdot j\right)\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [<=]67.0 | \[ \left(\left(x \cdot z\right) \cdot y + \left(-y\right) \cdot \color{blue}{\left(j \cdot i\right)}\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
cancel-sign-sub-inv [<=]67.0 | \[ \color{blue}{\left(\left(x \cdot z\right) \cdot y - y \cdot \left(j \cdot i\right)\right)} + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]67.0 | \[ \left(\color{blue}{y \cdot \left(x \cdot z\right)} - y \cdot \left(j \cdot i\right)\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
distribute-lft-out-- [=>]67.0 | \[ \color{blue}{y \cdot \left(x \cdot z - j \cdot i\right)} + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]67.0 | \[ y \cdot \left(\color{blue}{z \cdot x} - j \cdot i\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]67.0 | \[ y \cdot \left(z \cdot x - \color{blue}{i \cdot j}\right) + \left(-1 \cdot \left(\left(a \cdot x\right) \cdot t\right) + \left(c \cdot \left(b \cdot \left(-z\right)\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
if -4.9999999999999997e304 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < 2.00000000000000011e301Initial program 98.7%
if 2.00000000000000011e301 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 9.9%
Simplified9.9%
[Start]9.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
|---|---|
sub-neg [=>]9.9 | \[ \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(-b \cdot \left(c \cdot z - t \cdot i\right)\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
+-commutative [=>]9.9 | \[ \color{blue}{\left(\left(-b \cdot \left(c \cdot z - t \cdot i\right)\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
associate-+l+ [=>]9.9 | \[ \color{blue}{\left(-b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) + j \cdot \left(c \cdot a - y \cdot i\right)\right)}
\] |
distribute-rgt-neg-in [=>]9.9 | \[ \color{blue}{b \cdot \left(-\left(c \cdot z - t \cdot i\right)\right)} + \left(x \cdot \left(y \cdot z - t \cdot a\right) + j \cdot \left(c \cdot a - y \cdot i\right)\right)
\] |
+-commutative [<=]9.9 | \[ b \cdot \left(-\left(c \cdot z - t \cdot i\right)\right) + \color{blue}{\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)}
\] |
fma-def [=>]9.9 | \[ \color{blue}{\mathsf{fma}\left(b, -\left(c \cdot z - t \cdot i\right), j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)}
\] |
sub-neg [=>]9.9 | \[ \mathsf{fma}\left(b, -\color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
+-commutative [=>]9.9 | \[ \mathsf{fma}\left(b, -\color{blue}{\left(\left(-t \cdot i\right) + c \cdot z\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
distribute-neg-in [=>]9.9 | \[ \mathsf{fma}\left(b, \color{blue}{\left(-\left(-t \cdot i\right)\right) + \left(-c \cdot z\right)}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
unsub-neg [=>]9.9 | \[ \mathsf{fma}\left(b, \color{blue}{\left(-\left(-t \cdot i\right)\right) - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
remove-double-neg [=>]9.9 | \[ \mathsf{fma}\left(b, \color{blue}{t \cdot i} - c \cdot z, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
*-commutative [=>]9.9 | \[ \mathsf{fma}\left(b, t \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right)
\] |
Taylor expanded in y around 0 53.7%
Taylor expanded in i around inf 70.0%
Taylor expanded in z around 0 70.0%
Simplified70.0%
[Start]70.0 | \[ \left(y \cdot \left(z \cdot x\right) + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
|---|---|
*-commutative [<=]70.0 | \[ \left(y \cdot \color{blue}{\left(x \cdot z\right)} + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [<=]70.0 | \[ \left(\color{blue}{\left(x \cdot z\right) \cdot y} + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
associate-*r* [=>]70.0 | \[ \left(\left(x \cdot z\right) \cdot y + \color{blue}{\left(-1 \cdot y\right) \cdot \left(i \cdot j\right)}\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
mul-1-neg [=>]70.0 | \[ \left(\left(x \cdot z\right) \cdot y + \color{blue}{\left(-y\right)} \cdot \left(i \cdot j\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [<=]70.0 | \[ \left(\left(x \cdot z\right) \cdot y + \left(-y\right) \cdot \color{blue}{\left(j \cdot i\right)}\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
cancel-sign-sub-inv [<=]70.0 | \[ \color{blue}{\left(\left(x \cdot z\right) \cdot y - y \cdot \left(j \cdot i\right)\right)} + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]70.0 | \[ \left(\color{blue}{y \cdot \left(x \cdot z\right)} - y \cdot \left(j \cdot i\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
distribute-lft-out-- [=>]70.0 | \[ \color{blue}{y \cdot \left(x \cdot z - j \cdot i\right)} + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]70.0 | \[ y \cdot \left(\color{blue}{z \cdot x} - j \cdot i\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
*-commutative [=>]70.0 | \[ y \cdot \left(z \cdot x - \color{blue}{i \cdot j}\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(i \cdot \left(t \cdot b\right) + c \cdot \left(a \cdot j\right)\right)\right)
\] |
Final simplification92.9%
| Alternative 1 | |
|---|---|
| Accuracy | 93.0% |
| Cost | 5705 |
| Alternative 2 | |
|---|---|
| Accuracy | 67.5% |
| Cost | 3180 |
| Alternative 3 | |
|---|---|
| Accuracy | 45.6% |
| Cost | 2940 |
| Alternative 4 | |
|---|---|
| Accuracy | 71.8% |
| Cost | 2917 |
| Alternative 5 | |
|---|---|
| Accuracy | 45.7% |
| Cost | 2676 |
| Alternative 6 | |
|---|---|
| Accuracy | 41.8% |
| Cost | 2556 |
| Alternative 7 | |
|---|---|
| Accuracy | 41.8% |
| Cost | 2556 |
| Alternative 8 | |
|---|---|
| Accuracy | 44.8% |
| Cost | 2544 |
| Alternative 9 | |
|---|---|
| Accuracy | 48.7% |
| Cost | 2412 |
| Alternative 10 | |
|---|---|
| Accuracy | 48.7% |
| Cost | 2412 |
| Alternative 11 | |
|---|---|
| Accuracy | 62.8% |
| Cost | 2404 |
| Alternative 12 | |
|---|---|
| Accuracy | 62.4% |
| Cost | 2404 |
| Alternative 13 | |
|---|---|
| Accuracy | 55.5% |
| Cost | 2272 |
| Alternative 14 | |
|---|---|
| Accuracy | 63.6% |
| Cost | 2272 |
| Alternative 15 | |
|---|---|
| Accuracy | 60.8% |
| Cost | 2008 |
| Alternative 16 | |
|---|---|
| Accuracy | 66.2% |
| Cost | 2008 |
| Alternative 17 | |
|---|---|
| Accuracy | 36.6% |
| Cost | 1764 |
| Alternative 18 | |
|---|---|
| Accuracy | 41.7% |
| Cost | 1764 |
| Alternative 19 | |
|---|---|
| Accuracy | 33.2% |
| Cost | 1632 |
| Alternative 20 | |
|---|---|
| Accuracy | 28.3% |
| Cost | 1308 |
| Alternative 21 | |
|---|---|
| Accuracy | 40.8% |
| Cost | 1236 |
| Alternative 22 | |
|---|---|
| Accuracy | 22.5% |
| Cost | 1176 |
| Alternative 23 | |
|---|---|
| Accuracy | 22.4% |
| Cost | 1176 |
| Alternative 24 | |
|---|---|
| Accuracy | 22.4% |
| Cost | 1176 |
| Alternative 25 | |
|---|---|
| Accuracy | 22.5% |
| Cost | 1176 |
| Alternative 26 | |
|---|---|
| Accuracy | 22.9% |
| Cost | 912 |
| Alternative 27 | |
|---|---|
| Accuracy | 21.8% |
| Cost | 848 |
| Alternative 28 | |
|---|---|
| Accuracy | 23.6% |
| Cost | 848 |
| Alternative 29 | |
|---|---|
| Accuracy | 23.7% |
| Cost | 848 |
| Alternative 30 | |
|---|---|
| Accuracy | 22.2% |
| Cost | 584 |
| Alternative 31 | |
|---|---|
| Accuracy | 22.7% |
| Cost | 584 |
| Alternative 32 | |
|---|---|
| Accuracy | 17.2% |
| Cost | 320 |
| Alternative 33 | |
|---|---|
| Accuracy | 16.9% |
| Cost | 320 |
herbie shell --seed 2023142
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:herbie-target
(if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))