Average Error: 12.5 → 11.2
Time: 11.7s
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)} + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t \cdot \left(i \cdot b\right)\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)} + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t \cdot \left(i \cdot b\right)\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 r891113 = x;
        double r891114 = y;
        double r891115 = z;
        double r891116 = r891114 * r891115;
        double r891117 = t;
        double r891118 = a;
        double r891119 = r891117 * r891118;
        double r891120 = r891116 - r891119;
        double r891121 = r891113 * r891120;
        double r891122 = b;
        double r891123 = c;
        double r891124 = r891123 * r891115;
        double r891125 = i;
        double r891126 = r891117 * r891125;
        double r891127 = r891124 - r891126;
        double r891128 = r891122 * r891127;
        double r891129 = r891121 - r891128;
        double r891130 = j;
        double r891131 = r891123 * r891118;
        double r891132 = r891114 * r891125;
        double r891133 = r891131 - r891132;
        double r891134 = r891130 * r891133;
        double r891135 = r891129 + r891134;
        return r891135;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r891136 = j;
        double r891137 = -3.7660440731317677e-34;
        bool r891138 = r891136 <= r891137;
        double r891139 = x;
        double r891140 = y;
        double r891141 = z;
        double r891142 = r891140 * r891141;
        double r891143 = t;
        double r891144 = a;
        double r891145 = r891143 * r891144;
        double r891146 = r891142 - r891145;
        double r891147 = r891139 * r891146;
        double r891148 = b;
        double r891149 = c;
        double r891150 = r891148 * r891149;
        double r891151 = r891141 * r891150;
        double r891152 = cbrt(r891151);
        double r891153 = r891152 * r891152;
        double r891154 = r891153 * r891152;
        double r891155 = i;
        double r891156 = r891155 * r891148;
        double r891157 = r891143 * r891156;
        double r891158 = -r891157;
        double r891159 = r891154 + r891158;
        double r891160 = r891147 - r891159;
        double r891161 = r891149 * r891144;
        double r891162 = r891140 * r891155;
        double r891163 = r891161 - r891162;
        double r891164 = r891136 * r891163;
        double r891165 = r891160 + r891164;
        double r891166 = 7.799104644321854e-10;
        bool r891167 = r891136 <= r891166;
        double r891168 = r891141 * r891148;
        double r891169 = r891168 * r891149;
        double r891170 = r891169 + r891158;
        double r891171 = r891147 - r891170;
        double r891172 = r891136 * r891149;
        double r891173 = r891144 * r891172;
        double r891174 = -r891162;
        double r891175 = r891136 * r891174;
        double r891176 = r891173 + r891175;
        double r891177 = r891171 + r891176;
        double r891178 = r891139 * r891142;
        double r891179 = r891139 * r891143;
        double r891180 = r891144 * r891179;
        double r891181 = -r891180;
        double r891182 = r891178 + r891181;
        double r891183 = r891182 - r891170;
        double r891184 = r891183 + r891164;
        double r891185 = r891167 ? r891177 : r891184;
        double r891186 = r891138 ? r891165 : r891185;
        return r891186;
}

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-lft-neg-out8.1

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-\color{blue}{t \cdot \left(i \cdot b\right)}\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)}} + \left(-t \cdot \left(i \cdot b\right)\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-lft-neg-out16.9

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-\color{blue}{t \cdot \left(i \cdot b\right)}\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} + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\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-lft-neg-out7.7

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-\color{blue}{t \cdot \left(i \cdot b\right)}\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} + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    15. Simplified9.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z\right) + \color{blue}{\left(-a \cdot \left(x \cdot t\right)\right)}\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t \cdot \left(i \cdot b\right)\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)} + \left(-t \cdot \left(i \cdot b\right)\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 + \left(-t \cdot \left(i \cdot b\right)\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Reproduce

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