| Alternative 1 | |
|---|---|
| Accuracy | 91.5% |
| Cost | 24904 |
(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 (fma t (fma a x (* j (- c))) (* (fma (- j) c (* j c)) (+ t t))))
(t_2 (- (* y z) (* t a)))
(t_3 (- (+ (* x t_2) (* c (* j t))) (* c (* z b))))
(t_4 (* b (- (* i a) (* z c))))
(t_5 (* y (- (* z x) (* i j))))
(t_6 (+ (+ t_5 (* t (- (* j c) (* x a)))) t_4)))
(if (<= y -1.1e-77)
t_6
(if (<= y -6.5e-170)
t_3
(if (<= y -5.6e-254)
(+ (- (* z (* y x)) t_1) t_4)
(if (<= y 1.55e-299)
t_3
(if (<= y 4e-235)
t_6
(if (<= y 8.8e-215)
t_3
(if (<= y 7000.0)
(+
(+ (fma x t_2 (* (fma (- a) t (* t a)) (+ x x))) t_4)
(* j (- (* t c) (* y i))))
(+ (- t_5 t_1) t_4))))))))))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 = fma(t, fma(a, x, (j * -c)), (fma(-j, c, (j * c)) * (t + t)));
double t_2 = (y * z) - (t * a);
double t_3 = ((x * t_2) + (c * (j * t))) - (c * (z * b));
double t_4 = b * ((i * a) - (z * c));
double t_5 = y * ((z * x) - (i * j));
double t_6 = (t_5 + (t * ((j * c) - (x * a)))) + t_4;
double tmp;
if (y <= -1.1e-77) {
tmp = t_6;
} else if (y <= -6.5e-170) {
tmp = t_3;
} else if (y <= -5.6e-254) {
tmp = ((z * (y * x)) - t_1) + t_4;
} else if (y <= 1.55e-299) {
tmp = t_3;
} else if (y <= 4e-235) {
tmp = t_6;
} else if (y <= 8.8e-215) {
tmp = t_3;
} else if (y <= 7000.0) {
tmp = (fma(x, t_2, (fma(-a, t, (t * a)) * (x + x))) + t_4) + (j * ((t * c) - (y * i)));
} else {
tmp = (t_5 - t_1) + t_4;
}
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 = fma(t, fma(a, x, Float64(j * Float64(-c))), Float64(fma(Float64(-j), c, Float64(j * c)) * Float64(t + t))) t_2 = Float64(Float64(y * z) - Float64(t * a)) t_3 = Float64(Float64(Float64(x * t_2) + Float64(c * Float64(j * t))) - Float64(c * Float64(z * b))) t_4 = Float64(b * Float64(Float64(i * a) - Float64(z * c))) t_5 = Float64(y * Float64(Float64(z * x) - Float64(i * j))) t_6 = Float64(Float64(t_5 + Float64(t * Float64(Float64(j * c) - Float64(x * a)))) + t_4) tmp = 0.0 if (y <= -1.1e-77) tmp = t_6; elseif (y <= -6.5e-170) tmp = t_3; elseif (y <= -5.6e-254) tmp = Float64(Float64(Float64(z * Float64(y * x)) - t_1) + t_4); elseif (y <= 1.55e-299) tmp = t_3; elseif (y <= 4e-235) tmp = t_6; elseif (y <= 8.8e-215) tmp = t_3; elseif (y <= 7000.0) tmp = Float64(Float64(fma(x, t_2, Float64(fma(Float64(-a), t, Float64(t * a)) * Float64(x + x))) + t_4) + Float64(j * Float64(Float64(t * c) - Float64(y * i)))); else tmp = Float64(Float64(t_5 - t_1) + t_4); end return 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[(t * N[(a * x + N[(j * (-c)), $MachinePrecision]), $MachinePrecision] + N[(N[((-j) * c + N[(j * c), $MachinePrecision]), $MachinePrecision] * N[(t + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * t$95$2), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(b * N[(N[(i * a), $MachinePrecision] - N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(y * N[(N[(z * x), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$5 + N[(t * N[(N[(j * c), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]}, If[LessEqual[y, -1.1e-77], t$95$6, If[LessEqual[y, -6.5e-170], t$95$3, If[LessEqual[y, -5.6e-254], N[(N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[y, 1.55e-299], t$95$3, If[LessEqual[y, 4e-235], t$95$6, If[LessEqual[y, 8.8e-215], t$95$3, If[LessEqual[y, 7000.0], N[(N[(N[(x * t$95$2 + N[(N[((-a) * t + N[(t * a), $MachinePrecision]), $MachinePrecision] * N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(j * N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$5 - t$95$1), $MachinePrecision] + t$95$4), $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 := \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, j \cdot \left(-c\right)\right), \mathsf{fma}\left(-j, c, j \cdot c\right) \cdot \left(t + t\right)\right)\\
t_2 := y \cdot z - t \cdot a\\
t_3 := \left(x \cdot t_2 + c \cdot \left(j \cdot t\right)\right) - c \cdot \left(z \cdot b\right)\\
t_4 := b \cdot \left(i \cdot a - z \cdot c\right)\\
t_5 := y \cdot \left(z \cdot x - i \cdot j\right)\\
t_6 := \left(t_5 + t \cdot \left(j \cdot c - x \cdot a\right)\right) + t_4\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-77}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-170}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-254}:\\
\;\;\;\;\left(z \cdot \left(y \cdot x\right) - t_1\right) + t_4\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-299}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-235}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-215}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 7000:\\
\;\;\;\;\left(\mathsf{fma}\left(x, t_2, \mathsf{fma}\left(-a, t, t \cdot a\right) \cdot \left(x + x\right)\right) + t_4\right) + j \cdot \left(t \cdot c - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_5 - t_1\right) + t_4\\
\end{array}
| Original | 80.8% |
|---|---|
| Target | 75.1% |
| Herbie | 81.3% |
if y < -1.10000000000000003e-77 or 1.55e-299 < y < 3.9999999999999998e-235Initial program 77.8%
Simplified77.8%
[Start]77.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)
\] |
|---|---|
+-commutative [=>]77.8 | \[ \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
fma-def [=>]77.8 | \[ \color{blue}{\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
*-commutative [=>]77.8 | \[ \mathsf{fma}\left(j, \color{blue}{t \cdot c} - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]77.8 | \[ \mathsf{fma}\left(j, t \cdot c - \color{blue}{y \cdot i}, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]77.8 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} - i \cdot a\right)\right)
\] |
*-commutative [=>]77.8 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - \color{blue}{a \cdot i}\right)\right)
\] |
Taylor expanded in t around -inf 84.6%
Simplified84.6%
[Start]84.6 | \[ \left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) - \left(c \cdot z - i \cdot a\right) \cdot b
\] |
|---|---|
cancel-sign-sub-inv [=>]84.6 | \[ \color{blue}{\left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) + \left(-\left(c \cdot z - i \cdot a\right)\right) \cdot b}
\] |
if -1.10000000000000003e-77 < y < -6.50000000000000035e-170 or -5.59999999999999966e-254 < y < 1.55e-299 or 3.9999999999999998e-235 < y < 8.79999999999999985e-215Initial program 86.4%
Simplified86.4%
[Start]86.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)
\] |
|---|---|
+-commutative [=>]86.4 | \[ \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
fma-def [=>]86.4 | \[ \color{blue}{\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
*-commutative [=>]86.4 | \[ \mathsf{fma}\left(j, \color{blue}{t \cdot c} - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]86.4 | \[ \mathsf{fma}\left(j, t \cdot c - \color{blue}{y \cdot i}, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]86.4 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} - i \cdot a\right)\right)
\] |
*-commutative [=>]86.4 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - \color{blue}{a \cdot i}\right)\right)
\] |
Taylor expanded in i around 0 62.5%
if -6.50000000000000035e-170 < y < -5.59999999999999966e-254Initial program 84.9%
Simplified84.9%
[Start]84.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)
\] |
|---|---|
+-commutative [=>]84.9 | \[ \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
fma-def [=>]84.9 | \[ \color{blue}{\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
*-commutative [=>]84.9 | \[ \mathsf{fma}\left(j, \color{blue}{t \cdot c} - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]84.9 | \[ \mathsf{fma}\left(j, t \cdot c - \color{blue}{y \cdot i}, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]84.9 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} - i \cdot a\right)\right)
\] |
*-commutative [=>]84.9 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - \color{blue}{a \cdot i}\right)\right)
\] |
Taylor expanded in t around -inf 75.0%
Simplified75.0%
[Start]75.0 | \[ \left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) - \left(c \cdot z - i \cdot a\right) \cdot b
\] |
|---|---|
cancel-sign-sub-inv [=>]75.0 | \[ \color{blue}{\left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) + \left(-\left(c \cdot z - i \cdot a\right)\right) \cdot b}
\] |
Applied egg-rr75.0%
[Start]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(a \cdot x - c \cdot j\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
|---|---|
prod-diff [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \color{blue}{\left(\mathsf{fma}\left(a, x, -j \cdot c\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(\mathsf{fma}\left(a, x, -\color{blue}{c \cdot j}\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [<=]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(\color{blue}{\left(a \cdot x - c \cdot j\right)} + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-lft-in [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
prod-diff [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \color{blue}{\left(\mathsf{fma}\left(a, x, -j \cdot c\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)} + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \left(\mathsf{fma}\left(a, x, -\color{blue}{c \cdot j}\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [<=]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \left(\color{blue}{\left(a \cdot x - c \cdot j\right)} + \mathsf{fma}\left(-j, c, j \cdot c\right)\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-lft-in [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(\color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)} + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
associate-+l+ [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \color{blue}{\mathsf{fma}\left(a, x, -c \cdot j\right)} + \left(t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \mathsf{fma}\left(a, x, -c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, \color{blue}{c \cdot j}\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
Simplified75.0%
[Start]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \mathsf{fma}\left(a, x, -c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
|---|---|
fma-def [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\mathsf{fma}\left(t, \mathsf{fma}\left(a, x, -c \cdot j\right), t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-rgt-neg-in [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, \color{blue}{c \cdot \left(-j\right)}\right), t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-rgt-out [=>]75.0 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, c \cdot \left(-j\right)\right), \color{blue}{\mathsf{fma}\left(-j, c, c \cdot j\right) \cdot \left(t + t\right)}\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
Taylor expanded in z around inf 73.6%
Simplified78.2%
[Start]73.6 | \[ \left(y \cdot \left(z \cdot x\right) - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, c \cdot \left(-j\right)\right), \mathsf{fma}\left(-j, c, c \cdot j\right) \cdot \left(t + t\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
|---|---|
*-commutative [<=]73.6 | \[ \left(\color{blue}{\left(z \cdot x\right) \cdot y} - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, c \cdot \left(-j\right)\right), \mathsf{fma}\left(-j, c, c \cdot j\right) \cdot \left(t + t\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
associate-*l* [=>]78.2 | \[ \left(\color{blue}{z \cdot \left(x \cdot y\right)} - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, c \cdot \left(-j\right)\right), \mathsf{fma}\left(-j, c, c \cdot j\right) \cdot \left(t + t\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
if 8.79999999999999985e-215 < y < 7e3Initial program 86.6%
Applied egg-rr86.5%
[Start]86.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)
\] |
|---|---|
prod-diff [=>]86.6 | \[ \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)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.6 | \[ \left(x \cdot \left(\mathsf{fma}\left(y, z, -\color{blue}{t \cdot a}\right) + \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
fma-neg [<=]86.6 | \[ \left(x \cdot \left(\color{blue}{\left(y \cdot z - t \cdot a\right)} + \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-lft-in [=>]86.6 | \[ \left(\color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
prod-diff [=>]86.6 | \[ \left(\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)} + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.6 | \[ \left(\left(x \cdot \left(\mathsf{fma}\left(y, z, -\color{blue}{t \cdot a}\right) + \mathsf{fma}\left(-a, t, a \cdot t\right)\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
fma-neg [<=]86.6 | \[ \left(\left(x \cdot \left(\color{blue}{\left(y \cdot z - t \cdot a\right)} + \mathsf{fma}\left(-a, t, a \cdot t\right)\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-lft-in [=>]86.5 | \[ \left(\left(\color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right)} + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
associate-+l+ [=>]86.5 | \[ \left(\color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right)\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.5 | \[ \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(x \cdot \mathsf{fma}\left(-a, t, \color{blue}{t \cdot a}\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.5 | \[ \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, \color{blue}{t \cdot a}\right)\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
Simplified86.6%
[Start]86.5 | \[ \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right)\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
|---|---|
fma-def [=>]86.6 | \[ \left(\color{blue}{\mathsf{fma}\left(x, y \cdot z - t \cdot a, x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right)\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.6 | \[ \left(\mathsf{fma}\left(x, y \cdot z - \color{blue}{a \cdot t}, x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right) + x \cdot \mathsf{fma}\left(-a, t, t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-rgt-out [=>]86.6 | \[ \left(\mathsf{fma}\left(x, y \cdot z - a \cdot t, \color{blue}{\mathsf{fma}\left(-a, t, t \cdot a\right) \cdot \left(x + x\right)}\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
*-commutative [<=]86.6 | \[ \left(\mathsf{fma}\left(x, y \cdot z - a \cdot t, \mathsf{fma}\left(-a, t, \color{blue}{a \cdot t}\right) \cdot \left(x + x\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
if 7e3 < y Initial program 73.0%
Simplified73.1%
[Start]73.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)
\] |
|---|---|
+-commutative [=>]73.0 | \[ \color{blue}{j \cdot \left(c \cdot t - i \cdot y\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
fma-def [=>]73.1 | \[ \color{blue}{\mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}
\] |
*-commutative [=>]73.1 | \[ \mathsf{fma}\left(j, \color{blue}{t \cdot c} - i \cdot y, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]73.1 | \[ \mathsf{fma}\left(j, t \cdot c - \color{blue}{y \cdot i}, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)
\] |
*-commutative [=>]73.1 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} - i \cdot a\right)\right)
\] |
*-commutative [=>]73.1 | \[ \mathsf{fma}\left(j, t \cdot c - y \cdot i, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - \color{blue}{a \cdot i}\right)\right)
\] |
Taylor expanded in t around -inf 88.9%
Simplified88.9%
[Start]88.9 | \[ \left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) - \left(c \cdot z - i \cdot a\right) \cdot b
\] |
|---|---|
cancel-sign-sub-inv [=>]88.9 | \[ \color{blue}{\left(-1 \cdot \left(\left(a \cdot x + -1 \cdot \left(c \cdot j\right)\right) \cdot t\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right)\right) + \left(-\left(c \cdot z - i \cdot a\right)\right) \cdot b}
\] |
Applied egg-rr88.9%
[Start]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(a \cdot x - c \cdot j\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
|---|---|
prod-diff [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \color{blue}{\left(\mathsf{fma}\left(a, x, -j \cdot c\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(\mathsf{fma}\left(a, x, -\color{blue}{c \cdot j}\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [<=]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - t \cdot \left(\color{blue}{\left(a \cdot x - c \cdot j\right)} + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-lft-in [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
prod-diff [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \color{blue}{\left(\mathsf{fma}\left(a, x, -j \cdot c\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right)} + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \left(\mathsf{fma}\left(a, x, -\color{blue}{c \cdot j}\right) + \mathsf{fma}\left(-j, c, j \cdot c\right)\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [<=]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \left(\color{blue}{\left(a \cdot x - c \cdot j\right)} + \mathsf{fma}\left(-j, c, j \cdot c\right)\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-lft-in [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(\color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)} + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
associate-+l+ [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\left(t \cdot \left(a \cdot x - c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
fma-neg [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \color{blue}{\mathsf{fma}\left(a, x, -c \cdot j\right)} + \left(t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
*-commutative [<=]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \mathsf{fma}\left(a, x, -c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, \color{blue}{c \cdot j}\right) + t \cdot \mathsf{fma}\left(-j, c, j \cdot c\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
Simplified88.9%
[Start]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \left(t \cdot \mathsf{fma}\left(a, x, -c \cdot j\right) + \left(t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
|---|---|
fma-def [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \color{blue}{\mathsf{fma}\left(t, \mathsf{fma}\left(a, x, -c \cdot j\right), t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)}\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-rgt-neg-in [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, \color{blue}{c \cdot \left(-j\right)}\right), t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right) + t \cdot \mathsf{fma}\left(-j, c, c \cdot j\right)\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
distribute-rgt-out [=>]88.9 | \[ \left(y \cdot \left(z \cdot x - i \cdot j\right) - \mathsf{fma}\left(t, \mathsf{fma}\left(a, x, c \cdot \left(-j\right)\right), \color{blue}{\mathsf{fma}\left(-j, c, c \cdot j\right) \cdot \left(t + t\right)}\right)\right) + b \cdot \left(a \cdot i - z \cdot c\right)
\] |
Final simplification81.3%
| Alternative 1 | |
|---|---|
| Accuracy | 91.5% |
| Cost | 24904 |
| Alternative 2 | |
|---|---|
| Accuracy | 81.4% |
| Cost | 21708 |
| Alternative 3 | |
|---|---|
| Accuracy | 91.9% |
| Cost | 5833 |
| Alternative 4 | |
|---|---|
| Accuracy | 91.9% |
| Cost | 5705 |
| Alternative 5 | |
|---|---|
| Accuracy | 87.4% |
| Cost | 5704 |
| Alternative 6 | |
|---|---|
| Accuracy | 50.0% |
| Cost | 2412 |
| Alternative 7 | |
|---|---|
| Accuracy | 52.7% |
| Cost | 2404 |
| Alternative 8 | |
|---|---|
| Accuracy | 59.6% |
| Cost | 2404 |
| Alternative 9 | |
|---|---|
| Accuracy | 43.9% |
| Cost | 2156 |
| Alternative 10 | |
|---|---|
| Accuracy | 43.9% |
| Cost | 2156 |
| Alternative 11 | |
|---|---|
| Accuracy | 40.2% |
| Cost | 2028 |
| Alternative 12 | |
|---|---|
| Accuracy | 39.9% |
| Cost | 2028 |
| Alternative 13 | |
|---|---|
| Accuracy | 40.1% |
| Cost | 2028 |
| Alternative 14 | |
|---|---|
| Accuracy | 40.1% |
| Cost | 2024 |
| Alternative 15 | |
|---|---|
| Accuracy | 34.3% |
| Cost | 1896 |
| Alternative 16 | |
|---|---|
| Accuracy | 40.9% |
| Cost | 1896 |
| Alternative 17 | |
|---|---|
| Accuracy | 33.4% |
| Cost | 1764 |
| Alternative 18 | |
|---|---|
| Accuracy | 68.8% |
| Cost | 1740 |
| Alternative 19 | |
|---|---|
| Accuracy | 30.4% |
| Cost | 1632 |
| Alternative 20 | |
|---|---|
| Accuracy | 42.2% |
| Cost | 1632 |
| Alternative 21 | |
|---|---|
| Accuracy | 66.4% |
| Cost | 1612 |
| Alternative 22 | |
|---|---|
| Accuracy | 42.4% |
| Cost | 1368 |
| Alternative 23 | |
|---|---|
| Accuracy | 22.6% |
| Cost | 1308 |
| Alternative 24 | |
|---|---|
| Accuracy | 22.6% |
| Cost | 1308 |
| Alternative 25 | |
|---|---|
| Accuracy | 19.5% |
| Cost | 1176 |
| Alternative 26 | |
|---|---|
| Accuracy | 19.0% |
| Cost | 1113 |
| Alternative 27 | |
|---|---|
| Accuracy | 18.9% |
| Cost | 1113 |
| Alternative 28 | |
|---|---|
| Accuracy | 20.7% |
| Cost | 1112 |
| Alternative 29 | |
|---|---|
| Accuracy | 21.2% |
| Cost | 912 |
| Alternative 30 | |
|---|---|
| Accuracy | 23.2% |
| Cost | 912 |
| Alternative 31 | |
|---|---|
| Accuracy | 21.1% |
| Cost | 780 |
| Alternative 32 | |
|---|---|
| Accuracy | 16.6% |
| Cost | 320 |
| Alternative 33 | |
|---|---|
| Accuracy | 16.6% |
| Cost | 320 |
herbie shell --seed 2023137
(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)))))