Average Error: 12.1 → 10.9
Time: 12.3s
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}\;y \leq -2.96095025944021 \cdot 10^{+29}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\ \mathbf{elif}\;y \leq -4.675544654658787 \cdot 10^{-199}:\\ \;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + \left(t \cdot \left(b \cdot i\right) - c \cdot \left(z \cdot b\right)\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;y \leq 2.024234916810656 \cdot 10^{-195}:\\ \;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - j \cdot \left(y \cdot i\right)\right)\\ \mathbf{elif}\;y \leq 4.5158651535268426 \cdot 10^{+105}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(\sqrt[3]{z} \cdot \left(x \cdot \left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\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}\;y \leq -2.96095025944021 \cdot 10^{+29}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\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 (<= y -2.96095025944021e+29)
   (+
    (+ (* x (- (* y z) (* t a))) (* b (- (* t i) (* z c))))
    (- (* a (* c j)) (* y (* i j))))
   (if (<= y -4.675544654658787e-199)
     (+
      (+ (- (* z (* y x)) (* x (* t a))) (- (* t (* b i)) (* c (* z b))))
      (* j (- (* a c) (* y i))))
     (if (<= y 2.024234916810656e-195)
       (+
        (+ (- (* z (* y x)) (* x (* t a))) (* b (- (* t i) (* z c))))
        (- (* a (* c j)) (* j (* y i))))
       (if (<= y 4.5158651535268426e+105)
         (+
          (* j (- (* a c) (* y i)))
          (+
           (- (* (cbrt z) (* x (* y (* (cbrt z) (cbrt z))))) (* x (* t a)))
           (* b (- (* t i) (* z c)))))
         (+
          (+ (* x (- (* y z) (* t a))) (* b (- (* t i) (* z c))))
          (- (* a (* c j)) (* y (* i j)))))))))
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 ((y <= -2.96095025944021e+29)) {
		VAR = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (y * ((double) (i * j))))))));
	} else {
		double VAR_1;
		if ((y <= -4.675544654658787e-199)) {
			VAR_1 = ((double) (((double) (((double) (((double) (z * ((double) (y * x)))) - ((double) (x * ((double) (t * a)))))) + ((double) (((double) (t * ((double) (b * i)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (y * i))))))));
		} else {
			double VAR_2;
			if ((y <= 2.024234916810656e-195)) {
				VAR_2 = ((double) (((double) (((double) (((double) (z * ((double) (y * x)))) - ((double) (x * ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (j * ((double) (y * i))))))));
			} else {
				double VAR_3;
				if ((y <= 4.5158651535268426e+105)) {
					VAR_3 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (((double) cbrt(z)) * ((double) (x * ((double) (y * ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))))))) - ((double) (x * ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
				} else {
					VAR_3 = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (y * ((double) (i * j))))))));
				}
				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.1
Target20.0
Herbie10.9
\[\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 y < -2.96095025944021004e29 or 4.51586515352684256e105 < y

    1. Initial program 19.7

      \[\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-neg19.7

      \[\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-in19.7

      \[\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. Simplified19.9

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

    if -2.96095025944021004e29 < y < -4.67554465465878684e-199

    1. Initial program 8.7

      \[\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-neg8.7

      \[\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-in8.7

      \[\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. Simplified8.7

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

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

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

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

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

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

    if -4.67554465465878684e-199 < y < 2.0242349168106558e-195

    1. Initial program 9.2

      \[\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.2

      \[\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.2

      \[\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. Simplified9.2

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

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

      \[\leadsto \left(\left(\left(x \cdot y\right) \cdot z + x \cdot \left(t \cdot \left(-a\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)}\]
    10. Applied distribute-lft-in9.2

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

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

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

    if 2.0242349168106558e-195 < y < 4.51586515352684256e105

    1. Initial program 9.7

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

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

      \[\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. Simplified9.7

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

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

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

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

      \[\leadsto \left(\left(\color{blue}{\left(x \cdot \left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)\right)} \cdot \sqrt[3]{z} + x \cdot \left(t \cdot \left(-a\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 4 regimes into one program.
  4. Final simplification10.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.96095025944021 \cdot 10^{+29}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\ \mathbf{elif}\;y \leq -4.675544654658787 \cdot 10^{-199}:\\ \;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + \left(t \cdot \left(b \cdot i\right) - c \cdot \left(z \cdot b\right)\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;y \leq 2.024234916810656 \cdot 10^{-195}:\\ \;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - j \cdot \left(y \cdot i\right)\right)\\ \mathbf{elif}\;y \leq 4.5158651535268426 \cdot 10^{+105}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(\sqrt[3]{z} \cdot \left(x \cdot \left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\ \end{array}\]

Reproduce

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