| Alternative 1 | |
|---|---|
| Accuracy | 90.1% |
| Cost | 11976 |
(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 (- (* t i) (* z c)))
(t_2 (* j (- (* a c) (* y i))))
(t_3 (- (* y z) (* t a)))
(t_4 (+ (+ (* x t_3) (* b t_1)) t_2)))
(if (<= t_4 (- INFINITY))
(+ (* c (- (* a j) (* z b))) (* y (- (* x z) (* i j))))
(if (<= t_4 3e+302)
(fma x t_3 (fma b t_1 t_2))
(- (* i (fma t b (* y (- j)))) (* t (* x a)))))))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 = (t * i) - (z * c);
double t_2 = j * ((a * c) - (y * i));
double t_3 = (y * z) - (t * a);
double t_4 = ((x * t_3) + (b * t_1)) + t_2;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (c * ((a * j) - (z * b))) + (y * ((x * z) - (i * j)));
} else if (t_4 <= 3e+302) {
tmp = fma(x, t_3, fma(b, t_1, t_2));
} else {
tmp = (i * fma(t, b, (y * -j))) - (t * (x * a));
}
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(Float64(t * i) - Float64(z * c)) t_2 = Float64(j * Float64(Float64(a * c) - Float64(y * i))) t_3 = Float64(Float64(y * z) - Float64(t * a)) t_4 = Float64(Float64(Float64(x * t_3) + Float64(b * t_1)) + t_2) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(c * Float64(Float64(a * j) - Float64(z * b))) + Float64(y * Float64(Float64(x * z) - Float64(i * j)))); elseif (t_4 <= 3e+302) tmp = fma(x, t_3, fma(b, t_1, t_2)); else tmp = Float64(Float64(i * fma(t, b, Float64(y * Float64(-j)))) - Float64(t * Float64(x * a))); 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[(N[(t * i), $MachinePrecision] - N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * t$95$3), $MachinePrecision] + N[(b * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(c * N[(N[(a * j), $MachinePrecision] - N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(x * z), $MachinePrecision] - N[(i * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 3e+302], N[(x * t$95$3 + N[(b * t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[(t * b + N[(y * (-j)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\begin{array}{l}
t_1 := t \cdot i - z \cdot c\\
t_2 := j \cdot \left(a \cdot c - y \cdot i\right)\\
t_3 := y \cdot z - t \cdot a\\
t_4 := \left(x \cdot t_3 + b \cdot t_1\right) + t_2\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;c \cdot \left(a \cdot j - z \cdot b\right) + y \cdot \left(x \cdot z - i \cdot j\right)\\
\mathbf{elif}\;t_4 \leq 3 \cdot 10^{+302}:\\
\;\;\;\;\mathsf{fma}\left(x, t_3, \mathsf{fma}\left(b, t_1, t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(t, b, y \cdot \left(-j\right)\right) - t \cdot \left(x \cdot a\right)\\
\end{array}
| Original | 80.8% |
|---|---|
| Target | 67.9% |
| Herbie | 90.1% |
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 0.0%
Simplified0.0%
[Start]0.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- [=>]0.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 [=>]0.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 [=>]0.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- [<=]0.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 [<=]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]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(-t \cdot i\right)\right)}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)
\] |
+-commutative [=>]0.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 [=>]0.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 [<=]0.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 [=>]0.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 [=>]0.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 t around 0 31.8%
Simplified37.4%
[Start]31.8 | \[ -1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + \left(y \cdot \left(z \cdot x\right) + j \cdot \left(c \cdot a - y \cdot i\right)\right)
\] |
|---|---|
associate-+r+ [=>]31.8 | \[ \color{blue}{\left(-1 \cdot \left(c \cdot \left(b \cdot z\right)\right) + y \cdot \left(z \cdot x\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)}
\] |
associate-*r* [=>]33.9 | \[ \left(-1 \cdot \color{blue}{\left(\left(c \cdot b\right) \cdot z\right)} + y \cdot \left(z \cdot x\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
associate-*r* [=>]33.9 | \[ \left(\color{blue}{\left(-1 \cdot \left(c \cdot b\right)\right) \cdot z} + y \cdot \left(z \cdot x\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
*-commutative [<=]33.9 | \[ \left(\color{blue}{z \cdot \left(-1 \cdot \left(c \cdot b\right)\right)} + y \cdot \left(z \cdot x\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
*-commutative [=>]33.9 | \[ \left(z \cdot \left(-1 \cdot \left(c \cdot b\right)\right) + \color{blue}{\left(z \cdot x\right) \cdot y}\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
associate-*r* [<=]37.4 | \[ \left(z \cdot \left(-1 \cdot \left(c \cdot b\right)\right) + \color{blue}{z \cdot \left(x \cdot y\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
*-commutative [<=]37.4 | \[ \left(z \cdot \left(-1 \cdot \left(c \cdot b\right)\right) + z \cdot \color{blue}{\left(y \cdot x\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
distribute-lft-in [<=]37.4 | \[ \color{blue}{z \cdot \left(-1 \cdot \left(c \cdot b\right) + y \cdot x\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
+-commutative [<=]37.4 | \[ z \cdot \color{blue}{\left(y \cdot x + -1 \cdot \left(c \cdot b\right)\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
mul-1-neg [=>]37.4 | \[ z \cdot \left(y \cdot x + \color{blue}{\left(-c \cdot b\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
unsub-neg [=>]37.4 | \[ z \cdot \color{blue}{\left(y \cdot x - c \cdot b\right)} + j \cdot \left(c \cdot a - y \cdot i\right)
\] |
*-commutative [<=]37.4 | \[ z \cdot \left(y \cdot x - c \cdot b\right) + j \cdot \left(c \cdot a - \color{blue}{i \cdot y}\right)
\] |
Taylor expanded in c around -inf 59.4%
Simplified58.8%
[Start]59.4 | \[ -1 \cdot \left(i \cdot \left(y \cdot j\right)\right) + \left(y \cdot \left(z \cdot x\right) + -1 \cdot \left(c \cdot \left(z \cdot b + -1 \cdot \left(a \cdot j\right)\right)\right)\right)
\] |
|---|---|
associate-+r+ [=>]59.4 | \[ \color{blue}{\left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right) + -1 \cdot \left(c \cdot \left(z \cdot b + -1 \cdot \left(a \cdot j\right)\right)\right)}
\] |
mul-1-neg [=>]59.4 | \[ \left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right) + \color{blue}{\left(-c \cdot \left(z \cdot b + -1 \cdot \left(a \cdot j\right)\right)\right)}
\] |
unsub-neg [=>]59.4 | \[ \color{blue}{\left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right) + y \cdot \left(z \cdot x\right)\right) - c \cdot \left(z \cdot b + -1 \cdot \left(a \cdot j\right)\right)}
\] |
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)))) < 2.9999999999999998e302Initial program 98.7%
Simplified98.7%
[Start]98.7 | \[ \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- [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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- [<=]98.7 | \[ \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 [<=]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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 [<=]98.7 | \[ \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 [=>]98.7 | \[ \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 [=>]98.7 | \[ \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)
\] |
if 2.9999999999999998e302 < (+.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 6.3%
Simplified6.3%
[Start]6.3 | \[ \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- [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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- [<=]6.3 | \[ \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 [<=]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 [<=]6.3 | \[ \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 [=>]6.3 | \[ \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 [=>]6.3 | \[ \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 i around inf 37.8%
Simplified37.8%
[Start]37.8 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, i \cdot \left(t \cdot b + -1 \cdot \left(y \cdot j\right)\right)\right)
\] |
|---|---|
fma-def [=>]37.8 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, i \cdot \color{blue}{\mathsf{fma}\left(t, b, -1 \cdot \left(y \cdot j\right)\right)}\right)
\] |
associate-*r* [=>]37.8 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, i \cdot \mathsf{fma}\left(t, b, \color{blue}{\left(-1 \cdot y\right) \cdot j}\right)\right)
\] |
neg-mul-1 [<=]37.8 | \[ \mathsf{fma}\left(x, y \cdot z - t \cdot a, i \cdot \mathsf{fma}\left(t, b, \color{blue}{\left(-y\right)} \cdot j\right)\right)
\] |
Taylor expanded in z around 0 46.6%
Simplified47.6%
[Start]46.6 | \[ -1 \cdot \left(a \cdot \left(t \cdot x\right)\right) + i \cdot \left(t \cdot b + -1 \cdot \left(y \cdot j\right)\right)
\] |
|---|---|
+-commutative [=>]46.6 | \[ \color{blue}{i \cdot \left(t \cdot b + -1 \cdot \left(y \cdot j\right)\right) + -1 \cdot \left(a \cdot \left(t \cdot x\right)\right)}
\] |
mul-1-neg [=>]46.6 | \[ i \cdot \left(t \cdot b + -1 \cdot \left(y \cdot j\right)\right) + \color{blue}{\left(-a \cdot \left(t \cdot x\right)\right)}
\] |
unsub-neg [=>]46.6 | \[ \color{blue}{i \cdot \left(t \cdot b + -1 \cdot \left(y \cdot j\right)\right) - a \cdot \left(t \cdot x\right)}
\] |
fma-def [=>]46.6 | \[ i \cdot \color{blue}{\mathsf{fma}\left(t, b, -1 \cdot \left(y \cdot j\right)\right)} - a \cdot \left(t \cdot x\right)
\] |
mul-1-neg [=>]46.6 | \[ i \cdot \mathsf{fma}\left(t, b, \color{blue}{-y \cdot j}\right) - a \cdot \left(t \cdot x\right)
\] |
distribute-rgt-neg-in [=>]46.6 | \[ i \cdot \mathsf{fma}\left(t, b, \color{blue}{y \cdot \left(-j\right)}\right) - a \cdot \left(t \cdot x\right)
\] |
*-commutative [=>]46.6 | \[ i \cdot \mathsf{fma}\left(t, b, y \cdot \left(-j\right)\right) - \color{blue}{\left(t \cdot x\right) \cdot a}
\] |
associate-*l* [=>]47.6 | \[ i \cdot \mathsf{fma}\left(t, b, y \cdot \left(-j\right)\right) - \color{blue}{t \cdot \left(x \cdot a\right)}
\] |
*-commutative [<=]47.6 | \[ i \cdot \mathsf{fma}\left(t, b, y \cdot \left(-j\right)\right) - t \cdot \color{blue}{\left(a \cdot x\right)}
\] |
Final simplification90.1%
| Alternative 1 | |
|---|---|
| Accuracy | 90.1% |
| Cost | 11976 |
| Alternative 2 | |
|---|---|
| Accuracy | 90.1% |
| Cost | 11144 |
| Alternative 3 | |
|---|---|
| Accuracy | 90.8% |
| Cost | 5705 |
| Alternative 4 | |
|---|---|
| Accuracy | 67.1% |
| Cost | 2801 |
| Alternative 5 | |
|---|---|
| Accuracy | 66.8% |
| Cost | 2664 |
| Alternative 6 | |
|---|---|
| Accuracy | 43.2% |
| Cost | 2544 |
| Alternative 7 | |
|---|---|
| Accuracy | 61.1% |
| Cost | 2404 |
| Alternative 8 | |
|---|---|
| Accuracy | 62.8% |
| Cost | 2400 |
| Alternative 9 | |
|---|---|
| Accuracy | 62.6% |
| Cost | 2400 |
| Alternative 10 | |
|---|---|
| Accuracy | 47.4% |
| Cost | 2280 |
| Alternative 11 | |
|---|---|
| Accuracy | 57.9% |
| Cost | 2272 |
| Alternative 12 | |
|---|---|
| Accuracy | 39.2% |
| Cost | 2160 |
| Alternative 13 | |
|---|---|
| Accuracy | 40.5% |
| Cost | 2160 |
| Alternative 14 | |
|---|---|
| Accuracy | 63.3% |
| Cost | 2140 |
| Alternative 15 | |
|---|---|
| Accuracy | 40.4% |
| Cost | 2029 |
| Alternative 16 | |
|---|---|
| Accuracy | 60.5% |
| Cost | 2008 |
| Alternative 17 | |
|---|---|
| Accuracy | 24.4% |
| Cost | 1968 |
| Alternative 18 | |
|---|---|
| Accuracy | 42.1% |
| Cost | 1896 |
| Alternative 19 | |
|---|---|
| Accuracy | 41.7% |
| Cost | 1764 |
| Alternative 20 | |
|---|---|
| Accuracy | 40.7% |
| Cost | 1764 |
| Alternative 21 | |
|---|---|
| Accuracy | 40.7% |
| Cost | 1764 |
| Alternative 22 | |
|---|---|
| Accuracy | 40.6% |
| Cost | 1764 |
| Alternative 23 | |
|---|---|
| Accuracy | 21.1% |
| Cost | 1640 |
| Alternative 24 | |
|---|---|
| Accuracy | 20.4% |
| Cost | 1640 |
| Alternative 25 | |
|---|---|
| Accuracy | 20.9% |
| Cost | 1640 |
| Alternative 26 | |
|---|---|
| Accuracy | 20.8% |
| Cost | 1640 |
| Alternative 27 | |
|---|---|
| Accuracy | 21.7% |
| Cost | 1640 |
| Alternative 28 | |
|---|---|
| Accuracy | 34.4% |
| Cost | 1632 |
| Alternative 29 | |
|---|---|
| Accuracy | 33.5% |
| Cost | 1632 |
| Alternative 30 | |
|---|---|
| Accuracy | 19.2% |
| Cost | 1244 |
| Alternative 31 | |
|---|---|
| Accuracy | 19.2% |
| Cost | 1244 |
| Alternative 32 | |
|---|---|
| Accuracy | 20.9% |
| Cost | 1244 |
| Alternative 33 | |
|---|---|
| Accuracy | 39.6% |
| Cost | 972 |
| Alternative 34 | |
|---|---|
| Accuracy | 17.6% |
| Cost | 585 |
| Alternative 35 | |
|---|---|
| Accuracy | 21.3% |
| Cost | 585 |
| Alternative 36 | |
|---|---|
| Accuracy | 16.3% |
| Cost | 320 |
herbie shell --seed 2023138
(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)))))