\[\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 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := a \cdot c - y \cdot i\\
t_3 := \left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + j \cdot t_2\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, z, t \cdot \left(-a\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), \mathsf{fma}\left(t_2, j, j \cdot \mathsf{fma}\left(y, -i, y \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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 (* x z)) (* c (* a j))) (* t (- (* b i) (* x a))))
(* c (* z b))))
(t_2 (- (* a c) (* y i)))
(t_3
(+
(- (* b (- (* t i) (* z c))) (* x (- (* t a) (* y z))))
(* j t_2))))
(if (<= t_3 -2e+307)
t_1
(if (<= t_3 1e+300)
(fma
x
(fma y z (* t (- a)))
(fma b (fma z (- c) (* t i)) (fma t_2 j (* j (fma y (- i) (* y i))))))
t_1))))
\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 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := a \cdot c - y \cdot i\\
t_3 := \left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + j \cdot t_2\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, z, t \cdot \left(-a\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), \mathsf{fma}\left(t_2, j, j \cdot \mathsf{fma}\left(y, -i, y \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Error
Target
Original
12.0
Target
19.7
Herbie
4.6
\[\begin{array}{l}
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\]
Derivation
Split input into 2 regimes
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)))) < -1.99999999999999997e307 or 1.0000000000000001e300 < (+.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 59.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)
\]
Simplified59.3
\[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(y, z, a \cdot \left(-t\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), j \cdot \left(a \cdot c - y \cdot i\right)\right)\right)}
\]
Proof
(fma.f64 x (fma.f64 y z (*.f64 a (neg.f64 t))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (fma.f64 y z (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a t)))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (fma.f64 y z (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 t a)))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 y z) (*.f64 t a))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 z (neg.f64 c)) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z c))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 c z))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 c z))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 c a)) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 b (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))): 1 points increase in error, 1 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (+.f64 (neg.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (neg.f64 (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i))))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-neg_binary64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (-.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))): 2 points increase in error, 0 points decrease in error
(Rewrite<= associate-+l-_binary64 (+.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))))): 0 points increase in error, 0 points decrease in error
Taylor expanded in y around 0 49.6
\[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, z, a \cdot \left(-t\right)\right), \color{blue}{b \cdot \left(-1 \cdot \left(c \cdot z\right) + i \cdot t\right) + c \cdot \left(a \cdot j\right)}\right)
\]
if -1.99999999999999997e307 < (+.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)))) < 1.0000000000000001e300
Initial program 0.9
\[\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)
\]
Simplified0.9
\[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(y, z, a \cdot \left(-t\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), j \cdot \left(a \cdot c - y \cdot i\right)\right)\right)}
\]
Proof
(fma.f64 x (fma.f64 y z (*.f64 a (neg.f64 t))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (fma.f64 y z (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a t)))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (fma.f64 y z (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 t a)))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 y z) (*.f64 t a))) (fma.f64 b (fma.f64 z (neg.f64 c) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 z (neg.f64 c)) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 z c))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 c z))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 c z))) (*.f64 t i)) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 a c) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (fma.f64 b (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 c a)) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 b (neg.f64 (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))): 1 points increase in error, 1 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (+.f64 (neg.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (neg.f64 (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))))): 0 points increase in error, 0 points decrease in error
(fma.f64 x (-.f64 (*.f64 y z) (*.f64 t a)) (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i))))))): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-neg_binary64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (-.f64 (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))))): 2 points increase in error, 0 points decrease in error
(Rewrite<= associate-+l-_binary64 (+.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))))): 0 points increase in error, 0 points decrease in error
Applied egg-rr0.8
\[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, z, a \cdot \left(-t\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), \color{blue}{\mathsf{fma}\left(a \cdot c - y \cdot i, j, \mathsf{fma}\left(y, -i, y \cdot i\right) \cdot j\right)}\right)\right)
\]
Recombined 2 regimes into one program.
Final simplification4.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;\left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right) \leq -2 \cdot 10^{+307}:\\
\;\;\;\;\left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
\mathbf{elif}\;\left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right) \leq 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, z, t \cdot \left(-a\right)\right), \mathsf{fma}\left(b, \mathsf{fma}\left(z, -c, t \cdot i\right), \mathsf{fma}\left(a \cdot c - y \cdot i, j, j \cdot \mathsf{fma}\left(y, -i, y \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
\end{array}
\]
Alternatives
Alternative 1
Error
4.6
Cost
19208
\[\begin{array}{l}
t_1 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\\
t_3 := a \cdot c - y \cdot i\\
t_4 := t_2 + j \cdot t_3\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_4 \leq 10^{+300}:\\
\;\;\;\;t_2 + \left(\mathsf{fma}\left(t_3, j, j \cdot \mathsf{fma}\left(y, -i, y \cdot i\right)\right) + j \cdot 0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 2
Error
4.6
Cost
12680
\[\begin{array}{l}
t_1 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\\
t_3 := t_2 + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;t_2 + \left(j \cdot \mathsf{fma}\left(-i, y, y \cdot i\right) - j \cdot \left(y \cdot i - a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3
Error
4.6
Cost
5832
\[\begin{array}{l}
t_1 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\\
t_3 := t_2 + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 10^{+300}:\\
\;\;\;\;t_2 + \left(j \cdot \left(a \cdot c\right) - j \cdot \left(y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4
Error
6.3
Cost
5704
\[\begin{array}{l}
t_1 := t \cdot \left(b \cdot i - x \cdot a\right)\\
t_2 := c \cdot \left(z \cdot b\right)\\
t_3 := j \cdot \left(a \cdot c - y \cdot i\right)\\
t_4 := \left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + t_3\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_3 + \left(t_1 - t_2\right)\\
\mathbf{elif}\;t_4 \leq 10^{+300}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(y \cdot \left(x \cdot z\right) - t_2\right)\\
\end{array}
\]
Alternative 5
Error
4.6
Cost
5704
\[\begin{array}{l}
t_1 := \left(\left(y \cdot \left(x \cdot z\right) + c \cdot \left(a \cdot j\right)\right) + t \cdot \left(b \cdot i - x \cdot a\right)\right) - c \cdot \left(z \cdot b\right)\\
t_2 := \left(b \cdot \left(t \cdot i - z \cdot c\right) - x \cdot \left(t \cdot a - y \cdot z\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 10^{+300}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
herbie shell --seed 2022300
(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)))))