| Alternative 1 | |
|---|---|
| Accuracy | 90.7% |
| Cost | 5705 |
(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 (* z (- (* x y) (* b c))))
(t_2 (* j (- (* t c) (* y i))))
(t_3 (* b (- (* a i) (* z c))))
(t_4 (- t_2 (- (* x (- (* t a) (* y z))) t_3))))
(if (<= t_4 (- INFINITY))
(+ (+ t_2 (* a (- (* b i) (* x t)))) t_1)
(if (<= t_4 1e+306)
(+ (+ (- (* x (* y z)) (* x (* t a))) t_3) t_2)
(+ (- (- (* a (* b i)) (* a (* x t))) (* y (* i j))) t_1)))))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 = z * ((x * y) - (b * c));
double t_2 = j * ((t * c) - (y * i));
double t_3 = b * ((a * i) - (z * c));
double t_4 = t_2 - ((x * ((t * a) - (y * z))) - t_3);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (t_2 + (a * ((b * i) - (x * t)))) + t_1;
} else if (t_4 <= 1e+306) {
tmp = (((x * (y * z)) - (x * (t * a))) + t_3) + t_2;
} else {
tmp = (((a * (b * i)) - (a * (x * t))) - (y * (i * j))) + t_1;
}
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 = z * ((x * y) - (b * c));
double t_2 = j * ((t * c) - (y * i));
double t_3 = b * ((a * i) - (z * c));
double t_4 = t_2 - ((x * ((t * a) - (y * z))) - t_3);
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = (t_2 + (a * ((b * i) - (x * t)))) + t_1;
} else if (t_4 <= 1e+306) {
tmp = (((x * (y * z)) - (x * (t * a))) + t_3) + t_2;
} else {
tmp = (((a * (b * i)) - (a * (x * t))) - (y * (i * j))) + t_1;
}
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 = z * ((x * y) - (b * c)) t_2 = j * ((t * c) - (y * i)) t_3 = b * ((a * i) - (z * c)) t_4 = t_2 - ((x * ((t * a) - (y * z))) - t_3) tmp = 0 if t_4 <= -math.inf: tmp = (t_2 + (a * ((b * i) - (x * t)))) + t_1 elif t_4 <= 1e+306: tmp = (((x * (y * z)) - (x * (t * a))) + t_3) + t_2 else: tmp = (((a * (b * i)) - (a * (x * t))) - (y * (i * j))) + t_1 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 = Float64(z * Float64(Float64(x * y) - Float64(b * c))) t_2 = Float64(j * Float64(Float64(t * c) - Float64(y * i))) t_3 = Float64(b * Float64(Float64(a * i) - Float64(z * c))) t_4 = Float64(t_2 - Float64(Float64(x * Float64(Float64(t * a) - Float64(y * z))) - t_3)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(t_2 + Float64(a * Float64(Float64(b * i) - Float64(x * t)))) + t_1); elseif (t_4 <= 1e+306) tmp = Float64(Float64(Float64(Float64(x * Float64(y * z)) - Float64(x * Float64(t * a))) + t_3) + t_2); else tmp = Float64(Float64(Float64(Float64(a * Float64(b * i)) - Float64(a * Float64(x * t))) - Float64(y * Float64(i * j))) + t_1); 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 = z * ((x * y) - (b * c)); t_2 = j * ((t * c) - (y * i)); t_3 = b * ((a * i) - (z * c)); t_4 = t_2 - ((x * ((t * a) - (y * z))) - t_3); tmp = 0.0; if (t_4 <= -Inf) tmp = (t_2 + (a * ((b * i) - (x * t)))) + t_1; elseif (t_4 <= 1e+306) tmp = (((x * (y * z)) - (x * (t * a))) + t_3) + t_2; else tmp = (((a * (b * i)) - (a * (x * t))) - (y * (i * j))) + t_1; 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[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(N[(a * i), $MachinePrecision] - N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 - N[(N[(x * N[(N[(t * a), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(t$95$2 + N[(a * N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 1e+306], N[(N[(N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(x * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] - N[(a * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $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 := z \cdot \left(x \cdot y - b \cdot c\right)\\
t_2 := j \cdot \left(t \cdot c - y \cdot i\right)\\
t_3 := b \cdot \left(a \cdot i - z \cdot c\right)\\
t_4 := t_2 - \left(x \cdot \left(t \cdot a - y \cdot z\right) - t_3\right)\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;\left(t_2 + a \cdot \left(b \cdot i - x \cdot t\right)\right) + t_1\\
\mathbf{elif}\;t_4 \leq 10^{+306}:\\
\;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) - x \cdot \left(t \cdot a\right)\right) + t_3\right) + t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a \cdot \left(b \cdot i\right) - a \cdot \left(x \cdot t\right)\right) - y \cdot \left(i \cdot j\right)\right) + t_1\\
\end{array}
Results
| Original | 80.3% |
|---|---|
| Target | 74.5% |
| Herbie | 92.7% |
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.0Initial program 0.0%
Simplified0.0%
[Start]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)
\] |
|---|---|
associate-+l- [=>]0.0 | \[ \color{blue}{x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)}
\] |
fma-neg [=>]0.0 | \[ \color{blue}{\mathsf{fma}\left(x, y \cdot z - t \cdot a, -\left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}
\] |
neg-sub0 [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)}\right)
\] |
associate-+l- [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(0 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)}\right)
\] |
neg-sub0 [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(-b \cdot \left(c \cdot z - i \cdot a\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\right)
\] |
distribute-rgt-neg-in [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{b \cdot \left(-\left(c \cdot z - i \cdot a\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\right)
\] |
fma-def [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\mathsf{fma}\left(b, -\left(c \cdot z - i \cdot a\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)}\right)
\] |
sub-neg [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, -\color{blue}{\left(c \cdot z + \left(-i \cdot a\right)\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
distribute-neg-in [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(-c \cdot z\right) + \left(-\left(-i \cdot a\right)\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
+-commutative [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(-\left(-i \cdot a\right)\right) + \left(-c \cdot z\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
remove-double-neg [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{i \cdot a} + \left(-c \cdot z\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
sub-neg [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{i \cdot a - c \cdot z}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
*-commutative [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{a \cdot i} - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
*-commutative [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, a \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
Applied egg-rr0.0%
[Start]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
|---|---|
prod-diff [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(a, i, -c \cdot z\right) + \mathsf{fma}\left(-c, z, c \cdot z\right)}, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(a, i, -\color{blue}{z \cdot c}\right) + \mathsf{fma}\left(-c, z, c \cdot z\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
fma-neg [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(a \cdot i - z \cdot c\right)} + \mathsf{fma}\left(-c, z, c \cdot z\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
prod-diff [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(\mathsf{fma}\left(a, i, -c \cdot z\right) + \mathsf{fma}\left(-c, z, c \cdot z\right)\right)} + \mathsf{fma}\left(-c, z, c \cdot z\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\mathsf{fma}\left(a, i, -\color{blue}{z \cdot c}\right) + \mathsf{fma}\left(-c, z, c \cdot z\right)\right) + \mathsf{fma}\left(-c, z, c \cdot z\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
fma-neg [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\color{blue}{\left(a \cdot i - z \cdot c\right)} + \mathsf{fma}\left(-c, z, c \cdot z\right)\right) + \mathsf{fma}\left(-c, z, c \cdot z\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
associate-+l+ [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(a \cdot i - z \cdot c\right) + \left(\mathsf{fma}\left(-c, z, c \cdot z\right) + \mathsf{fma}\left(-c, z, c \cdot z\right)\right)}, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(a \cdot i - z \cdot c\right) + \left(\mathsf{fma}\left(-c, z, \color{blue}{z \cdot c}\right) + \mathsf{fma}\left(-c, z, c \cdot z\right)\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(a \cdot i - z \cdot c\right) + \left(\mathsf{fma}\left(-c, z, z \cdot c\right) + \mathsf{fma}\left(-c, z, \color{blue}{z \cdot c}\right)\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
Simplified0.0%
[Start]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(a \cdot i - z \cdot c\right) + \left(\mathsf{fma}\left(-c, z, z \cdot c\right) + \mathsf{fma}\left(-c, z, z \cdot c\right)\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
|---|---|
*-commutative [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\color{blue}{i \cdot a} - z \cdot c\right) + \left(\mathsf{fma}\left(-c, z, z \cdot c\right) + \mathsf{fma}\left(-c, z, z \cdot c\right)\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(i \cdot a - \color{blue}{c \cdot z}\right) + \left(\mathsf{fma}\left(-c, z, z \cdot c\right) + \mathsf{fma}\left(-c, z, z \cdot c\right)\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
count-2 [=>]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(i \cdot a - c \cdot z\right) + \color{blue}{2 \cdot \mathsf{fma}\left(-c, z, z \cdot c\right)}, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [<=]0.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(i \cdot a - c \cdot z\right) + 2 \cdot \mathsf{fma}\left(-c, z, \color{blue}{c \cdot z}\right), j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
Taylor expanded in y around 0 54.9%
Simplified54.9%
[Start]54.9 | \[ \left(\left(i \cdot a + 2 \cdot \left(-1 \cdot \left(c \cdot z\right) + c \cdot z\right)\right) - c \cdot z\right) \cdot b + \left(\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) + c \cdot \left(t \cdot j\right)\right)\right)
\] |
|---|
Taylor expanded in z around -inf 81.3%
Simplified62.4%
[Start]81.3 | \[ \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) - a \cdot \left(t \cdot x\right)
\] |
|---|---|
associate-*r* [=>]72.2 | \[ \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) - \color{blue}{\left(a \cdot t\right) \cdot x}
\] |
cancel-sign-sub-inv [=>]72.2 | \[ \color{blue}{\left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) + \left(-a \cdot t\right) \cdot x}
\] |
mul-1-neg [<=]72.2 | \[ \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) + \color{blue}{\left(-1 \cdot \left(a \cdot t\right)\right)} \cdot x
\] |
associate-*r* [<=]72.2 | \[ \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) + \color{blue}{-1 \cdot \left(\left(a \cdot t\right) \cdot x\right)}
\] |
associate-*r* [<=]81.3 | \[ \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right) + -1 \cdot \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)}
\] |
+-commutative [=>]81.3 | \[ \color{blue}{-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \left(-1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right) + \left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)\right)}
\] |
+-commutative [=>]81.3 | \[ -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + \color{blue}{\left(\left(c \cdot \left(t \cdot j\right) + \left(-1 \cdot \left(y \cdot \left(i \cdot j\right)\right) + a \cdot \left(i \cdot b\right)\right)\right) + -1 \cdot \left(\left(c \cdot b + -1 \cdot \left(y \cdot x\right)\right) \cdot z\right)\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)))) < 1.00000000000000002e306Initial program 98.7%
Applied egg-rr98.7%
[Start]98.7 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
|---|---|
cancel-sign-sub-inv [=>]98.7 | \[ \left(x \cdot \color{blue}{\left(y \cdot z + \left(-t\right) \cdot a\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-rgt-in [=>]98.7 | \[ \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x + \left(\left(-t\right) \cdot a\right) \cdot x\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-lft-neg-in [<=]98.7 | \[ \left(\left(\left(y \cdot z\right) \cdot x + \color{blue}{\left(-t \cdot a\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
distribute-rgt-neg-in [=>]98.7 | \[ \left(\left(\left(y \cdot z\right) \cdot x + \color{blue}{\left(t \cdot \left(-a\right)\right)} \cdot x\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\] |
if 1.00000000000000002e306 < (+.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)))) Initial program 1.9%
Simplified1.9%
[Start]1.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)
\] |
|---|---|
associate-+l- [=>]1.9 | \[ \color{blue}{x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)}
\] |
fma-neg [=>]1.9 | \[ \color{blue}{\mathsf{fma}\left(x, y \cdot z - t \cdot a, -\left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}
\] |
neg-sub0 [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) - j \cdot \left(c \cdot t - i \cdot y\right)\right)}\right)
\] |
associate-+l- [<=]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(0 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)}\right)
\] |
neg-sub0 [<=]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(-b \cdot \left(c \cdot z - i \cdot a\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\right)
\] |
distribute-rgt-neg-in [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{b \cdot \left(-\left(c \cdot z - i \cdot a\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\right)
\] |
fma-def [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\mathsf{fma}\left(b, -\left(c \cdot z - i \cdot a\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)}\right)
\] |
sub-neg [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, -\color{blue}{\left(c \cdot z + \left(-i \cdot a\right)\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
distribute-neg-in [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(-c \cdot z\right) + \left(-\left(-i \cdot a\right)\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
+-commutative [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(-\left(-i \cdot a\right)\right) + \left(-c \cdot z\right)}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
remove-double-neg [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{i \cdot a} + \left(-c \cdot z\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
sub-neg [<=]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{i \cdot a - c \cdot z}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
*-commutative [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{a \cdot i} - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
*-commutative [=>]1.9 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, a \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)
\] |
Taylor expanded in z around 0 60.1%
Taylor expanded in c around 0 70.3%
Simplified70.2%
[Start]70.3 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
|---|---|
associate-*r* [=>]59.2 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(-1 \cdot \color{blue}{\left(\left(i \cdot y\right) \cdot j\right)} + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
*-commutative [<=]59.2 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(-1 \cdot \left(\color{blue}{\left(y \cdot i\right)} \cdot j\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
associate-*r* [<=]70.2 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(-1 \cdot \color{blue}{\left(y \cdot \left(i \cdot j\right)\right)} + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
associate-*r* [=>]70.2 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(\color{blue}{\left(-1 \cdot y\right) \cdot \left(i \cdot j\right)} + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
neg-mul-1 [<=]70.2 | \[ \left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right) \cdot z + \left(\color{blue}{\left(-y\right)} \cdot \left(i \cdot j\right) + \left(-1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + a \cdot \left(i \cdot b\right)\right)\right)
\] |
Final simplification92.7%
| Alternative 1 | |
|---|---|
| Accuracy | 90.7% |
| Cost | 5705 |
| Alternative 2 | |
|---|---|
| Accuracy | 91.6% |
| Cost | 5705 |
| Alternative 3 | |
|---|---|
| Accuracy | 92.7% |
| Cost | 5704 |
| Alternative 4 | |
|---|---|
| Accuracy | 42.4% |
| Cost | 2688 |
| Alternative 5 | |
|---|---|
| Accuracy | 42.7% |
| Cost | 2688 |
| Alternative 6 | |
|---|---|
| Accuracy | 37.3% |
| Cost | 2556 |
| Alternative 7 | |
|---|---|
| Accuracy | 66.1% |
| Cost | 2396 |
| Alternative 8 | |
|---|---|
| Accuracy | 42.2% |
| Cost | 2292 |
| Alternative 9 | |
|---|---|
| Accuracy | 42.1% |
| Cost | 2292 |
| Alternative 10 | |
|---|---|
| Accuracy | 55.1% |
| Cost | 2143 |
| Alternative 11 | |
|---|---|
| Accuracy | 34.1% |
| Cost | 2028 |
| Alternative 12 | |
|---|---|
| Accuracy | 65.3% |
| Cost | 2008 |
| Alternative 13 | |
|---|---|
| Accuracy | 65.3% |
| Cost | 2008 |
| Alternative 14 | |
|---|---|
| Accuracy | 40.9% |
| Cost | 1896 |
| Alternative 15 | |
|---|---|
| Accuracy | 22.6% |
| Cost | 1837 |
| Alternative 16 | |
|---|---|
| Accuracy | 22.5% |
| Cost | 1837 |
| Alternative 17 | |
|---|---|
| Accuracy | 34.1% |
| Cost | 1764 |
| Alternative 18 | |
|---|---|
| Accuracy | 66.5% |
| Cost | 1746 |
| Alternative 19 | |
|---|---|
| Accuracy | 66.4% |
| Cost | 1744 |
| Alternative 20 | |
|---|---|
| Accuracy | 31.7% |
| Cost | 1632 |
| Alternative 21 | |
|---|---|
| Accuracy | 38.1% |
| Cost | 1632 |
| Alternative 22 | |
|---|---|
| Accuracy | 21.1% |
| Cost | 1572 |
| Alternative 23 | |
|---|---|
| Accuracy | 42.3% |
| Cost | 1500 |
| Alternative 24 | |
|---|---|
| Accuracy | 68.1% |
| Cost | 1481 |
| Alternative 25 | |
|---|---|
| Accuracy | 22.0% |
| Cost | 1440 |
| Alternative 26 | |
|---|---|
| Accuracy | 21.8% |
| Cost | 1440 |
| Alternative 27 | |
|---|---|
| Accuracy | 31.4% |
| Cost | 1177 |
| Alternative 28 | |
|---|---|
| Accuracy | 21.3% |
| Cost | 848 |
| Alternative 29 | |
|---|---|
| Accuracy | 21.7% |
| Cost | 585 |
| Alternative 30 | |
|---|---|
| Accuracy | 21.3% |
| Cost | 584 |
| Alternative 31 | |
|---|---|
| Accuracy | 16.7% |
| Cost | 320 |
| Alternative 32 | |
|---|---|
| Accuracy | 16.6% |
| Cost | 320 |
herbie shell --seed 2023135
(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)))))