| Alternative 1 | |
|---|---|
| Error | 5.1 |
| Cost | 11337 |
(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 (* i (- (* t b) (* y j))))
(t_2 (- (* a j) (* z b)))
(t_3 (* x (- (* y z) (* t a))))
(t_4 (* j (- (* a c) (* y i))))
(t_5 (+ (- t_3 (* b (- (* z c) (* t i)))) t_4)))
(if (<= t_5 (- INFINITY))
(+ (+ (* c (fma (- b) z (* z b))) t_1) (* c t_2))
(if (<= t_5 1e+307)
(+
(- t_3 (* b (- (fma c z (* 2.0 (fma (- i) t (* t i)))) (* t i))))
t_4)
(fma c t_2 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) - (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 = i * ((t * b) - (y * j));
double t_2 = (a * j) - (z * b);
double t_3 = x * ((y * z) - (t * a));
double t_4 = j * ((a * c) - (y * i));
double t_5 = (t_3 - (b * ((z * c) - (t * i)))) + t_4;
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = ((c * fma(-b, z, (z * b))) + t_1) + (c * t_2);
} else if (t_5 <= 1e+307) {
tmp = (t_3 - (b * (fma(c, z, (2.0 * fma(-i, t, (t * i)))) - (t * i)))) + t_4;
} else {
tmp = fma(c, t_2, 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(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(i * Float64(Float64(t * b) - Float64(y * j))) t_2 = Float64(Float64(a * j) - Float64(z * b)) t_3 = Float64(x * Float64(Float64(y * z) - Float64(t * a))) t_4 = Float64(j * Float64(Float64(a * c) - Float64(y * i))) t_5 = Float64(Float64(t_3 - Float64(b * Float64(Float64(z * c) - Float64(t * i)))) + t_4) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = Float64(Float64(Float64(c * fma(Float64(-b), z, Float64(z * b))) + t_1) + Float64(c * t_2)); elseif (t_5 <= 1e+307) tmp = Float64(Float64(t_3 - Float64(b * Float64(fma(c, z, Float64(2.0 * fma(Float64(-i), t, Float64(t * i)))) - Float64(t * i)))) + t_4); else tmp = fma(c, t_2, t_1); 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[(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[(i * N[(N[(t * b), $MachinePrecision] - N[(y * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * j), $MachinePrecision] - N[(z * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - N[(b * N[(N[(z * c), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(N[(N[(c * N[((-b) * z + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 1e+307], N[(N[(t$95$3 - N[(b * N[(N[(c * z + N[(2.0 * N[((-i) * t + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision], N[(c * t$95$2 + t$95$1), $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 := i \cdot \left(t \cdot b - y \cdot j\right)\\
t_2 := a \cdot j - z \cdot b\\
t_3 := x \cdot \left(y \cdot z - t \cdot a\right)\\
t_4 := j \cdot \left(a \cdot c - y \cdot i\right)\\
t_5 := \left(t_3 - b \cdot \left(z \cdot c - t \cdot i\right)\right) + t_4\\
\mathbf{if}\;t_5 \leq -\infty:\\
\;\;\;\;\left(c \cdot \mathsf{fma}\left(-b, z, z \cdot b\right) + t_1\right) + c \cdot t_2\\
\mathbf{elif}\;t_5 \leq 10^{+307}:\\
\;\;\;\;\left(t_3 - b \cdot \left(\mathsf{fma}\left(c, z, 2 \cdot \mathsf{fma}\left(-i, t, t \cdot i\right)\right) - t \cdot i\right)\right) + t_4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, t_2, t_1\right)\\
\end{array}
| Original | 12.3 |
|---|---|
| Target | 19.8 |
| Herbie | 5.2 |
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)))) < -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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
|---|---|
associate-+l- [=>]64.0 | \[ \color{blue}{x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\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 - t \cdot i\right), j \cdot \left(c \cdot a - y \cdot i\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(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\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(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
+-commutative [=>]64.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \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)\right)\right)
\] |
remove-double-neg [=>]64.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{t \cdot i} + \left(-c \cdot z\right), j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
sub-neg [<=]64.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]64.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]64.0 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - z \cdot c, j \cdot \left(\color{blue}{a \cdot c} - y \cdot i\right)\right)\right)
\] |
Taylor expanded in x around 0 57.5
Simplified23.9
[Start]57.5 | \[ \left(i \cdot t - c \cdot z\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
|---|---|
+-commutative [=>]57.5 | \[ \color{blue}{j \cdot \left(c \cdot a - y \cdot i\right) + \left(i \cdot t - c \cdot z\right) \cdot b}
\] |
*-commutative [<=]57.5 | \[ j \cdot \left(c \cdot a - \color{blue}{i \cdot y}\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.5 | \[ j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.5 | \[ j \cdot \left(a \cdot c - \color{blue}{y \cdot i}\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.5 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)}
\] |
*-commutative [<=]57.5 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \left(\color{blue}{t \cdot i} - c \cdot z\right)
\] |
cancel-sign-sub-inv [=>]57.5 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \color{blue}{\left(t \cdot i + \left(-c\right) \cdot z\right)}
\] |
*-commutative [<=]57.5 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \left(t \cdot i + \color{blue}{z \cdot \left(-c\right)}\right)
\] |
distribute-rgt-in [=>]57.5 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + \color{blue}{\left(\left(t \cdot i\right) \cdot b + \left(z \cdot \left(-c\right)\right) \cdot b\right)}
\] |
associate-+l+ [<=]57.5 | \[ \color{blue}{\left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right) + \left(z \cdot \left(-c\right)\right) \cdot b}
\] |
+-commutative [=>]57.5 | \[ \color{blue}{\left(z \cdot \left(-c\right)\right) \cdot b + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)}
\] |
*-commutative [=>]57.5 | \[ \color{blue}{\left(\left(-c\right) \cdot z\right)} \cdot b + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)
\] |
associate-*r* [<=]50.4 | \[ \color{blue}{\left(-c\right) \cdot \left(z \cdot b\right)} + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)
\] |
+-commutative [=>]50.4 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \color{blue}{\left(\left(t \cdot i\right) \cdot b + j \cdot \left(a \cdot c - y \cdot i\right)\right)}
\] |
*-commutative [=>]50.4 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \left(\color{blue}{\left(i \cdot t\right)} \cdot b + j \cdot \left(a \cdot c - y \cdot i\right)\right)
\] |
associate-*r* [<=]43.4 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \left(\color{blue}{i \cdot \left(t \cdot b\right)} + j \cdot \left(a \cdot c - y \cdot i\right)\right)
\] |
Applied egg-rr23.9
if -inf.0 < (+.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)))) < 9.99999999999999986e306Initial program 0.9
Simplified0.9
[Start]0.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 [=>]0.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 \color{blue}{\left(c \cdot a + \left(-y \cdot i\right)\right)}
\] |
distribute-rgt-in [=>]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \color{blue}{\left(\left(c \cdot a\right) \cdot j + \left(-y \cdot i\right) \cdot j\right)}
\] |
associate-+r+ [=>]0.9 | \[ \color{blue}{\left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(c \cdot a\right) \cdot j\right) + \left(-y \cdot i\right) \cdot j}
\] |
*-commutative [=>]0.9 | \[ \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(c \cdot a\right) \cdot j\right) + \color{blue}{j \cdot \left(-y \cdot i\right)}
\] |
cancel-sign-sub [<=]0.9 | \[ \color{blue}{\left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(c \cdot a\right) \cdot j\right) - \left(-j\right) \cdot \left(-y \cdot i\right)}
\] |
associate-+r- [<=]0.9 | \[ \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot a\right) \cdot j - \left(-j\right) \cdot \left(-y \cdot i\right)\right)}
\] |
*-commutative [=>]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{z \cdot c} - t \cdot i\right)\right) + \left(\left(c \cdot a\right) \cdot j - \left(-j\right) \cdot \left(-y \cdot i\right)\right)
\] |
cancel-sign-sub [=>]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \color{blue}{\left(\left(c \cdot a\right) \cdot j + j \cdot \left(-y \cdot i\right)\right)}
\] |
*-commutative [<=]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \left(\left(c \cdot a\right) \cdot j + \color{blue}{\left(-y \cdot i\right) \cdot j}\right)
\] |
distribute-rgt-in [<=]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \color{blue}{j \cdot \left(c \cdot a + \left(-y \cdot i\right)\right)}
\] |
Applied egg-rr0.9
Simplified1.0
[Start]0.9 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z + \left(\left(i \cdot \left(-t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
|---|---|
associate-+r+ [<=]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z + \color{blue}{\left(i \cdot \left(-t\right) + \left(\mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right)}\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
+-commutative [=>]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z + \color{blue}{\left(\left(\mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right) + i \cdot \left(-t\right)\right)}\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
associate-+r+ [=>]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(\left(c \cdot z + \left(\mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right) + i \cdot \left(-t\right)\right)}\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
distribute-rgt-neg-out [=>]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\left(c \cdot z + \left(\mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right) + \color{blue}{\left(-i \cdot t\right)}\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
sub-neg [<=]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(\left(c \cdot z + \left(\mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right) - i \cdot t\right)}\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
fma-def [=>]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{\mathsf{fma}\left(c, z, \mathsf{fma}\left(-i, t, i \cdot t\right) + \mathsf{fma}\left(-i, t, i \cdot t\right)\right)} - i \cdot t\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
count-2 [=>]1.0 | \[ \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\mathsf{fma}\left(c, z, \color{blue}{2 \cdot \mathsf{fma}\left(-i, t, i \cdot t\right)}\right) - i \cdot t\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)
\] |
if 9.99999999999999986e306 < (+.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 62.6
Simplified62.6
[Start]62.6 | \[ \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)
\] |
|---|---|
associate-+l- [=>]62.6 | \[ \color{blue}{x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)}
\] |
fma-neg [=>]62.6 | \[ \color{blue}{\mathsf{fma}\left(x, y \cdot z - t \cdot a, -\left(b \cdot \left(c \cdot z - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)}
\] |
neg-sub0 [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{0 - \left(b \cdot \left(c \cdot z - t \cdot i\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)}\right)
\] |
associate-+l- [<=]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(0 - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)}\right)
\] |
neg-sub0 [<=]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\left(-b \cdot \left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)\right)
\] |
distribute-rgt-neg-in [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{b \cdot \left(-\left(c \cdot z - t \cdot i\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)\right)
\] |
fma-def [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \color{blue}{\mathsf{fma}\left(b, -\left(c \cdot z - t \cdot i\right), j \cdot \left(c \cdot a - y \cdot i\right)\right)}\right)
\] |
sub-neg [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \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)\right)\right)
\] |
distribute-neg-in [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{\left(-c \cdot z\right) + \left(-\left(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
+-commutative [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \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)\right)\right)
\] |
remove-double-neg [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{t \cdot i} + \left(-c \cdot z\right), j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
sub-neg [<=]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \color{blue}{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - \color{blue}{z \cdot c}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
*-commutative [=>]62.6 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - z \cdot c, j \cdot \left(\color{blue}{a \cdot c} - y \cdot i\right)\right)\right)
\] |
Taylor expanded in x around 0 57.3
Simplified24.0
[Start]57.3 | \[ \left(i \cdot t - c \cdot z\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
|---|---|
+-commutative [=>]57.3 | \[ \color{blue}{j \cdot \left(c \cdot a - y \cdot i\right) + \left(i \cdot t - c \cdot z\right) \cdot b}
\] |
*-commutative [<=]57.3 | \[ j \cdot \left(c \cdot a - \color{blue}{i \cdot y}\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.3 | \[ j \cdot \left(\color{blue}{a \cdot c} - i \cdot y\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.3 | \[ j \cdot \left(a \cdot c - \color{blue}{y \cdot i}\right) + \left(i \cdot t - c \cdot z\right) \cdot b
\] |
*-commutative [=>]57.3 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + \color{blue}{b \cdot \left(i \cdot t - c \cdot z\right)}
\] |
*-commutative [<=]57.3 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \left(\color{blue}{t \cdot i} - c \cdot z\right)
\] |
cancel-sign-sub-inv [=>]57.3 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \color{blue}{\left(t \cdot i + \left(-c\right) \cdot z\right)}
\] |
*-commutative [<=]57.3 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + b \cdot \left(t \cdot i + \color{blue}{z \cdot \left(-c\right)}\right)
\] |
distribute-rgt-in [=>]57.3 | \[ j \cdot \left(a \cdot c - y \cdot i\right) + \color{blue}{\left(\left(t \cdot i\right) \cdot b + \left(z \cdot \left(-c\right)\right) \cdot b\right)}
\] |
associate-+l+ [<=]57.3 | \[ \color{blue}{\left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right) + \left(z \cdot \left(-c\right)\right) \cdot b}
\] |
+-commutative [=>]57.3 | \[ \color{blue}{\left(z \cdot \left(-c\right)\right) \cdot b + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)}
\] |
*-commutative [=>]57.3 | \[ \color{blue}{\left(\left(-c\right) \cdot z\right)} \cdot b + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)
\] |
associate-*r* [<=]52.2 | \[ \color{blue}{\left(-c\right) \cdot \left(z \cdot b\right)} + \left(j \cdot \left(a \cdot c - y \cdot i\right) + \left(t \cdot i\right) \cdot b\right)
\] |
+-commutative [=>]52.2 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \color{blue}{\left(\left(t \cdot i\right) \cdot b + j \cdot \left(a \cdot c - y \cdot i\right)\right)}
\] |
*-commutative [=>]52.2 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \left(\color{blue}{\left(i \cdot t\right)} \cdot b + j \cdot \left(a \cdot c - y \cdot i\right)\right)
\] |
associate-*r* [<=]42.6 | \[ \left(-c\right) \cdot \left(z \cdot b\right) + \left(\color{blue}{i \cdot \left(t \cdot b\right)} + j \cdot \left(a \cdot c - y \cdot i\right)\right)
\] |
Final simplification5.2
| Alternative 1 | |
|---|---|
| Error | 5.1 |
| Cost | 11337 |
| Alternative 2 | |
|---|---|
| Error | 5.1 |
| Cost | 11336 |
| Alternative 3 | |
|---|---|
| Error | 5.1 |
| Cost | 5705 |
| Alternative 4 | |
|---|---|
| Error | 33.1 |
| Cost | 2941 |
| Alternative 5 | |
|---|---|
| Error | 33.5 |
| Cost | 2809 |
| Alternative 6 | |
|---|---|
| Error | 32.4 |
| Cost | 2808 |
| Alternative 7 | |
|---|---|
| Error | 25.2 |
| Cost | 2536 |
| Alternative 8 | |
|---|---|
| Error | 23.4 |
| Cost | 2536 |
| Alternative 9 | |
|---|---|
| Error | 22.4 |
| Cost | 2532 |
| Alternative 10 | |
|---|---|
| Error | 22.1 |
| Cost | 2532 |
| Alternative 11 | |
|---|---|
| Error | 25.1 |
| Cost | 2404 |
| Alternative 12 | |
|---|---|
| Error | 24.9 |
| Cost | 2404 |
| Alternative 13 | |
|---|---|
| Error | 22.5 |
| Cost | 2404 |
| Alternative 14 | |
|---|---|
| Error | 22.1 |
| Cost | 2404 |
| Alternative 15 | |
|---|---|
| Error | 33.1 |
| Cost | 2148 |
| Alternative 16 | |
|---|---|
| Error | 18.1 |
| Cost | 2128 |
| Alternative 17 | |
|---|---|
| Error | 43.7 |
| Cost | 2028 |
| Alternative 18 | |
|---|---|
| Error | 28.9 |
| Cost | 2008 |
| Alternative 19 | |
|---|---|
| Error | 37.7 |
| Cost | 1896 |
| Alternative 20 | |
|---|---|
| Error | 36.7 |
| Cost | 1896 |
| Alternative 21 | |
|---|---|
| Error | 33.3 |
| Cost | 1884 |
| Alternative 22 | |
|---|---|
| Error | 33.0 |
| Cost | 1884 |
| Alternative 23 | |
|---|---|
| Error | 49.8 |
| Cost | 1836 |
| Alternative 24 | |
|---|---|
| Error | 49.6 |
| Cost | 1836 |
| Alternative 25 | |
|---|---|
| Error | 37.2 |
| Cost | 1765 |
| Alternative 26 | |
|---|---|
| Error | 49.9 |
| Cost | 1704 |
| Alternative 27 | |
|---|---|
| Error | 49.8 |
| Cost | 1704 |
| Alternative 28 | |
|---|---|
| Error | 37.2 |
| Cost | 1632 |
| Alternative 29 | |
|---|---|
| Error | 36.6 |
| Cost | 1500 |
| Alternative 30 | |
|---|---|
| Error | 34.5 |
| Cost | 1488 |
| Alternative 31 | |
|---|---|
| Error | 50.1 |
| Cost | 1440 |
| Alternative 32 | |
|---|---|
| Error | 50.2 |
| Cost | 1376 |
| Alternative 33 | |
|---|---|
| Error | 42.6 |
| Cost | 1368 |
| Alternative 34 | |
|---|---|
| Error | 36.9 |
| Cost | 1236 |
| Alternative 35 | |
|---|---|
| Error | 50.1 |
| Cost | 1176 |
| Alternative 36 | |
|---|---|
| Error | 49.8 |
| Cost | 1044 |
| Alternative 37 | |
|---|---|
| Error | 49.9 |
| Cost | 980 |
| Alternative 38 | |
|---|---|
| Error | 49.8 |
| Cost | 716 |
| Alternative 39 | |
|---|---|
| Error | 49.7 |
| Cost | 585 |
| Alternative 40 | |
|---|---|
| Error | 49.5 |
| Cost | 585 |
| Alternative 41 | |
|---|---|
| Error | 53.6 |
| Cost | 452 |
| Alternative 42 | |
|---|---|
| Error | 53.6 |
| Cost | 320 |
herbie shell --seed 2023057
(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)))))