Average Error: 12.0 → 12.8
Time: 16.8s
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}\;j \le -1.38624531694325238 \cdot 10^{-235}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\left(\sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\\ \mathbf{elif}\;j \le -7.6804468221105565 \cdot 10^{-296}:\\ \;\;\;\;\mathsf{fma}\left(t, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, t \cdot \left(x \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}} \cdot \sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i}}\right)\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\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 \le -1.38624531694325238 \cdot 10^{-235}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\left(\sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\\

\mathbf{elif}\;j \le -7.6804468221105565 \cdot 10^{-296}:\\
\;\;\;\;\mathsf{fma}\left(t, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, t \cdot \left(x \cdot a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}} \cdot \sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i}}\right)\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\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 ((j <= -1.3862453169432524e-235)) {
		VAR = ((double) fma(((double) (((double) (c * a)) - ((double) (y * i)))), j, ((double) (((double) (((double) (x * ((double) (((double) (((double) cbrt(((double) (((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))))) * ((double) cbrt(((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))) - ((double) (b * ((double) fma(((double) (c * 1.0)), z, ((double) -(((double) (i * t))))))))))));
	} else {
		double VAR_1;
		if ((j <= -7.680446822110556e-296)) {
			VAR_1 = ((double) fma(t, ((double) (i * b)), ((double) -(((double) fma(z, ((double) (b * c)), ((double) (t * ((double) (x * a))))))))));
		} else {
			VAR_1 = ((double) fma(((double) (((double) (((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))) * ((double) (((double) cbrt(((double) (((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))) * ((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))))) * ((double) cbrt(((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))))))) * ((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))), j, ((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) fma(((double) (c * 1.0)), z, ((double) -(((double) (i * t))))))))))));
		}
		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.0
Target20.2
Herbie12.8
\[\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 3 regimes
  2. if j < -1.3862453169432524e-235

    1. Initial program 11.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)\]
    2. Simplified11.1

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity11.1

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

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{\left(c \cdot 1\right) \cdot z} - t \cdot i\right)\right)\]
    6. Applied fma-neg11.1

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

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, \color{blue}{-i \cdot t}\right)\right)\]
    8. Using strategy rm
    9. Applied add-cube-cbrt11.4

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

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \color{blue}{\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\]
    11. Using strategy rm
    12. Applied add-cube-cbrt11.4

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}}} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\]
    13. Applied cbrt-prod11.4

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

    if -1.3862453169432524e-235 < j < -7.680446822110556e-296

    1. Initial program 17.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. Simplified17.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)}\]
    3. Taylor expanded around inf 25.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, t \cdot \left(x \cdot a\right)\right)\right)}\]

    if -7.680446822110556e-296 < j

    1. Initial program 12.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity12.0

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot \color{blue}{\left(1 \cdot z\right)} - t \cdot i\right)\right)\]
    5. Applied associate-*r*12.0

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\color{blue}{\left(c \cdot 1\right) \cdot z} - t \cdot i\right)\right)\]
    6. Applied fma-neg12.0

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\mathsf{fma}\left(c \cdot 1, z, -t \cdot i\right)}\right)\]
    7. Simplified12.0

      \[\leadsto \mathsf{fma}\left(c \cdot a - y \cdot i, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, \color{blue}{-i \cdot t}\right)\right)\]
    8. Using strategy rm
    9. Applied add-cube-cbrt12.3

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\]
    10. Using strategy rm
    11. Applied add-cube-cbrt12.3

      \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}}}\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\]
    12. Applied cbrt-prod12.3

      \[\leadsto \mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \color{blue}{\left(\sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}} \cdot \sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i}}\right)}\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification12.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -1.38624531694325238 \cdot 10^{-235}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\left(\sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\\ \mathbf{elif}\;j \le -7.6804468221105565 \cdot 10^{-296}:\\ \;\;\;\;\mathsf{fma}\left(t, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, t \cdot \left(x \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}} \cdot \sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i}}\right)\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020113 +o rules:numerics
(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)))))