Average Error: 12.4 → 12.5
Time: 11.6s
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}\;x \leq -3.944679319975896 \cdot 10^{-259}:\\ \;\;\;\;\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 \left(\sqrt[3]{x} \cdot \sqrt[3]{z \cdot y - t \cdot a}\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;x \leq 1.133812787451328 \cdot 10^{-275}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) - b \cdot \left(z \cdot c - t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt{x} \cdot \left(\left(z \cdot y - t \cdot a\right) \cdot \sqrt{x}\right) - b \cdot \left(z \cdot c - t \cdot i\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}\;x \leq -3.944679319975896 \cdot 10^{-259}:\\
\;\;\;\;\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 \left(\sqrt[3]{x} \cdot \sqrt[3]{z \cdot y - t \cdot a}\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\

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

\mathbf{else}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\sqrt{x} \cdot \left(\left(z \cdot y - t \cdot a\right) \cdot \sqrt{x}\right) - b \cdot \left(z \cdot c - t \cdot i\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 (<= x -3.944679319975896e-259)
   (+
    (-
     (*
      (* (cbrt (* x (- (* z y) (* t a)))) (cbrt (* x (- (* z y) (* t a)))))
      (* (cbrt x) (cbrt (- (* z y) (* t a)))))
     (* b (- (* z c) (* t i))))
    (* j (- (* a c) (* y i))))
   (if (<= x 1.133812787451328e-275)
     (- (* j (- (* a c) (* y i))) (* b (- (* z c) (* t i))))
     (+
      (* j (- (* a c) (* y i)))
      (-
       (* (sqrt x) (* (- (* z y) (* t a)) (sqrt x)))
       (* b (- (* z c) (* t i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
	return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (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 (x <= -3.944679319975896e-259) {
		tmp = (((cbrt(x * ((z * y) - (t * a))) * cbrt(x * ((z * y) - (t * a)))) * (cbrt(x) * cbrt((z * y) - (t * a)))) - (b * ((z * c) - (t * i)))) + (j * ((a * c) - (y * i)));
	} else if (x <= 1.133812787451328e-275) {
		tmp = (j * ((a * c) - (y * i))) - (b * ((z * c) - (t * i)));
	} else {
		tmp = (j * ((a * c) - (y * i))) + ((sqrt(x) * (((z * y) - (t * a)) * sqrt(x))) - (b * ((z * c) - (t * i))));
	}
	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.4
Target19.0
Herbie12.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 3 regimes
  2. if x < -3.94467931997589593e-259

    1. Initial program 11.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 add-cube-cbrt_binary6412.0

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

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

      \[\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)\]
    6. Using strategy rm
    7. Applied cbrt-prod_binary6412.0

      \[\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}{\left(\sqrt[3]{x} \cdot \sqrt[3]{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)\]

    if -3.94467931997589593e-259 < x < 1.133812787451328e-275

    1. Initial program 18.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. Taylor expanded around 0 16.4

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

    if 1.133812787451328e-275 < x

    1. Initial program 12.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. Using strategy rm
    3. Applied add-sqr-sqrt_binary6412.2

      \[\leadsto \left(\color{blue}{\left(\sqrt{x} \cdot \sqrt{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*_binary6412.2

      \[\leadsto \left(\color{blue}{\sqrt{x} \cdot \left(\sqrt{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. Simplified12.2

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

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

Reproduce

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