Average Error: 12.5 → 11.3
Time: 26.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}\;j \le 1.025515136106659762123851452660814598759 \cdot 10^{-120}:\\ \;\;\;\;\left(\left(-\left(y \cdot j\right) \cdot i\right) + \left(\left(\left(j \cdot c\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + c \cdot \left(b \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + z \cdot \left(b \cdot c\right)\right)\right) + j \cdot \left(c \cdot a - i \cdot y\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.025515136106659762123851452660814598759 \cdot 10^{-120}:\\
\;\;\;\;\left(\left(-\left(y \cdot j\right) \cdot i\right) + \left(\left(\left(j \cdot c\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + c \cdot \left(b \cdot z\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + z \cdot \left(b \cdot c\right)\right)\right) + j \cdot \left(c \cdot a - i \cdot y\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r694823 = x;
        double r694824 = y;
        double r694825 = z;
        double r694826 = r694824 * r694825;
        double r694827 = t;
        double r694828 = a;
        double r694829 = r694827 * r694828;
        double r694830 = r694826 - r694829;
        double r694831 = r694823 * r694830;
        double r694832 = b;
        double r694833 = c;
        double r694834 = r694833 * r694825;
        double r694835 = i;
        double r694836 = r694827 * r694835;
        double r694837 = r694834 - r694836;
        double r694838 = r694832 * r694837;
        double r694839 = r694831 - r694838;
        double r694840 = j;
        double r694841 = r694833 * r694828;
        double r694842 = r694824 * r694835;
        double r694843 = r694841 - r694842;
        double r694844 = r694840 * r694843;
        double r694845 = r694839 + r694844;
        return r694845;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r694846 = j;
        double r694847 = 1.0255151361066598e-120;
        bool r694848 = r694846 <= r694847;
        double r694849 = y;
        double r694850 = r694849 * r694846;
        double r694851 = i;
        double r694852 = r694850 * r694851;
        double r694853 = -r694852;
        double r694854 = c;
        double r694855 = r694846 * r694854;
        double r694856 = a;
        double r694857 = cbrt(r694856);
        double r694858 = r694855 * r694857;
        double r694859 = r694858 * r694857;
        double r694860 = r694859 * r694857;
        double r694861 = r694853 + r694860;
        double r694862 = z;
        double r694863 = r694849 * r694862;
        double r694864 = t;
        double r694865 = r694864 * r694856;
        double r694866 = r694863 - r694865;
        double r694867 = x;
        double r694868 = r694866 * r694867;
        double r694869 = -r694851;
        double r694870 = b;
        double r694871 = r694870 * r694864;
        double r694872 = r694869 * r694871;
        double r694873 = r694870 * r694862;
        double r694874 = r694854 * r694873;
        double r694875 = r694872 + r694874;
        double r694876 = r694868 - r694875;
        double r694877 = r694861 + r694876;
        double r694878 = r694870 * r694854;
        double r694879 = r694862 * r694878;
        double r694880 = r694872 + r694879;
        double r694881 = r694868 - r694880;
        double r694882 = r694854 * r694856;
        double r694883 = r694851 * r694849;
        double r694884 = r694882 - r694883;
        double r694885 = r694846 * r694884;
        double r694886 = r694881 + r694885;
        double r694887 = r694848 ? r694877 : r694886;
        return r694887;
}

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.6
Herbie11.3
\[\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 2 regimes
  2. if j < 1.0255151361066598e-120

    1. Initial program 13.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-neg13.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-in13.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. Simplified14.1

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(b \cdot z\right) \cdot c + i \cdot \left(-t \cdot b\right)\right)\right) + \left(\left(j \cdot c\right) \cdot a + i \cdot \color{blue}{\left(\left(-j\right) \cdot y\right)}\right)\]
    15. Using strategy rm
    16. Applied add-cube-cbrt12.3

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

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

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

    if 1.0255151361066598e-120 < j

    1. Initial program 9.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-neg9.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-in9.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. Simplified10.0

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

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

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\color{blue}{{b}^{1}} \cdot {z}^{1}\right) \cdot {c}^{1} + i \cdot \left(-t \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    11. Applied pow-prod-down9.8

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{{\left(b \cdot z\right)}^{1}} \cdot {c}^{1} + i \cdot \left(-t \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    12. Applied pow-prod-down9.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le 1.025515136106659762123851452660814598759 \cdot 10^{-120}:\\ \;\;\;\;\left(\left(-\left(y \cdot j\right) \cdot i\right) + \left(\left(\left(j \cdot c\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}\right) + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + c \cdot \left(b \cdot z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot t\right) + z \cdot \left(b \cdot c\right)\right)\right) + j \cdot \left(c \cdot a - i \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019195 
(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.0) (pow (* t i) 2.0))) (+ (* 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.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))