\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 y - a \cdot t\\
t_2 := \mathsf{fma}\left(x, t_1, j \cdot \left(c \cdot t - i \cdot y\right)\right)\\
t_3 := i \cdot a - c \cdot z\\
t_4 := \mathsf{fma}\left(b, t_3, t_2\right)\\
\mathbf{if}\;j \leq -2.4801242598556534 \cdot 10^{-24}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq -3.470786552764898 \cdot 10^{-71}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + t \cdot \left(j \cdot c - a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_5 := y \cdot \left(z \cdot x\right)\\
t_6 := a \cdot \left(x \cdot t\right)\\
\mathbf{if}\;j \leq -2.4408582861360383 \cdot 10^{-231}:\\
\;\;\;\;\mathsf{fma}\left(b, t_3, t_5 - \left(y \cdot \left(j \cdot i\right) + t_6\right)\right)\\
\mathbf{elif}\;j \leq -7.090125446361172 \cdot 10^{-283}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq 7.426429121366233 \cdot 10^{-187}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot i, t_5\right) - \mathsf{fma}\left(c, b \cdot z, t_6\right)\\
\mathbf{elif}\;j \leq 9.762989677428703 \cdot 10^{-183}:\\
\;\;\;\;x \cdot t_1\\
\mathbf{elif}\;j \leq 4.341747647585589 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(b, \sqrt[3]{{t_3}^{3}}, t_2\right)\\
\mathbf{elif}\;j \leq 3.881933784725765 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(i, b \cdot a, c \cdot \left(j \cdot t\right)\right) - \mathsf{fma}\left(c, b \cdot z, \mathsf{fma}\left(a, x \cdot t, i \cdot \left(j \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_7 := z \cdot x - j \cdot i\\
\mathbf{if}\;j \leq 0.00022820018466013974:\\
\;\;\;\;\mathsf{fma}\left(y, t_7, a \cdot \left(b \cdot i - x \cdot t\right)\right)\\
\mathbf{elif}\;j \leq 8.037968703008732 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(b, t_3, \mathsf{fma}\left(c, j \cdot t, y \cdot t_7\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}\\
\end{array}\\
\end{array}
(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 y) (* a t)))
(t_2 (fma x t_1 (* j (- (* c t) (* i y)))))
(t_3 (- (* i a) (* c z)))
(t_4 (fma b t_3 t_2)))
(if (<= j -2.4801242598556534e-24)
t_4
(if (<= j -3.470786552764898e-71)
(+ (* z (- (* x y) (* b c))) (* t (- (* j c) (* a x))))
(let* ((t_5 (* y (* z x))) (t_6 (* a (* x t))))
(if (<= j -2.4408582861360383e-231)
(fma b t_3 (- t_5 (+ (* y (* j i)) t_6)))
(if (<= j -7.090125446361172e-283)
t_4
(if (<= j 7.426429121366233e-187)
(- (fma a (* b i) t_5) (fma c (* b z) t_6))
(if (<= j 9.762989677428703e-183)
(* x t_1)
(if (<= j 4.341747647585589e-155)
(fma b (cbrt (pow t_3 3.0)) t_2)
(if (<= j 3.881933784725765e-61)
(-
(fma i (* b a) (* c (* j t)))
(fma c (* b z) (fma a (* x t) (* i (* j y)))))
(let* ((t_7 (- (* z x) (* j i))))
(if (<= j 0.00022820018466013974)
(fma y t_7 (* a (- (* b i) (* x t))))
(if (<= j 8.037968703008732e+144)
(fma b t_3 (fma c (* j t) (* y t_7)))
t_4))))))))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * y) - (a * t);
double t_2 = fma(x, t_1, (j * ((c * t) - (i * y))));
double t_3 = (i * a) - (c * z);
double t_4 = fma(b, t_3, t_2);
double tmp;
if (j <= -2.4801242598556534e-24) {
tmp = t_4;
} else if (j <= -3.470786552764898e-71) {
tmp = (z * ((x * y) - (b * c))) + (t * ((j * c) - (a * x)));
} else {
double t_5 = y * (z * x);
double t_6 = a * (x * t);
double tmp_1;
if (j <= -2.4408582861360383e-231) {
tmp_1 = fma(b, t_3, (t_5 - ((y * (j * i)) + t_6)));
} else if (j <= -7.090125446361172e-283) {
tmp_1 = t_4;
} else if (j <= 7.426429121366233e-187) {
tmp_1 = fma(a, (b * i), t_5) - fma(c, (b * z), t_6);
} else if (j <= 9.762989677428703e-183) {
tmp_1 = x * t_1;
} else if (j <= 4.341747647585589e-155) {
tmp_1 = fma(b, cbrt(pow(t_3, 3.0)), t_2);
} else if (j <= 3.881933784725765e-61) {
tmp_1 = fma(i, (b * a), (c * (j * t))) - fma(c, (b * z), fma(a, (x * t), (i * (j * y))));
} else {
double t_7 = (z * x) - (j * i);
double tmp_2;
if (j <= 0.00022820018466013974) {
tmp_2 = fma(y, t_7, (a * ((b * i) - (x * t))));
} else if (j <= 8.037968703008732e+144) {
tmp_2 = fma(b, t_3, fma(c, (j * t), (y * t_7)));
} else {
tmp_2 = t_4;
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus i




Bits error versus j
| Original | 16.9 |
|---|---|
| Target | 20.1 |
| Herbie | 16.7 |
if j < -2.48012425985565338e-24 or -2.4408582861360383e-231 < j < -7.0901254463611715e-283 or 8.0379687030087321e144 < j Initial program 16.8
Simplified14.2
Taylor expanded in b around 0 24.1
Simplified14.2
if -2.48012425985565338e-24 < j < -3.47078655276489802e-71Initial program 15.9
Simplified15.0
Taylor expanded in i around 0 26.6
Simplified25.5
if -3.47078655276489802e-71 < j < -2.4408582861360383e-231Initial program 16.8
Simplified15.7
Taylor expanded in a around 0 15.7
Taylor expanded in c around 0 15.1
if -7.0901254463611715e-283 < j < 7.4264291213662329e-187Initial program 20.0
Simplified18.9
Applied add-cube-cbrt_binary6419.1
Taylor expanded in j around 0 17.4
Simplified16.7
if 7.4264291213662329e-187 < j < 9.7629896774287031e-183Initial program 22.6
Simplified22.6
Applied add-cube-cbrt_binary6422.6
Taylor expanded in x around inf 15.1
Simplified15.1
if 9.7629896774287031e-183 < j < 4.3417476475855887e-155Initial program 13.8
Simplified13.4
Applied add-cbrt-cube_binary6423.2
Simplified23.2
if 4.3417476475855887e-155 < j < 3.8819337847257652e-61Initial program 16.8
Simplified16.1
Applied add-cube-cbrt_binary6416.3
Taylor expanded in b around 0 13.5
Simplified12.8
Taylor expanded in c around inf 19.8
if 3.8819337847257652e-61 < j < 2.2820018466013974e-4Initial program 15.0
Simplified13.8
Taylor expanded in a around 0 13.8
Taylor expanded in c around 0 24.8
Simplified20.9
if 2.2820018466013974e-4 < j < 8.0379687030087321e144Initial program 15.6
Simplified14.0
Taylor expanded in a around 0 14.0
Taylor expanded in a around 0 21.8
Simplified20.5
Final simplification16.7
herbie shell --seed 2022088
(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)))))