Average Error: 12.5 → 11.2
Time: 13.2s
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 -3.7660440731317677 \cdot 10^{-34}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;j \le 7.79910464432185437 \cdot 10^{-10}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 -3.7660440731317677 \cdot 10^{-34}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r968099 = x;
        double r968100 = y;
        double r968101 = z;
        double r968102 = r968100 * r968101;
        double r968103 = t;
        double r968104 = a;
        double r968105 = r968103 * r968104;
        double r968106 = r968102 - r968105;
        double r968107 = r968099 * r968106;
        double r968108 = b;
        double r968109 = c;
        double r968110 = r968109 * r968101;
        double r968111 = i;
        double r968112 = r968103 * r968111;
        double r968113 = r968110 - r968112;
        double r968114 = r968108 * r968113;
        double r968115 = r968107 - r968114;
        double r968116 = j;
        double r968117 = r968109 * r968104;
        double r968118 = r968100 * r968111;
        double r968119 = r968117 - r968118;
        double r968120 = r968116 * r968119;
        double r968121 = r968115 + r968120;
        return r968121;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r968122 = j;
        double r968123 = -3.7660440731317677e-34;
        bool r968124 = r968122 <= r968123;
        double r968125 = x;
        double r968126 = y;
        double r968127 = z;
        double r968128 = r968126 * r968127;
        double r968129 = t;
        double r968130 = a;
        double r968131 = r968129 * r968130;
        double r968132 = r968128 - r968131;
        double r968133 = r968125 * r968132;
        double r968134 = b;
        double r968135 = c;
        double r968136 = r968134 * r968135;
        double r968137 = r968127 * r968136;
        double r968138 = cbrt(r968137);
        double r968139 = r968138 * r968138;
        double r968140 = r968139 * r968138;
        double r968141 = i;
        double r968142 = -r968141;
        double r968143 = r968142 * r968134;
        double r968144 = r968129 * r968143;
        double r968145 = r968140 + r968144;
        double r968146 = r968133 - r968145;
        double r968147 = r968135 * r968130;
        double r968148 = r968126 * r968141;
        double r968149 = r968147 - r968148;
        double r968150 = r968122 * r968149;
        double r968151 = r968146 + r968150;
        double r968152 = 7.799104644321854e-10;
        bool r968153 = r968122 <= r968152;
        double r968154 = r968127 * r968134;
        double r968155 = r968154 * r968135;
        double r968156 = r968155 + r968144;
        double r968157 = r968133 - r968156;
        double r968158 = r968122 * r968135;
        double r968159 = r968130 * r968158;
        double r968160 = -r968148;
        double r968161 = r968122 * r968160;
        double r968162 = r968159 + r968161;
        double r968163 = r968157 + r968162;
        double r968164 = r968128 * r968125;
        double r968165 = r968125 * r968129;
        double r968166 = r968130 * r968165;
        double r968167 = -r968166;
        double r968168 = r968164 + r968167;
        double r968169 = r968168 - r968156;
        double r968170 = r968169 + r968150;
        double r968171 = r968153 ? r968163 : r968170;
        double r968172 = r968124 ? r968151 : r968171;
        return r968172;
}

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.5
Target20.3
Herbie11.2
\[\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 < -3.7660440731317677e-34

    1. Initial program 7.9

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\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)\]
    4. Applied distribute-lft-in7.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\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)\]
    5. Simplified8.1

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t \cdot i\right) \cdot b}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Using strategy rm
    8. Applied distribute-rgt-neg-in8.1

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{t \cdot \left(\left(-i\right) \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied add-cube-cbrt8.0

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

    if -3.7660440731317677e-34 < j < 7.799104644321854e-10

    1. Initial program 16.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-neg16.2

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\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)\]
    4. Applied distribute-lft-in16.2

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\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)\]
    5. Simplified16.9

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

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

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

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

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

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

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

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

    if 7.799104644321854e-10 < j

    1. Initial program 7.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-neg7.4

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\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)\]
    4. Applied distribute-lft-in7.4

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t \cdot i\right) \cdot b}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Using strategy rm
    8. Applied distribute-rgt-neg-in7.7

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -3.7660440731317677 \cdot 10^{-34}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;j \le 7.79910464432185437 \cdot 10^{-10}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + t \cdot \left(\left(-i\right) \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Reproduce

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