Average Error: 12.3 → 9.5
Time: 12.8s
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}\;j \leq -88796694.52684127:\\ \;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(z \cdot y - t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;j \leq -1.3978181088597517 \cdot 10^{-204}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\ \mathbf{elif}\;j \leq 5.597537063294022 \cdot 10^{-214}:\\ \;\;\;\;\left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right) + \left(x \cdot \left(z \cdot y - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\ \mathbf{elif}\;j \leq 9.665936002114873 \cdot 10^{-13}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt[3]{x \cdot \left(z \cdot y - t \cdot a\right)} \cdot \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) + b \cdot \left(t \cdot i - z \cdot c\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}\;j \leq -88796694.52684127:\\
\;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(z \cdot y - t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\

\mathbf{elif}\;j \leq -1.3978181088597517 \cdot 10^{-204}:\\
\;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\

\mathbf{elif}\;j \leq 5.597537063294022 \cdot 10^{-214}:\\
\;\;\;\;\left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right) + \left(x \cdot \left(z \cdot y - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\

\mathbf{elif}\;j \leq 9.665936002114873 \cdot 10^{-13}:\\
\;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt[3]{x \cdot \left(z \cdot y - t \cdot a\right)} \cdot \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) + b \cdot \left(t \cdot i - z \cdot c\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 (<= j -88796694.52684127)
   (+
    (+
     (* (* (cbrt x) (cbrt x)) (* (cbrt x) (- (* z y) (* t a))))
     (* b (- (* t i) (* z c))))
    (* j (- (* a c) (* y i))))
   (if (<= j -1.3978181088597517e-204)
     (+
      (+ (- (* z (* x y)) (* t (* x a))) (* b (- (* t i) (* z c))))
      (- (* c (* j a)) (* i (* j y))))
     (if (<= j 5.597537063294022e-214)
       (+
        (- (* c (* j a)) (* i (* j y)))
        (+ (* x (- (* z y) (* t a))) (* b (- (* t i) (* z c)))))
       (if (<= j 9.665936002114873e-13)
         (+
          (+ (- (* z (* x y)) (* t (* x a))) (* b (- (* t i) (* z c))))
          (- (* c (* j a)) (* i (* j y))))
         (+
          (* j (- (* a c) (* y i)))
          (+
           (*
            (cbrt (* x (- (* z y) (* t a))))
            (*
             (cbrt (* x (- (* z y) (* t a))))
             (cbrt (* x (- (* z y) (* t a))))))
           (* b (- (* t i) (* z c))))))))))
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 tmp;
	if ((j <= -88796694.52684127)) {
		tmp = ((double) (((double) (((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (((double) cbrt(x)) * ((double) (((double) (z * y)) - ((double) (t * a)))))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (y * i))))))));
	} else {
		double tmp_1;
		if ((j <= -1.3978181088597517e-204)) {
			tmp_1 = ((double) (((double) (((double) (((double) (z * ((double) (x * y)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (c * ((double) (j * a)))) - ((double) (i * ((double) (j * y))))))));
		} else {
			double tmp_2;
			if ((j <= 5.597537063294022e-214)) {
				tmp_2 = ((double) (((double) (((double) (c * ((double) (j * a)))) - ((double) (i * ((double) (j * y)))))) + ((double) (((double) (x * ((double) (((double) (z * y)) - ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
			} else {
				double tmp_3;
				if ((j <= 9.665936002114873e-13)) {
					tmp_3 = ((double) (((double) (((double) (((double) (z * ((double) (x * y)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (c * ((double) (j * a)))) - ((double) (i * ((double) (j * y))))))));
				} else {
					tmp_3 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) cbrt(((double) (x * ((double) (((double) (z * y)) - ((double) (t * a)))))))) * ((double) (((double) cbrt(((double) (x * ((double) (((double) (z * y)) - ((double) (t * a)))))))) * ((double) cbrt(((double) (x * ((double) (((double) (z * y)) - ((double) (t * a)))))))))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
				}
				tmp_2 = tmp_3;
			}
			tmp_1 = tmp_2;
		}
		tmp = tmp_1;
	}
	return tmp;
}

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
Target20.3
Herbie9.5
\[\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

  1. Split input into 4 regimes
  2. if j < -88796694.5268412679

    1. Initial program Error: 8.0 bits

      \[\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 add-cube-cbrtError: 8.2 bits

      \[\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) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied associate-*l*Error: 8.2 bits

      \[\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) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. SimplifiedError: 8.2 bits

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

    if -88796694.5268412679 < j < -1.3978181088597517e-204 or 5.5975370632940221e-214 < j < 9.66593600211487305e-13

    1. Initial program Error: 14.4 bits

      \[\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-negError: 14.4 bits

      \[\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-inError: 14.4 bits

      \[\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. SimplifiedError: 14.7 bits

      \[\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. SimplifiedError: 14.9 bits

      \[\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)\]
    7. Using strategy rm
    8. Applied sub-negError: 14.9 bits

      \[\leadsto \left(\left(z \cdot \left(y \cdot x\right) + t \cdot \left(a \cdot \left(-x\right)\right)\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)}\]
    9. Applied distribute-lft-inError: 14.9 bits

      \[\leadsto \left(\left(z \cdot \left(y \cdot x\right) + t \cdot \left(a \cdot \left(-x\right)\right)\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)}\]
    10. SimplifiedError: 12.7 bits

      \[\leadsto \left(\left(z \cdot \left(y \cdot x\right) + t \cdot \left(a \cdot \left(-x\right)\right)\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)\]
    11. SimplifiedError: 10.6 bits

      \[\leadsto \left(\left(z \cdot \left(y \cdot x\right) + t \cdot \left(a \cdot \left(-x\right)\right)\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)\]

    if -1.3978181088597517e-204 < j < 5.5975370632940221e-214

    1. Initial program Error: 16.9 bits

      \[\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-negError: 16.9 bits

      \[\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-inError: 16.9 bits

      \[\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. SimplifiedError: 13.8 bits

      \[\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. SimplifiedError: 10.1 bits

      \[\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)\]

    if 9.66593600211487305e-13 < j

    1. Initial program Error: 7.6 bits

      \[\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 add-cube-cbrtError: 7.8 bits

      \[\leadsto \left(\color{blue}{\left(\sqrt[3]{x \cdot \left(y \cdot z - t \cdot a\right)} \cdot \sqrt[3]{x \cdot \left(y \cdot z - t \cdot a\right)}\right) \cdot \sqrt[3]{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)\]
    4. SimplifiedError: 7.8 bits

      \[\leadsto \left(\color{blue}{\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 \sqrt[3]{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)\]
    5. SimplifiedError: 7.8 bits

      \[\leadsto \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 \color{blue}{\sqrt[3]{x \cdot \left(z \cdot y - 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)\]
  3. Recombined 4 regimes into one program.
  4. Final simplificationError: 9.5 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \leq -88796694.52684127:\\ \;\;\;\;\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(z \cdot y - t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;j \leq -1.3978181088597517 \cdot 10^{-204}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\ \mathbf{elif}\;j \leq 5.597537063294022 \cdot 10^{-214}:\\ \;\;\;\;\left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right) + \left(x \cdot \left(z \cdot y - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\ \mathbf{elif}\;j \leq 9.665936002114873 \cdot 10^{-13}:\\ \;\;\;\;\left(\left(z \cdot \left(x \cdot y\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(c \cdot \left(j \cdot a\right) - i \cdot \left(j \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt[3]{x \cdot \left(z \cdot y - t \cdot a\right)} \cdot \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) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\ \end{array}\]

Reproduce

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