\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 := y \cdot \left(z \cdot x - i \cdot j\right)\\
\mathbf{if}\;y \leq -6.608093164997977 \cdot 10^{+234}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := i \cdot a - z \cdot c\\
t_3 := y \cdot \left(i \cdot j\right)\\
t_4 := a \cdot \left(x \cdot t\right)\\
\mathbf{if}\;y \leq -1.2834941009206854 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, y \cdot \left(z \cdot x\right) - \left(t_3 + t_4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_5 := b \cdot a - y \cdot j\\
t_6 := c \cdot \left(j \cdot t\right)\\
t_7 := c \cdot \left(z \cdot b\right)\\
\mathbf{if}\;y \leq -7.863566089797894 \cdot 10^{-220}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, t_5, \mathsf{fma}\left(y, z \cdot x, t_6\right)\right) - t_7\right) - t_4\\
\mathbf{elif}\;y \leq -4.027453351852585 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, -i \cdot \left(y \cdot j\right)\right)\\
\mathbf{elif}\;y \leq 5.140500729646445 \cdot 10^{-265}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t, z \cdot \left(y \cdot x - b \cdot c\right) - t_4\right)\\
\mathbf{elif}\;y \leq 7.840253637968856 \cdot 10^{-120}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, t_6 - t_3\right)\\
\mathbf{elif}\;y \leq 9.482709923452732 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, \mathsf{fma}\left(x, y \cdot z - a \cdot t, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)\\
\mathbf{elif}\;y \leq 7.559661804942138 \cdot 10^{+112}:\\
\;\;\;\;\left(t_6 + i \cdot t_5\right) - \left(t_4 + t_7\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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 (* y (- (* z x) (* i j)))))
(if (<= y -6.608093164997977e+234)
t_1
(let* ((t_2 (- (* i a) (* z c))) (t_3 (* y (* i j))) (t_4 (* a (* x t))))
(if (<= y -1.2834941009206854e+111)
(fma b t_2 (- (* y (* z x)) (+ t_3 t_4)))
(let* ((t_5 (- (* b a) (* y j)))
(t_6 (* c (* j t)))
(t_7 (* c (* z b))))
(if (<= y -7.863566089797894e-220)
(- (- (fma i t_5 (fma y (* z x) t_6)) t_7) t_4)
(if (<= y -4.027453351852585e-260)
(fma b t_2 (- (* i (* y j))))
(if (<= y 5.140500729646445e-265)
(fma c (* j t) (- (* z (- (* y x) (* b c))) t_4))
(if (<= y 7.840253637968856e-120)
(fma b t_2 (- t_6 t_3))
(if (<= y 9.482709923452732e+50)
(fma
b
t_2
(fma x (- (* y z) (* a t)) (* j (- (* c t) (* y i)))))
(if (<= y 7.559661804942138e+112)
(- (+ t_6 (* i t_5)) (+ t_4 t_7))
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 = y * ((z * x) - (i * j));
double tmp;
if (y <= -6.608093164997977e+234) {
tmp = t_1;
} else {
double t_2 = (i * a) - (z * c);
double t_3 = y * (i * j);
double t_4 = a * (x * t);
double tmp_1;
if (y <= -1.2834941009206854e+111) {
tmp_1 = fma(b, t_2, ((y * (z * x)) - (t_3 + t_4)));
} else {
double t_5 = (b * a) - (y * j);
double t_6 = c * (j * t);
double t_7 = c * (z * b);
double tmp_2;
if (y <= -7.863566089797894e-220) {
tmp_2 = (fma(i, t_5, fma(y, (z * x), t_6)) - t_7) - t_4;
} else if (y <= -4.027453351852585e-260) {
tmp_2 = fma(b, t_2, -(i * (y * j)));
} else if (y <= 5.140500729646445e-265) {
tmp_2 = fma(c, (j * t), ((z * ((y * x) - (b * c))) - t_4));
} else if (y <= 7.840253637968856e-120) {
tmp_2 = fma(b, t_2, (t_6 - t_3));
} else if (y <= 9.482709923452732e+50) {
tmp_2 = fma(b, t_2, fma(x, ((y * z) - (a * t)), (j * ((c * t) - (y * i)))));
} else if (y <= 7.559661804942138e+112) {
tmp_2 = (t_6 + (i * t_5)) - (t_4 + t_7);
} else {
tmp_2 = t_1;
}
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 | 17.1 |
|---|---|
| Target | 20.1 |
| Herbie | 18.0 |
if y < -6.60809316499797666e234 or 7.5596618049421378e112 < y Initial program 25.4
Simplified22.4
Taylor expanded in y around inf 18.6
if -6.60809316499797666e234 < y < -1.2834941009206854e111Initial program 22.9
Simplified19.8
Taylor expanded in c around 0 17.7
if -1.2834941009206854e111 < y < -7.86356608979789409e-220Initial program 14.0
Simplified12.4
Taylor expanded in b around 0 17.6
Applied associate--r+_binary6417.6
Simplified16.1
Applied associate--r+_binary6416.1
Simplified15.4
if -7.86356608979789409e-220 < y < -4.02745335185258474e-260Initial program 15.9
Simplified14.1
Taylor expanded in i around inf 31.6
Simplified31.6
if -4.02745335185258474e-260 < y < 5.1405007296464449e-265Initial program 10.9
Simplified10.1
Taylor expanded in b around 0 21.1
Applied associate--r+_binary6421.1
Simplified16.8
Taylor expanded in i around 0 25.5
Simplified21.1
if 5.1405007296464449e-265 < y < 7.8402536379688557e-120Initial program 12.5
Simplified11.5
Taylor expanded in x around 0 23.0
if 7.8402536379688557e-120 < y < 9.482709923452732e50Initial program 12.3
Simplified10.9
if 9.482709923452732e50 < y < 7.5596618049421378e112Initial program 20.2
Simplified19.0
Taylor expanded in b around 0 17.5
Applied associate--r+_binary6417.5
Simplified19.4
Taylor expanded in c around inf 24.5
Simplified24.5
Final simplification18.0
herbie shell --seed 2022068
(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)))))