Average Error: 12.1 → 9.4
Time: 10.5s
Precision: binary64
\[\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}\;i \le -3.62476977029911861 \cdot 10^{-134} \lor \neg \left(i \le 2.419900472875752 \cdot 10^{63}\right):\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(i \cdot \left(t \cdot b\right) - c \cdot \left(z \cdot b\right)\right)\right) + \left(c \cdot \left(a \cdot j\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(i \cdot t - z \cdot c\right)\right) + j \cdot \left(a \cdot c - i \cdot y\right)\\ \end{array}\]
\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}\;i \le -3.62476977029911861 \cdot 10^{-134} \lor \neg \left(i \le 2.419900472875752 \cdot 10^{63}\right):\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(i \cdot \left(t \cdot b\right) - c \cdot \left(z \cdot b\right)\right)\right) + \left(c \cdot \left(a \cdot j\right) - i \cdot \left(y \cdot j\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(i \cdot t - z \cdot c\right)\right) + j \cdot \left(a \cdot c - i \cdot y\right)\\

\end{array}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (j * ((double) (((double) (c * a)) - ((double) (y * i))))))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	double VAR;
	if (((i <= -3.6247697702991186e-134) || !(i <= 2.419900472875752e+63))) {
		VAR = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (((double) (i * ((double) (t * b)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (((double) (c * ((double) (a * j)))) - ((double) (i * ((double) (y * j))))))));
	} else {
		VAR = ((double) (((double) (((double) (((double) (z * ((double) (x * y)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (i * t)) - ((double) (z * c)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (i * y))))))));
	}
	return VAR;
}

Error

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original12.1
Target20.1
Herbie9.4
\[\begin{array}{l} \mathbf{if}\;x \lt -1.46969429677770502 \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 \lt 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

  1. Split input into 2 regimes
  2. if i < -3.62476977029911861e-134 or 2.419900472875752e63 < i

    1. Initial program 15.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)\]
    2. Using strategy rm
    3. Applied sub-neg15.3

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \color{blue}{\left(c \cdot a + \left(-y \cdot i\right)\right)}\]
    4. Applied distribute-lft-in15.3

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \color{blue}{\left(j \cdot \left(c \cdot a\right) + j \cdot \left(-y \cdot i\right)\right)}\]
    5. Simplified15.7

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\color{blue}{c \cdot \left(j \cdot a\right)} + j \cdot \left(-y \cdot i\right)\right)\]
    6. Simplified12.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(c \cdot \left(j \cdot a\right) + \color{blue}{i \cdot \left(j \cdot \left(-y\right)\right)}\right)\]
    7. Using strategy rm
    8. Applied sub-neg12.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}\right) + \left(c \cdot \left(j \cdot a\right) + i \cdot \left(j \cdot \left(-y\right)\right)\right)\]
    9. Applied distribute-lft-in12.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-t \cdot i\right)\right)}\right) + \left(c \cdot \left(j \cdot a\right) + i \cdot \left(j \cdot \left(-y\right)\right)\right)\]
    10. Simplified12.4

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{c \cdot \left(b \cdot z\right)} + b \cdot \left(-t \cdot i\right)\right)\right) + \left(c \cdot \left(j \cdot a\right) + i \cdot \left(j \cdot \left(-y\right)\right)\right)\]
    11. Simplified9.0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(c \cdot \left(b \cdot z\right) + \color{blue}{i \cdot \left(b \cdot \left(-t\right)\right)}\right)\right) + \left(c \cdot \left(j \cdot a\right) + i \cdot \left(j \cdot \left(-y\right)\right)\right)\]

    if -3.62476977029911861e-134 < i < 2.419900472875752e63

    1. Initial program 9.4

      \[\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)\]
    2. Using strategy rm
    3. Applied sub-neg9.4

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-t \cdot a\right)\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied distribute-lft-in9.4

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\right)\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified10.3

      \[\leadsto \left(\left(\color{blue}{z \cdot \left(y \cdot x\right)} + x \cdot \left(-t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    6. Simplified9.7

      \[\leadsto \left(\left(z \cdot \left(y \cdot x\right) + \color{blue}{t \cdot \left(a \cdot \left(-x\right)\right)}\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le -3.62476977029911861 \cdot 10^{-134} \lor \neg \left(i \le 2.419900472875752 \cdot 10^{63}\right):\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(i \cdot \left(t \cdot b\right) - c \cdot \left(z \cdot b\right)\right)\right) + \left(c \cdot \left(a \cdot j\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(i \cdot t - z \cdot c\right)\right) + j \cdot \left(a \cdot c - i \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020185 
(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)))))