Average Error: 11.9 → 11.3
Time: 8.3s
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}\;z \le -1.092021419272295 \cdot 10^{-37}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(b \cdot c\right) \cdot z + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;z \le -1.35126271442901157 \cdot 10^{-124}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + -1 \cdot \left(t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;z \le 1.17386081612395432 \cdot 10^{-165}:\\ \;\;\;\;\left(\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - \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)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + \left(b \cdot t\right) \cdot \left(-i\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}\;z \le -1.092021419272295 \cdot 10^{-37}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(b \cdot c\right) \cdot z + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

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

\mathbf{elif}\;z \le 1.17386081612395432 \cdot 10^{-165}:\\
\;\;\;\;\left(\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - \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)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + \left(b \cdot t\right) \cdot \left(-i\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 r800913 = x;
        double r800914 = y;
        double r800915 = z;
        double r800916 = r800914 * r800915;
        double r800917 = t;
        double r800918 = a;
        double r800919 = r800917 * r800918;
        double r800920 = r800916 - r800919;
        double r800921 = r800913 * r800920;
        double r800922 = b;
        double r800923 = c;
        double r800924 = r800923 * r800915;
        double r800925 = i;
        double r800926 = r800917 * r800925;
        double r800927 = r800924 - r800926;
        double r800928 = r800922 * r800927;
        double r800929 = r800921 - r800928;
        double r800930 = j;
        double r800931 = r800923 * r800918;
        double r800932 = r800914 * r800925;
        double r800933 = r800931 - r800932;
        double r800934 = r800930 * r800933;
        double r800935 = r800929 + r800934;
        return r800935;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r800936 = z;
        double r800937 = -1.092021419272295e-37;
        bool r800938 = r800936 <= r800937;
        double r800939 = x;
        double r800940 = y;
        double r800941 = r800940 * r800936;
        double r800942 = t;
        double r800943 = a;
        double r800944 = r800942 * r800943;
        double r800945 = r800941 - r800944;
        double r800946 = r800939 * r800945;
        double r800947 = b;
        double r800948 = c;
        double r800949 = r800947 * r800948;
        double r800950 = r800949 * r800936;
        double r800951 = i;
        double r800952 = r800942 * r800951;
        double r800953 = -r800952;
        double r800954 = r800947 * r800953;
        double r800955 = r800950 + r800954;
        double r800956 = r800946 - r800955;
        double r800957 = j;
        double r800958 = r800948 * r800943;
        double r800959 = r800940 * r800951;
        double r800960 = r800958 - r800959;
        double r800961 = r800957 * r800960;
        double r800962 = r800956 + r800961;
        double r800963 = -1.3512627144290116e-124;
        bool r800964 = r800936 <= r800963;
        double r800965 = r800948 * r800936;
        double r800966 = r800947 * r800965;
        double r800967 = -1.0;
        double r800968 = r800951 * r800947;
        double r800969 = r800942 * r800968;
        double r800970 = r800967 * r800969;
        double r800971 = r800966 + r800970;
        double r800972 = r800946 - r800971;
        double r800973 = r800972 + r800961;
        double r800974 = 1.1738608161239543e-165;
        bool r800975 = r800936 <= r800974;
        double r800976 = cbrt(r800945);
        double r800977 = r800976 * r800976;
        double r800978 = r800939 * r800977;
        double r800979 = r800978 * r800976;
        double r800980 = r800966 + r800954;
        double r800981 = r800979 - r800980;
        double r800982 = r800981 + r800961;
        double r800983 = r800947 * r800942;
        double r800984 = -r800951;
        double r800985 = r800983 * r800984;
        double r800986 = r800966 + r800985;
        double r800987 = r800946 - r800986;
        double r800988 = r800987 + r800961;
        double r800989 = r800975 ? r800982 : r800988;
        double r800990 = r800964 ? r800973 : r800989;
        double r800991 = r800938 ? r800962 : r800990;
        return r800991;
}

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

Original11.9
Target19.9
Herbie11.3
\[\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 4 regimes
  2. if z < -1.092021419272295e-37

    1. Initial program 14.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-neg14.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-in14.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. Using strategy rm
    6. Applied associate-*r*12.3

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

    if -1.092021419272295e-37 < z < -1.3512627144290116e-124

    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 sub-neg9.0

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

      \[\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. Taylor expanded around inf 8.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\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.3512627144290116e-124 < z < 1.1738608161239543e-165

    1. Initial program 9.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-neg9.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-in9.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. Using strategy rm
    6. Applied add-cube-cbrt10.1

      \[\leadsto \left(x \cdot \color{blue}{\left(\left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)} - \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)\]
    7. Applied associate-*r*10.1

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}} - \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)\]

    if 1.1738608161239543e-165 < z

    1. Initial program 12.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-neg12.5

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

      \[\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. Using strategy rm
    6. Applied distribute-rgt-neg-in12.5

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

      \[\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 \left(-i\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.092021419272295 \cdot 10^{-37}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(b \cdot c\right) \cdot z + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;z \le -1.35126271442901157 \cdot 10^{-124}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + -1 \cdot \left(t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;z \le 1.17386081612395432 \cdot 10^{-165}:\\ \;\;\;\;\left(\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - \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)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + \left(b \cdot t\right) \cdot \left(-i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Reproduce

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