Average Error: 12.3 → 12.6
Time: 9.0s
Precision: 64
\[\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}\;a \le -4.11321520749969792 \cdot 10^{-78}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;a \le -2.24542925777398594 \cdot 10^{-268}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + \left(j \cdot \left(-y \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right) \cdot \sqrt[3]{i}\right)\\ \mathbf{elif}\;a \le 4.0322180842223631 \cdot 10^{-134}:\\ \;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\\ \mathbf{elif}\;a \le 3.6283701980148593 \cdot 10^{-82}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - 0\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\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}\;a \le -4.11321520749969792 \cdot 10^{-78}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\right)\\

\mathbf{elif}\;a \le -2.24542925777398594 \cdot 10^{-268}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + \left(j \cdot \left(-y \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right) \cdot \sqrt[3]{i}\right)\\

\mathbf{elif}\;a \le 4.0322180842223631 \cdot 10^{-134}:\\
\;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\\

\mathbf{elif}\;a \le 3.6283701980148593 \cdot 10^{-82}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - 0\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\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 ((a <= -4.113215207499698e-78)) {
		VAR = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (((double) (((double) (c * j)) * a)) + ((double) (((double) (y * 1.0)) * ((double) (j * ((double) -(i))))))))));
	} else {
		double VAR_1;
		if ((a <= -2.245429257773986e-268)) {
			VAR_1 = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (((double) (j * ((double) (c * a)))) + ((double) (((double) (j * ((double) -(((double) (y * ((double) (((double) cbrt(i)) * ((double) cbrt(i)))))))))) * ((double) cbrt(i))))))));
		} else {
			double VAR_2;
			if ((a <= 4.032218084222363e-134)) {
				VAR_2 = ((double) (((double) (((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (((double) cbrt(x)) * ((double) (((double) (y * z)) - ((double) (t * a)))))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (((double) (((double) (c * j)) * a)) + ((double) (((double) (y * j)) * ((double) -(i))))))));
			} else {
				double VAR_3;
				if ((a <= 3.6283701980148593e-82)) {
					VAR_3 = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - 0.0)) + ((double) (j * ((double) (((double) (c * a)) - ((double) (y * i))))))));
				} else {
					VAR_3 = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (((double) (((double) (c * j)) * a)) + ((double) (((double) (y * 1.0)) * ((double) (j * ((double) -(i))))))))));
				}
				VAR_2 = VAR_3;
			}
			VAR_1 = VAR_2;
		}
		VAR = VAR_1;
	}
	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.3
Target19.5
Herbie12.6
\[\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 4 regimes
  2. if a < -4.113215207499698e-78 or 3.6283701980148593e-82 < a

    1. Initial program 14.5

      \[\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-neg14.5

      \[\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-in14.5

      \[\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. Using strategy rm
    6. Applied distribute-rgt-neg-in14.5

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + j \cdot \color{blue}{\left(y \cdot \left(-i\right)\right)}\right)\]
    7. Applied associate-*r*14.3

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + \color{blue}{\left(y \cdot j\right)} \cdot \left(-i\right)\right)\]
    9. Using strategy rm
    10. Applied associate-*r*11.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}{\left(j \cdot c\right) \cdot a} + \left(y \cdot j\right) \cdot \left(-i\right)\right)\]
    11. Simplified11.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}{\left(c \cdot j\right)} \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\]
    12. Using strategy rm
    13. Applied *-un-lft-identity11.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(\left(c \cdot j\right) \cdot a + \left(y \cdot \color{blue}{\left(1 \cdot j\right)}\right) \cdot \left(-i\right)\right)\]
    14. Applied associate-*r*11.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(\left(c \cdot j\right) \cdot a + \color{blue}{\left(\left(y \cdot 1\right) \cdot j\right)} \cdot \left(-i\right)\right)\]
    15. Applied associate-*l*11.8

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

    if -4.113215207499698e-78 < a < -2.245429257773986e-268

    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 \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-in9.4

      \[\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. Using strategy rm
    6. Applied add-cube-cbrt9.5

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + j \cdot \left(-y \cdot \color{blue}{\left(\left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right) \cdot \sqrt[3]{i}\right)}\right)\right)\]
    7. Applied associate-*r*9.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(j \cdot \left(c \cdot a\right) + j \cdot \left(-\color{blue}{\left(y \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right) \cdot \sqrt[3]{i}}\right)\right)\]
    8. Applied distribute-lft-neg-in9.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(j \cdot \left(c \cdot a\right) + j \cdot \color{blue}{\left(\left(-y \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right) \cdot \sqrt[3]{i}\right)}\right)\]
    9. Applied associate-*r*9.1

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

    if -2.245429257773986e-268 < a < 4.032218084222363e-134

    1. Initial program 10.5

      \[\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-neg10.5

      \[\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-in10.5

      \[\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. Using strategy rm
    6. Applied distribute-rgt-neg-in10.5

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + j \cdot \color{blue}{\left(y \cdot \left(-i\right)\right)}\right)\]
    7. Applied associate-*r*11.1

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + \color{blue}{\left(y \cdot j\right)} \cdot \left(-i\right)\right)\]
    9. Using strategy rm
    10. Applied associate-*r*14.4

      \[\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}{\left(j \cdot c\right) \cdot a} + \left(y \cdot j\right) \cdot \left(-i\right)\right)\]
    11. Simplified14.4

      \[\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}{\left(c \cdot j\right)} \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\]
    12. Using strategy rm
    13. Applied add-cube-cbrt14.6

      \[\leadsto \left(\color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\]
    14. Applied associate-*l*14.6

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

    if 4.032218084222363e-134 < a < 3.6283701980148593e-82

    1. Initial program 8.5

      \[\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. Taylor expanded around 0 26.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -4.11321520749969792 \cdot 10^{-78}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;a \le -2.24542925777398594 \cdot 10^{-268}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \left(c \cdot a\right) + \left(j \cdot \left(-y \cdot \left(\sqrt[3]{i} \cdot \sqrt[3]{i}\right)\right)\right) \cdot \sqrt[3]{i}\right)\\ \mathbf{elif}\;a \le 4.0322180842223631 \cdot 10^{-134}:\\ \;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot j\right) \cdot \left(-i\right)\right)\\ \mathbf{elif}\;a \le 3.6283701980148593 \cdot 10^{-82}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - 0\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\left(c \cdot j\right) \cdot a + \left(y \cdot 1\right) \cdot \left(j \cdot \left(-i\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020114 
(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) (pow (* t i) 2))) (+ (* 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) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))