Average Error: 11.9 → 11.3
Time: 8.1s
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 r890700 = x;
        double r890701 = y;
        double r890702 = z;
        double r890703 = r890701 * r890702;
        double r890704 = t;
        double r890705 = a;
        double r890706 = r890704 * r890705;
        double r890707 = r890703 - r890706;
        double r890708 = r890700 * r890707;
        double r890709 = b;
        double r890710 = c;
        double r890711 = r890710 * r890702;
        double r890712 = i;
        double r890713 = r890704 * r890712;
        double r890714 = r890711 - r890713;
        double r890715 = r890709 * r890714;
        double r890716 = r890708 - r890715;
        double r890717 = j;
        double r890718 = r890710 * r890705;
        double r890719 = r890701 * r890712;
        double r890720 = r890718 - r890719;
        double r890721 = r890717 * r890720;
        double r890722 = r890716 + r890721;
        return r890722;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r890723 = z;
        double r890724 = -1.092021419272295e-37;
        bool r890725 = r890723 <= r890724;
        double r890726 = x;
        double r890727 = y;
        double r890728 = r890727 * r890723;
        double r890729 = t;
        double r890730 = a;
        double r890731 = r890729 * r890730;
        double r890732 = r890728 - r890731;
        double r890733 = r890726 * r890732;
        double r890734 = b;
        double r890735 = c;
        double r890736 = r890734 * r890735;
        double r890737 = r890736 * r890723;
        double r890738 = i;
        double r890739 = r890729 * r890738;
        double r890740 = -r890739;
        double r890741 = r890734 * r890740;
        double r890742 = r890737 + r890741;
        double r890743 = r890733 - r890742;
        double r890744 = j;
        double r890745 = r890735 * r890730;
        double r890746 = r890727 * r890738;
        double r890747 = r890745 - r890746;
        double r890748 = r890744 * r890747;
        double r890749 = r890743 + r890748;
        double r890750 = -1.3512627144290116e-124;
        bool r890751 = r890723 <= r890750;
        double r890752 = r890735 * r890723;
        double r890753 = r890734 * r890752;
        double r890754 = -1.0;
        double r890755 = r890738 * r890734;
        double r890756 = r890729 * r890755;
        double r890757 = r890754 * r890756;
        double r890758 = r890753 + r890757;
        double r890759 = r890733 - r890758;
        double r890760 = r890759 + r890748;
        double r890761 = 1.1738608161239543e-165;
        bool r890762 = r890723 <= r890761;
        double r890763 = cbrt(r890732);
        double r890764 = r890763 * r890763;
        double r890765 = r890726 * r890764;
        double r890766 = r890765 * r890763;
        double r890767 = r890753 + r890741;
        double r890768 = r890766 - r890767;
        double r890769 = r890768 + r890748;
        double r890770 = r890734 * r890729;
        double r890771 = -r890738;
        double r890772 = r890770 * r890771;
        double r890773 = r890753 + r890772;
        double r890774 = r890733 - r890773;
        double r890775 = r890774 + r890748;
        double r890776 = r890762 ? r890769 : r890775;
        double r890777 = r890751 ? r890760 : r890776;
        double r890778 = r890725 ? r890749 : r890777;
        return r890778;
}

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