| Alternative 1 | |
|---|---|
| Error | 5.5 |
| Cost | 18248 |
(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 (* j (- (* t c) (* y i))))
(t_2 (- t_1 (+ (* b (- (* z c) (* a i))) (* x (- (* t a) (* y z))))))
(t_3 (- (* y z) (* t a))))
(if (<= t_2 (- INFINITY))
(+ (- (* c (- (* t j) (* z b))) (* i (- (* y j) (* a b)))) (* x t_3))
(if (<= t_2 1e+305)
(fma
x
(+ t_3 (* 2.0 (fma (- a) t (* t a))))
(fma b (- (* a i) (* z c)) t_1))
(fma t (- (* c j) (* x a)) (* y (- (* x z) (* i 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 = j * ((t * c) - (y * i));
double t_2 = t_1 - ((b * ((z * c) - (a * i))) + (x * ((t * a) - (y * z))));
double t_3 = (y * z) - (t * a);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((c * ((t * j) - (z * b))) - (i * ((y * j) - (a * b)))) + (x * t_3);
} else if (t_2 <= 1e+305) {
tmp = fma(x, (t_3 + (2.0 * fma(-a, t, (t * a)))), fma(b, ((a * i) - (z * c)), t_1));
} else {
tmp = fma(t, ((c * j) - (x * a)), (y * ((x * z) - (i * 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 = Float64(j * Float64(Float64(t * c) - Float64(y * i))) t_2 = Float64(t_1 - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) + Float64(x * Float64(Float64(t * a) - Float64(y * z))))) t_3 = Float64(Float64(y * z) - Float64(t * a)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(c * Float64(Float64(t * j) - Float64(z * b))) - Float64(i * Float64(Float64(y * j) - Float64(a * b)))) + Float64(x * t_3)); elseif (t_2 <= 1e+305) tmp = fma(x, Float64(t_3 + Float64(2.0 * fma(Float64(-a), t, Float64(t * a)))), fma(b, Float64(Float64(a * i) - Float64(z * c)), t_1)); else tmp = fma(t, Float64(Float64(c * j) - Float64(x * a)), Float64(y * Float64(Float64(x * z) - Float64(i * j)))); 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[(j * N[(N[(t * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(t * a), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(c * N[(N[(t * j), $MachinePrecision] - N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(N[(y * j), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(x * N[(t$95$3 + N[(2.0 * N[((-a) * t + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(N[(a * i), $MachinePrecision] - N[(z * c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(c * j), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * 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 := j \cdot \left(t \cdot c - y \cdot i\right)\\
t_2 := t_1 - \left(b \cdot \left(z \cdot c - a \cdot i\right) + x \cdot \left(t \cdot a - y \cdot z\right)\right)\\
t_3 := y \cdot z - t \cdot a\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\left(c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j - a \cdot b\right)\right) + x \cdot t_3\\
\mathbf{elif}\;t_2 \leq 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(x, t_3 + 2 \cdot \mathsf{fma}\left(-a, t, t \cdot a\right), \mathsf{fma}\left(b, a \cdot i - z \cdot c, t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, c \cdot j - x \cdot a, y \cdot \left(x \cdot z - i \cdot j\right)\right)\\
\end{array}
| Original | 12.4 |
|---|---|
| Target | 16.2 |
| Herbie | 5.6 |
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 64.0
Simplified64.0
[Start]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)
\] |
|---|---|
associate-+l- [=>]64.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 [=>]64.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 [=>]64.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- [<=]64.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 [<=]64.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 [=>]64.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 [=>]64.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 [=>]64.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 [=>]64.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 [=>]64.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 [=>]64.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 [<=]64.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 [=>]64.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 [=>]64.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)
\] |
Taylor expanded in i around -inf 24.0
Simplified24.0
[Start]24.0 | \[ -1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + \left(-1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right) + \left(\left(y \cdot z - a \cdot t\right) \cdot x + c \cdot \left(t \cdot j\right)\right)\right)
\] |
|---|---|
+-commutative [<=]24.0 | \[ -1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + \left(-1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right) + \color{blue}{\left(c \cdot \left(t \cdot j\right) + \left(y \cdot z - a \cdot t\right) \cdot x\right)}\right)
\] |
associate-+r+ [=>]24.0 | \[ \color{blue}{\left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + -1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right)\right) + \left(c \cdot \left(t \cdot j\right) + \left(y \cdot z - a \cdot t\right) \cdot x\right)}
\] |
*-commutative [=>]24.0 | \[ \left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + -1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right)\right) + \left(c \cdot \left(t \cdot j\right) + \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)}\right)
\] |
*-commutative [<=]24.0 | \[ \left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + -1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right)\right) + \left(c \cdot \left(t \cdot j\right) + x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right)\right)
\] |
associate-+r+ [=>]24.0 | \[ \color{blue}{\left(\left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + -1 \cdot \left(i \cdot \left(y \cdot j + -1 \cdot \left(a \cdot b\right)\right)\right)\right) + c \cdot \left(t \cdot j\right)\right) + x \cdot \left(y \cdot z - t \cdot a\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)))) < 9.9999999999999994e304Initial program 0.8
Simplified0.8
[Start]0.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)
\] |
|---|---|
associate-+l- [=>]0.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.8 | \[ \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.9
Simplified0.9
[Start]0.9 | \[ \mathsf{fma}\left(x, \left(y \cdot z - t \cdot a\right) + \left(\mathsf{fma}\left(-a, t, t \cdot a\right) + \mathsf{fma}\left(-a, t, t \cdot a\right)\right), \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
|---|---|
*-commutative [=>]0.9 | \[ \mathsf{fma}\left(x, \left(\color{blue}{z \cdot y} - t \cdot a\right) + \left(\mathsf{fma}\left(-a, t, t \cdot a\right) + \mathsf{fma}\left(-a, t, t \cdot a\right)\right), \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]0.9 | \[ \mathsf{fma}\left(x, \left(z \cdot y - \color{blue}{a \cdot t}\right) + \left(\mathsf{fma}\left(-a, t, t \cdot a\right) + \mathsf{fma}\left(-a, t, t \cdot a\right)\right), \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
count-2 [=>]0.9 | \[ \mathsf{fma}\left(x, \left(z \cdot y - a \cdot t\right) + \color{blue}{2 \cdot \mathsf{fma}\left(-a, t, t \cdot a\right)}, \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]0.9 | \[ \mathsf{fma}\left(x, \left(z \cdot y - a \cdot t\right) + 2 \cdot \mathsf{fma}\left(-a, t, \color{blue}{a \cdot t}\right), \mathsf{fma}\left(b, a \cdot i - z \cdot c, j \cdot \left(t \cdot c - y \cdot i\right)\right)\right)
\] |
if 9.9999999999999994e304 < (+.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 60.7
Simplified60.7
[Start]60.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)
\] |
|---|---|
associate-+l- [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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- [<=]60.7 | \[ \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 [<=]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [<=]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 b around 0 55.6
Simplified27.3
[Start]55.6 | \[ \left(c \cdot t - y \cdot i\right) \cdot j + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
|---|---|
*-commutative [=>]55.6 | \[ \color{blue}{j \cdot \left(c \cdot t - y \cdot i\right)} + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
*-commutative [<=]55.6 | \[ j \cdot \left(\color{blue}{t \cdot c} - y \cdot i\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
cancel-sign-sub-inv [=>]55.6 | \[ j \cdot \color{blue}{\left(t \cdot c + \left(-y\right) \cdot i\right)} + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
distribute-lft-in [=>]55.6 | \[ \color{blue}{\left(j \cdot \left(t \cdot c\right) + j \cdot \left(\left(-y\right) \cdot i\right)\right)} + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
distribute-lft-neg-in [<=]55.6 | \[ \left(j \cdot \left(t \cdot c\right) + j \cdot \color{blue}{\left(-y \cdot i\right)}\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
distribute-rgt-neg-out [<=]55.6 | \[ \left(j \cdot \left(t \cdot c\right) + j \cdot \color{blue}{\left(y \cdot \left(-i\right)\right)}\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
associate-*r* [=>]49.1 | \[ \left(\color{blue}{\left(j \cdot t\right) \cdot c} + j \cdot \left(y \cdot \left(-i\right)\right)\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
*-commutative [<=]49.1 | \[ \left(\color{blue}{\left(t \cdot j\right)} \cdot c + j \cdot \left(y \cdot \left(-i\right)\right)\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
*-commutative [<=]49.1 | \[ \left(\color{blue}{c \cdot \left(t \cdot j\right)} + j \cdot \left(y \cdot \left(-i\right)\right)\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
distribute-rgt-neg-out [=>]49.1 | \[ \left(c \cdot \left(t \cdot j\right) + j \cdot \color{blue}{\left(-y \cdot i\right)}\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
distribute-rgt-neg-out [=>]49.1 | \[ \left(c \cdot \left(t \cdot j\right) + \color{blue}{\left(-j \cdot \left(y \cdot i\right)\right)}\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
*-commutative [<=]49.1 | \[ \left(c \cdot \left(t \cdot j\right) + \left(-\color{blue}{\left(y \cdot i\right) \cdot j}\right)\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
associate-*r* [<=]43.9 | \[ \left(c \cdot \left(t \cdot j\right) + \left(-\color{blue}{y \cdot \left(i \cdot j\right)}\right)\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
mul-1-neg [<=]43.9 | \[ \left(c \cdot \left(t \cdot j\right) + \color{blue}{-1 \cdot \left(y \cdot \left(i \cdot j\right)\right)}\right) + \left(y \cdot z - a \cdot t\right) \cdot x
\] |
*-commutative [=>]43.9 | \[ \left(c \cdot \left(t \cdot j\right) + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)}
\] |
*-commutative [<=]43.9 | \[ \left(c \cdot \left(t \cdot j\right) + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right) + x \cdot \left(y \cdot z - \color{blue}{t \cdot a}\right)
\] |
Final simplification5.6
| Alternative 1 | |
|---|---|
| Error | 5.5 |
| Cost | 18248 |
| Alternative 2 | |
|---|---|
| Error | 5.5 |
| Cost | 12680 |
| Alternative 3 | |
|---|---|
| Error | 5.5 |
| Cost | 11336 |
| Alternative 4 | |
|---|---|
| Error | 5.4 |
| Cost | 5704 |
| Alternative 5 | |
|---|---|
| Error | 34.7 |
| Cost | 3205 |
| Alternative 6 | |
|---|---|
| Error | 35.1 |
| Cost | 3072 |
| Alternative 7 | |
|---|---|
| Error | 35.2 |
| Cost | 2940 |
| Alternative 8 | |
|---|---|
| Error | 23.4 |
| Cost | 2928 |
| Alternative 9 | |
|---|---|
| Error | 29.8 |
| Cost | 2801 |
| Alternative 10 | |
|---|---|
| Error | 29.2 |
| Cost | 2668 |
| Alternative 11 | |
|---|---|
| Error | 25.4 |
| Cost | 2668 |
| Alternative 12 | |
|---|---|
| Error | 37.7 |
| Cost | 2552 |
| Alternative 13 | |
|---|---|
| Error | 33.7 |
| Cost | 2545 |
| Alternative 14 | |
|---|---|
| Error | 25.3 |
| Cost | 2532 |
| Alternative 15 | |
|---|---|
| Error | 23.6 |
| Cost | 2532 |
| Alternative 16 | |
|---|---|
| Error | 15.2 |
| Cost | 2516 |
| Alternative 17 | |
|---|---|
| Error | 33.6 |
| Cost | 2413 |
| Alternative 18 | |
|---|---|
| Error | 25.7 |
| Cost | 2272 |
| Alternative 19 | |
|---|---|
| Error | 40.3 |
| Cost | 2160 |
| Alternative 20 | |
|---|---|
| Error | 40.2 |
| Cost | 2160 |
| Alternative 21 | |
|---|---|
| Error | 50.3 |
| Cost | 2100 |
| Alternative 22 | |
|---|---|
| Error | 50.2 |
| Cost | 2100 |
| Alternative 23 | |
|---|---|
| Error | 50.3 |
| Cost | 2100 |
| Alternative 24 | |
|---|---|
| Error | 32.1 |
| Cost | 2016 |
| Alternative 25 | |
|---|---|
| Error | 50.2 |
| Cost | 1968 |
| Alternative 26 | |
|---|---|
| Error | 40.1 |
| Cost | 1896 |
| Alternative 27 | |
|---|---|
| Error | 37.0 |
| Cost | 1892 |
| Alternative 28 | |
|---|---|
| Error | 37.1 |
| Cost | 1892 |
| Alternative 29 | |
|---|---|
| Error | 37.9 |
| Cost | 1764 |
| Alternative 30 | |
|---|---|
| Error | 37.2 |
| Cost | 1764 |
| Alternative 31 | |
|---|---|
| Error | 37.1 |
| Cost | 1764 |
| Alternative 32 | |
|---|---|
| Error | 41.4 |
| Cost | 1632 |
| Alternative 33 | |
|---|---|
| Error | 50.4 |
| Cost | 1572 |
| Alternative 34 | |
|---|---|
| Error | 44.3 |
| Cost | 1500 |
| Alternative 35 | |
|---|---|
| Error | 32.6 |
| Cost | 1488 |
| Alternative 36 | |
|---|---|
| Error | 50.2 |
| Cost | 1308 |
| Alternative 37 | |
|---|---|
| Error | 51.7 |
| Cost | 1244 |
| Alternative 38 | |
|---|---|
| Error | 49.8 |
| Cost | 1112 |
| Alternative 39 | |
|---|---|
| Error | 49.8 |
| Cost | 1112 |
| Alternative 40 | |
|---|---|
| Error | 51.5 |
| Cost | 585 |
| Alternative 41 | |
|---|---|
| Error | 50.4 |
| Cost | 585 |
| Alternative 42 | |
|---|---|
| Error | 53.6 |
| Cost | 320 |
herbie shell --seed 2023031
(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)))))