Average Error: 12.4 → 12.7
Time: 22.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.624488299352208951075763961989130211651 \cdot 10^{-261} \lor \neg \left(j \le 4.542952957314723515911650362791300642265 \cdot 10^{-99}\right):\\ \;\;\;\;j \cdot \left(c \cdot a - y \cdot i\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \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 -1.624488299352208951075763961989130211651 \cdot 10^{-261} \lor \neg \left(j \le 4.542952957314723515911650362791300642265 \cdot 10^{-99}\right):\\
\;\;\;\;j \cdot \left(c \cdot a - y \cdot i\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \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 r575135 = x;
        double r575136 = y;
        double r575137 = z;
        double r575138 = r575136 * r575137;
        double r575139 = t;
        double r575140 = a;
        double r575141 = r575139 * r575140;
        double r575142 = r575138 - r575141;
        double r575143 = r575135 * r575142;
        double r575144 = b;
        double r575145 = c;
        double r575146 = r575145 * r575137;
        double r575147 = i;
        double r575148 = r575139 * r575147;
        double r575149 = r575146 - r575148;
        double r575150 = r575144 * r575149;
        double r575151 = r575143 - r575150;
        double r575152 = j;
        double r575153 = r575145 * r575140;
        double r575154 = r575136 * r575147;
        double r575155 = r575153 - r575154;
        double r575156 = r575152 * r575155;
        double r575157 = r575151 + r575156;
        return r575157;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r575158 = j;
        double r575159 = -1.624488299352209e-261;
        bool r575160 = r575158 <= r575159;
        double r575161 = 4.5429529573147235e-99;
        bool r575162 = r575158 <= r575161;
        double r575163 = !r575162;
        bool r575164 = r575160 || r575163;
        double r575165 = c;
        double r575166 = a;
        double r575167 = r575165 * r575166;
        double r575168 = y;
        double r575169 = i;
        double r575170 = r575168 * r575169;
        double r575171 = r575167 - r575170;
        double r575172 = r575158 * r575171;
        double r575173 = x;
        double r575174 = z;
        double r575175 = r575168 * r575174;
        double r575176 = t;
        double r575177 = r575176 * r575166;
        double r575178 = r575175 - r575177;
        double r575179 = r575173 * r575178;
        double r575180 = b;
        double r575181 = r575165 * r575174;
        double r575182 = r575176 * r575169;
        double r575183 = r575181 - r575182;
        double r575184 = r575180 * r575183;
        double r575185 = r575179 - r575184;
        double r575186 = r575172 + r575185;
        double r575187 = r575164 ? r575186 : r575185;
        return r575187;
}

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
Target20.6
Herbie12.7
\[\begin{array}{l} \mathbf{if}\;x \lt -1.469694296777705016266218530347997287942 \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.21135273622268028942701600607048800714 \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.624488299352209e-261

    1. Initial program 12.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 add-cube-cbrt12.5

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Applied distribute-lft-in12.5

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \color{blue}{\left(\sqrt[3]{b} \cdot \left(c \cdot z\right) + \sqrt[3]{b} \cdot \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    8. Applied distribute-lft-in12.5

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-b\right) \cdot \left(t \cdot i\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    11. Using strategy rm
    12. Applied associate-*r*12.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(-b\right) \cdot t\right) \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]

    if -1.624488299352209e-261 < j < 4.5429529573147235e-99

    1. Initial program 16.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. Taylor expanded around 0 17.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}{0}\]

    if 4.5429529573147235e-99 < j

    1. Initial program 9.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. Using strategy rm
    3. Applied add-cube-cbrt9.3

      \[\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)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification12.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -1.624488299352208951075763961989130211651 \cdot 10^{-261} \lor \neg \left(j \le 4.542952957314723515911650362791300642265 \cdot 10^{-99}\right):\\ \;\;\;\;j \cdot \left(c \cdot a - y \cdot i\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019298 
(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.46969429677770502e-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)))))