\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 := y \cdot \left(z \cdot x - j \cdot i\right)\\
\mathbf{if}\;y \leq -8.031545841799723 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := i \cdot t - z \cdot c\\
\mathbf{if}\;y \leq -8.684066818048496 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, y \cdot \left(z \cdot x\right) - \left(y \cdot \left(j \cdot i\right) + a \cdot \left(x \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \mathsf{fma}\left(b, t_2, \mathsf{fma}\left(x, y \cdot z - t \cdot a, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\
\mathbf{if}\;y \leq -7.863566089797894 \cdot 10^{-220}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -8.209427578978356 \cdot 10^{-263}:\\
\;\;\;\;\mathsf{fma}\left(b, t_2, -i \cdot \left(y \cdot j\right)\right)\\
\mathbf{elif}\;y \leq 5.98026801756778 \cdot 10^{-307}:\\
\;\;\;\;a \cdot \left(j \cdot c - x \cdot t\right)\\
\mathbf{elif}\;y \leq 1.161862926415618 \cdot 10^{+120}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, b \cdot t, t_1\right)\\
\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) (* t i)))) (* j (- (* c a) (* y i)))))
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* y (- (* z x) (* j i)))))
(if (<= y -8.031545841799723e+206)
t_1
(let* ((t_2 (- (* i t) (* z c))))
(if (<= y -8.684066818048496e+95)
(fma b t_2 (- (* y (* z x)) (+ (* y (* j i)) (* a (* x t)))))
(let* ((t_3
(fma
b
t_2
(fma x (- (* y z) (* t a)) (* j (- (* c a) (* y i)))))))
(if (<= y -7.863566089797894e-220)
t_3
(if (<= y -8.209427578978356e-263)
(fma b t_2 (- (* i (* y j))))
(if (<= y 5.98026801756778e-307)
(* a (- (* j c) (* x t)))
(if (<= y 1.161862926415618e+120)
t_3
(fma i (* b t) 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 = y * ((z * x) - (j * i));
double tmp;
if (y <= -8.031545841799723e+206) {
tmp = t_1;
} else {
double t_2 = (i * t) - (z * c);
double tmp_1;
if (y <= -8.684066818048496e+95) {
tmp_1 = fma(b, t_2, ((y * (z * x)) - ((y * (j * i)) + (a * (x * t)))));
} else {
double t_3 = fma(b, t_2, fma(x, ((y * z) - (t * a)), (j * ((c * a) - (y * i)))));
double tmp_2;
if (y <= -7.863566089797894e-220) {
tmp_2 = t_3;
} else if (y <= -8.209427578978356e-263) {
tmp_2 = fma(b, t_2, -(i * (y * j)));
} else if (y <= 5.98026801756778e-307) {
tmp_2 = a * ((j * c) - (x * t));
} else if (y <= 1.161862926415618e+120) {
tmp_2 = t_3;
} else {
tmp_2 = fma(i, (b * t), 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.5 |
|---|---|
| Target | 26.5 |
| Herbie | 15.8 |
if y < -8.03154584179972283e206Initial program 26.5
Simplified22.4
Taylor expanded in b around 0 23.4
Taylor expanded in y around -inf 14.6
Simplified14.6
if -8.03154584179972283e206 < y < -8.68406681804849587e95Initial program 21.6
Simplified19.4
Taylor expanded in c around 0 17.5
if -8.68406681804849587e95 < y < -7.86356608979789409e-220 or 5.98026801756777983e-307 < y < 1.16186292641561798e120Initial program 14.4
Simplified13.0
if -7.86356608979789409e-220 < y < -8.20942757897835569e-263Initial program 12.7
Simplified11.3
Taylor expanded in i around inf 30.5
Simplified30.5
if -8.20942757897835569e-263 < y < 5.98026801756777983e-307Initial program 14.0
Simplified13.2
Taylor expanded in a around -inf 34.2
if 1.16186292641561798e120 < y Initial program 24.7
Simplified22.1
Taylor expanded in t around inf 22.1
Applied add-cube-cbrt_binary6422.2
Taylor expanded in a around 0 23.0
Simplified18.2
Final simplification15.8
herbie shell --seed 2022068
(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)))))