Average Error: 11.9 → 12.2
Time: 28.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)\]
\[\left(a \cdot c - y \cdot i\right) \cdot j + \left(\left(z \cdot y - t \cdot a\right) \cdot x - \left(\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b}\right) \cdot \sqrt[3]{\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \left(\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b}\right)}\right)\]
\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)
\left(a \cdot c - y \cdot i\right) \cdot j + \left(\left(z \cdot y - t \cdot a\right) \cdot x - \left(\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b}\right) \cdot \sqrt[3]{\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \left(\sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b} \cdot \sqrt[3]{\left(z \cdot c - t \cdot i\right) \cdot b}\right)}\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r27296997 = x;
        double r27296998 = y;
        double r27296999 = z;
        double r27297000 = r27296998 * r27296999;
        double r27297001 = t;
        double r27297002 = a;
        double r27297003 = r27297001 * r27297002;
        double r27297004 = r27297000 - r27297003;
        double r27297005 = r27296997 * r27297004;
        double r27297006 = b;
        double r27297007 = c;
        double r27297008 = r27297007 * r27296999;
        double r27297009 = i;
        double r27297010 = r27297001 * r27297009;
        double r27297011 = r27297008 - r27297010;
        double r27297012 = r27297006 * r27297011;
        double r27297013 = r27297005 - r27297012;
        double r27297014 = j;
        double r27297015 = r27297007 * r27297002;
        double r27297016 = r27296998 * r27297009;
        double r27297017 = r27297015 - r27297016;
        double r27297018 = r27297014 * r27297017;
        double r27297019 = r27297013 + r27297018;
        return r27297019;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r27297020 = a;
        double r27297021 = c;
        double r27297022 = r27297020 * r27297021;
        double r27297023 = y;
        double r27297024 = i;
        double r27297025 = r27297023 * r27297024;
        double r27297026 = r27297022 - r27297025;
        double r27297027 = j;
        double r27297028 = r27297026 * r27297027;
        double r27297029 = z;
        double r27297030 = r27297029 * r27297023;
        double r27297031 = t;
        double r27297032 = r27297031 * r27297020;
        double r27297033 = r27297030 - r27297032;
        double r27297034 = x;
        double r27297035 = r27297033 * r27297034;
        double r27297036 = r27297029 * r27297021;
        double r27297037 = r27297031 * r27297024;
        double r27297038 = r27297036 - r27297037;
        double r27297039 = b;
        double r27297040 = r27297038 * r27297039;
        double r27297041 = cbrt(r27297040);
        double r27297042 = r27297041 * r27297041;
        double r27297043 = r27297041 * r27297042;
        double r27297044 = cbrt(r27297043);
        double r27297045 = r27297042 * r27297044;
        double r27297046 = r27297035 - r27297045;
        double r27297047 = r27297028 + r27297046;
        return r27297047;
}

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
Target18.9
Herbie12.2
\[\begin{array}{l} \mathbf{if}\;x \lt -1.469694296777705 \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. Initial program 11.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 add-cube-cbrt12.2

    \[\leadsto \left(x \cdot \left(y \cdot z - t \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)\]
  4. Using strategy rm
  5. Applied add-cbrt-cube12.2

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

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

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"

  :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)))))