Average Error: 12.0 → 12.0
Time: 21.0s
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}\;\left(i \le -2.079426442203953165914746046308740028089 \cdot 10^{80} \lor i \le -1.439590553357621205743260829622743759452 \cdot 10^{-119}\right) \lor \left(i \le -3.639434921777483705099275009427059968093 \cdot 10^{-234} \lor i \le -1.603394320863634609170070211543361553855 \cdot 10^{-282}\right):\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\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}\;\left(i \le -2.079426442203953165914746046308740028089 \cdot 10^{80} \lor i \le -1.439590553357621205743260829622743759452 \cdot 10^{-119}\right) \lor \left(i \le -3.639434921777483705099275009427059968093 \cdot 10^{-234} \lor i \le -1.603394320863634609170070211543361553855 \cdot 10^{-282}\right):\\
\;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\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 r629140 = x;
        double r629141 = y;
        double r629142 = z;
        double r629143 = r629141 * r629142;
        double r629144 = t;
        double r629145 = a;
        double r629146 = r629144 * r629145;
        double r629147 = r629143 - r629146;
        double r629148 = r629140 * r629147;
        double r629149 = b;
        double r629150 = c;
        double r629151 = r629150 * r629142;
        double r629152 = i;
        double r629153 = r629144 * r629152;
        double r629154 = r629151 - r629153;
        double r629155 = r629149 * r629154;
        double r629156 = r629148 - r629155;
        double r629157 = j;
        double r629158 = r629150 * r629145;
        double r629159 = r629141 * r629152;
        double r629160 = r629158 - r629159;
        double r629161 = r629157 * r629160;
        double r629162 = r629156 + r629161;
        return r629162;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r629163 = i;
        double r629164 = -2.0794264422039532e+80;
        bool r629165 = r629163 <= r629164;
        double r629166 = -1.4395905533576212e-119;
        bool r629167 = r629163 <= r629166;
        bool r629168 = r629165 || r629167;
        double r629169 = -3.6394349217774837e-234;
        bool r629170 = r629163 <= r629169;
        double r629171 = -1.6033943208636346e-282;
        bool r629172 = r629163 <= r629171;
        bool r629173 = r629170 || r629172;
        bool r629174 = r629168 || r629173;
        double r629175 = j;
        double r629176 = c;
        double r629177 = a;
        double r629178 = r629176 * r629177;
        double r629179 = y;
        double r629180 = r629179 * r629163;
        double r629181 = r629178 - r629180;
        double r629182 = r629175 * r629181;
        double r629183 = x;
        double r629184 = z;
        double r629185 = r629179 * r629184;
        double r629186 = t;
        double r629187 = r629186 * r629177;
        double r629188 = r629185 - r629187;
        double r629189 = r629183 * r629188;
        double r629190 = r629182 + r629189;
        double r629191 = b;
        double r629192 = r629176 * r629184;
        double r629193 = r629186 * r629163;
        double r629194 = r629192 - r629193;
        double r629195 = r629191 * r629194;
        double r629196 = r629190 - r629195;
        double r629197 = r629174 ? r629196 : r629196;
        return r629197;
}

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
Target19.6
Herbie12.0
\[\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 5 regimes
  2. if i < -2.0794264422039532e+80

    1. Initial program 18.8

      \[\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-neg18.8

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-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)\]
    4. Applied distribute-lft-in18.8

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-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. Simplified19.0

      \[\leadsto \left(\left(x \cdot \left(y \cdot z\right) + \color{blue}{\left(-x \cdot t\right) \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 associate-*r*19.1

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

      \[\leadsto \left(\left(\left(x \cdot y\right) \cdot z + \left(-x \cdot t\right) \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \color{blue}{\left(c \cdot a + \left(-y \cdot i\right)\right)}\]
    10. Applied distribute-rgt-in19.1

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

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

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

    if -2.0794264422039532e+80 < i < -1.4395905533576212e-119 or 4.963520937120174e-177 < i < 2.530556207066626e-42

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

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-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)\]
    4. Applied distribute-lft-in9.4

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-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. Simplified9.8

      \[\leadsto \left(\left(x \cdot \left(y \cdot z\right) + \color{blue}{\left(-x \cdot t\right) \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 sub-neg9.8

      \[\leadsto \left(\left(x \cdot \left(y \cdot z\right) + \left(-x \cdot t\right) \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)\]
    8. Applied distribute-rgt-in9.8

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

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

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

    if -1.4395905533576212e-119 < i < -3.6394349217774837e-234

    1. Initial program 8.3

      \[\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-neg8.3

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-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)\]
    4. Applied distribute-rgt-in8.3

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

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

    if -3.6394349217774837e-234 < i < -1.6033943208636346e-282 or 9.66752343858949e-219 < i < 4.963520937120174e-177

    1. Initial program 9.5

      \[\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-neg9.5

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-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)\]
    4. Applied distribute-lft-in9.5

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-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. Simplified9.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z\right) + \color{blue}{\left(-x \cdot t\right) \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 associate-*r*9.2

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

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

    if -1.6033943208636346e-282 < i < 9.66752343858949e-219 or 2.530556207066626e-42 < i

    1. Initial program 13.6

      \[\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-neg13.6

      \[\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-in13.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(i \le -2.079426442203953165914746046308740028089 \cdot 10^{80} \lor i \le -1.439590553357621205743260829622743759452 \cdot 10^{-119}\right) \lor \left(i \le -3.639434921777483705099275009427059968093 \cdot 10^{-234} \lor i \le -1.603394320863634609170070211543361553855 \cdot 10^{-282}\right):\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\ \end{array}\]

Reproduce

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