\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}
\mathbf{if}\;x \leq -3.944679319975896 \cdot 10^{-259}:\\
\;\;\;\;\left(\left(\sqrt[3]{x \cdot \left(z \cdot y - t \cdot a\right)} \cdot \sqrt[3]{x \cdot \left(z \cdot y - t \cdot a\right)}\right) \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{z \cdot y - t \cdot a}\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{elif}\;x \leq 1.133812787451328 \cdot 10^{-275}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) - b \cdot \left(z \cdot c - t \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt{x} \cdot \left(\left(z \cdot y - t \cdot a\right) \cdot \sqrt{x}\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right)\\
\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
(if (<= x -3.944679319975896e-259)
(+
(-
(*
(* (cbrt (* x (- (* z y) (* t a)))) (cbrt (* x (- (* z y) (* t a)))))
(* (cbrt x) (cbrt (- (* z y) (* t a)))))
(* b (- (* z c) (* t i))))
(* j (- (* a c) (* y i))))
(if (<= x 1.133812787451328e-275)
(- (* j (- (* a c) (* y i))) (* b (- (* z c) (* t i))))
(+
(* j (- (* a c) (* y i)))
(-
(* (sqrt x) (* (- (* z y) (* t a)) (sqrt x)))
(* b (- (* z c) (* t i))))))))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 tmp;
if (x <= -3.944679319975896e-259) {
tmp = (((cbrt(x * ((z * y) - (t * a))) * cbrt(x * ((z * y) - (t * a)))) * (cbrt(x) * cbrt((z * y) - (t * a)))) - (b * ((z * c) - (t * i)))) + (j * ((a * c) - (y * i)));
} else if (x <= 1.133812787451328e-275) {
tmp = (j * ((a * c) - (y * i))) - (b * ((z * c) - (t * i)));
} else {
tmp = (j * ((a * c) - (y * i))) + ((sqrt(x) * (((z * y) - (t * a)) * sqrt(x))) - (b * ((z * c) - (t * i))));
}
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
Results
| Original | 12.4 |
|---|---|
| Target | 19.0 |
| Herbie | 12.5 |
if x < -3.94467931997589593e-259Initial program 11.7
rmApplied add-cube-cbrt_binary6412.0
Simplified12.0
Simplified12.0
rmApplied cbrt-prod_binary6412.0
if -3.94467931997589593e-259 < x < 1.133812787451328e-275Initial program 18.0
Taylor expanded around 0 16.4
if 1.133812787451328e-275 < x Initial program 12.1
rmApplied add-sqr-sqrt_binary6412.2
Applied associate-*l*_binary6412.2
Simplified12.2
Final simplification12.5
herbie shell --seed 2020231
(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)))))