Average Error: 12.5 → 8.9
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}\;x \le -16338913489800448000:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(\sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)} \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right) \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;x \le 1.502671480045437782749650879355905030654 \cdot 10^{-59}:\\ \;\;\;\;\left(\left(y \cdot \left(z \cdot x\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + \left(-t\right) \cdot \left(i \cdot b\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(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \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}\;x \le -16338913489800448000:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(\sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)} \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right) \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

\mathbf{elif}\;x \le 1.502671480045437782749650879355905030654 \cdot 10^{-59}:\\
\;\;\;\;\left(\left(y \cdot \left(z \cdot x\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + \left(-t\right) \cdot \left(i \cdot b\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(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \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 r686016 = x;
        double r686017 = y;
        double r686018 = z;
        double r686019 = r686017 * r686018;
        double r686020 = t;
        double r686021 = a;
        double r686022 = r686020 * r686021;
        double r686023 = r686019 - r686022;
        double r686024 = r686016 * r686023;
        double r686025 = b;
        double r686026 = c;
        double r686027 = r686026 * r686018;
        double r686028 = i;
        double r686029 = r686020 * r686028;
        double r686030 = r686027 - r686029;
        double r686031 = r686025 * r686030;
        double r686032 = r686024 - r686031;
        double r686033 = j;
        double r686034 = r686026 * r686021;
        double r686035 = r686017 * r686028;
        double r686036 = r686034 - r686035;
        double r686037 = r686033 * r686036;
        double r686038 = r686032 + r686037;
        return r686038;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r686039 = x;
        double r686040 = -1.6338913489800448e+19;
        bool r686041 = r686039 <= r686040;
        double r686042 = y;
        double r686043 = z;
        double r686044 = r686042 * r686043;
        double r686045 = t;
        double r686046 = a;
        double r686047 = r686045 * r686046;
        double r686048 = r686044 - r686047;
        double r686049 = r686039 * r686048;
        double r686050 = b;
        double r686051 = c;
        double r686052 = r686050 * r686051;
        double r686053 = r686043 * r686052;
        double r686054 = -r686045;
        double r686055 = i;
        double r686056 = r686055 * r686050;
        double r686057 = r686054 * r686056;
        double r686058 = cbrt(r686057);
        double r686059 = r686058 * r686058;
        double r686060 = r686059 * r686058;
        double r686061 = r686053 + r686060;
        double r686062 = r686049 - r686061;
        double r686063 = j;
        double r686064 = r686051 * r686046;
        double r686065 = r686042 * r686055;
        double r686066 = r686064 - r686065;
        double r686067 = r686063 * r686066;
        double r686068 = r686062 + r686067;
        double r686069 = 1.5026714800454378e-59;
        bool r686070 = r686039 <= r686069;
        double r686071 = r686043 * r686039;
        double r686072 = r686042 * r686071;
        double r686073 = r686039 * r686045;
        double r686074 = r686046 * r686073;
        double r686075 = -r686074;
        double r686076 = r686072 + r686075;
        double r686077 = r686053 + r686057;
        double r686078 = r686076 - r686077;
        double r686079 = r686078 + r686067;
        double r686080 = r686043 * r686050;
        double r686081 = r686080 * r686051;
        double r686082 = r686081 + r686057;
        double r686083 = r686049 - r686082;
        double r686084 = r686083 + r686067;
        double r686085 = r686070 ? r686079 : r686084;
        double r686086 = r686041 ? r686068 : r686085;
        return r686086;
}

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
Target19.9
Herbie8.9
\[\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 x < -1.6338913489800448e+19

    1. Initial program 7.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. Using strategy rm
    3. Applied sub-neg7.7

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

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

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

      \[\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-in8.2

      \[\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\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*8.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\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied add-cube-cbrt8.8

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

    if -1.6338913489800448e+19 < x < 1.5026714800454378e-59

    1. Initial program 15.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-neg15.8

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

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

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

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

      \[\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\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*15.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\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied sub-neg15.7

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

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

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

      \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \color{blue}{\left(-a \cdot \left(x \cdot t\right)\right)}\right) - \left(z \cdot \left(b \cdot c\right) + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    15. Using strategy rm
    16. Applied associate-*l*9.3

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

    if 1.5026714800454378e-59 < x

    1. Initial program 8.1

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

      \[\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-in8.1

      \[\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.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. Simplified8.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-in8.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\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*8.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\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied associate-*r*8.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -16338913489800448000:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(\sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)} \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right) \cdot \sqrt[3]{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;x \le 1.502671480045437782749650879355905030654 \cdot 10^{-59}:\\ \;\;\;\;\left(\left(y \cdot \left(z \cdot x\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + \left(-t\right) \cdot \left(i \cdot b\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(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Reproduce

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