Average Error: 11.9 → 10.7
Time: 29.9s
Precision: 64
\[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
\[\begin{array}{l} \mathbf{if}\;b \le -8.906366522637092 \cdot 10^{-79}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot z\right) \cdot b\right)\right) + \left(\left(c \cdot t - y \cdot i\right) \cdot j + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \mathbf{elif}\;b \le -4.028168201093351 \cdot 10^{-290}:\\ \;\;\;\;\left(c \cdot t - y \cdot i\right) \cdot j + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(c \cdot z\right) \cdot b + \left(-i \cdot b\right) \cdot a\right)\right)\\ \mathbf{elif}\;b \le 3.48607342233028 \cdot 10^{+125}:\\ \;\;\;\;\left(c \cdot t - y \cdot i\right) \cdot j + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot b\right) \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot z\right) \cdot b\right)\right) + \left(\left(c \cdot t - y \cdot i\right) \cdot j + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \end{array}\]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\begin{array}{l}
\mathbf{if}\;b \le -8.906366522637092 \cdot 10^{-79}:\\
\;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot z\right) \cdot b\right)\right) + \left(\left(c \cdot t - y \cdot i\right) \cdot j + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\

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

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r22003928 = x;
        double r22003929 = y;
        double r22003930 = z;
        double r22003931 = r22003929 * r22003930;
        double r22003932 = t;
        double r22003933 = a;
        double r22003934 = r22003932 * r22003933;
        double r22003935 = r22003931 - r22003934;
        double r22003936 = r22003928 * r22003935;
        double r22003937 = b;
        double r22003938 = c;
        double r22003939 = r22003938 * r22003930;
        double r22003940 = i;
        double r22003941 = r22003940 * r22003933;
        double r22003942 = r22003939 - r22003941;
        double r22003943 = r22003937 * r22003942;
        double r22003944 = r22003936 - r22003943;
        double r22003945 = j;
        double r22003946 = r22003938 * r22003932;
        double r22003947 = r22003940 * r22003929;
        double r22003948 = r22003946 - r22003947;
        double r22003949 = r22003945 * r22003948;
        double r22003950 = r22003944 + r22003949;
        return r22003950;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r22003951 = b;
        double r22003952 = -8.906366522637092e-79;
        bool r22003953 = r22003951 <= r22003952;
        double r22003954 = y;
        double r22003955 = z;
        double r22003956 = r22003954 * r22003955;
        double r22003957 = t;
        double r22003958 = a;
        double r22003959 = r22003957 * r22003958;
        double r22003960 = r22003956 - r22003959;
        double r22003961 = x;
        double r22003962 = r22003960 * r22003961;
        double r22003963 = -r22003951;
        double r22003964 = i;
        double r22003965 = r22003964 * r22003958;
        double r22003966 = r22003963 * r22003965;
        double r22003967 = c;
        double r22003968 = r22003967 * r22003955;
        double r22003969 = r22003968 * r22003951;
        double r22003970 = r22003966 + r22003969;
        double r22003971 = r22003962 - r22003970;
        double r22003972 = r22003967 * r22003957;
        double r22003973 = r22003954 * r22003964;
        double r22003974 = r22003972 - r22003973;
        double r22003975 = j;
        double r22003976 = r22003974 * r22003975;
        double r22003977 = -r22003954;
        double r22003978 = fma(r22003977, r22003964, r22003973);
        double r22003979 = r22003975 * r22003978;
        double r22003980 = r22003976 + r22003979;
        double r22003981 = r22003971 + r22003980;
        double r22003982 = -4.028168201093351e-290;
        bool r22003983 = r22003951 <= r22003982;
        double r22003984 = r22003964 * r22003951;
        double r22003985 = -r22003984;
        double r22003986 = r22003985 * r22003958;
        double r22003987 = r22003969 + r22003986;
        double r22003988 = r22003962 - r22003987;
        double r22003989 = r22003976 + r22003988;
        double r22003990 = 3.48607342233028e+125;
        bool r22003991 = r22003951 <= r22003990;
        double r22003992 = r22003967 * r22003951;
        double r22003993 = r22003992 * r22003955;
        double r22003994 = r22003966 + r22003993;
        double r22003995 = r22003962 - r22003994;
        double r22003996 = r22003976 + r22003995;
        double r22003997 = r22003991 ? r22003996 : r22003981;
        double r22003998 = r22003983 ? r22003989 : r22003997;
        double r22003999 = r22003953 ? r22003981 : r22003998;
        return r22003999;
}

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

Target

Original11.9
Target15.6
Herbie10.7
\[\begin{array}{l} \mathbf{if}\;t \lt -8.120978919195912 \cdot 10^{-33}:\\ \;\;\;\;x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \mathbf{elif}\;t \lt -4.712553818218485 \cdot 10^{-169}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\ \mathbf{elif}\;t \lt -7.633533346031584 \cdot 10^{-308}:\\ \;\;\;\;x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \mathbf{elif}\;t \lt 1.0535888557455487 \cdot 10^{-139}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if b < -8.906366522637092e-79 or 3.48607342233028e+125 < b

    1. Initial program 7.7

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\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(-i \cdot a\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    4. Applied distribute-rgt-in7.7

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

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

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

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

    if -8.906366522637092e-79 < b < -4.028168201093351e-290

    1. Initial program 15.6

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    2. Using strategy rm
    3. Applied sub-neg15.6

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(-i \cdot a\right) \cdot b\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Taylor expanded around inf 13.0

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

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

    if -4.028168201093351e-290 < b < 3.48607342233028e+125

    1. Initial program 13.6

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    2. Using strategy rm
    3. Applied sub-neg13.6

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(\left(c \cdot z\right) \cdot b + \left(-i \cdot a\right) \cdot b\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Taylor expanded around inf 12.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -8.906366522637092 \cdot 10^{-79}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot z\right) \cdot b\right)\right) + \left(\left(c \cdot t - y \cdot i\right) \cdot j + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \mathbf{elif}\;b \le -4.028168201093351 \cdot 10^{-290}:\\ \;\;\;\;\left(c \cdot t - y \cdot i\right) \cdot j + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(c \cdot z\right) \cdot b + \left(-i \cdot b\right) \cdot a\right)\right)\\ \mathbf{elif}\;b \le 3.48607342233028 \cdot 10^{+125}:\\ \;\;\;\;\left(c \cdot t - y \cdot i\right) \cdot j + \left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot b\right) \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot z - t \cdot a\right) \cdot x - \left(\left(-b\right) \cdot \left(i \cdot a\right) + \left(c \cdot z\right) \cdot b\right)\right) + \left(\left(c \cdot t - y \cdot i\right) \cdot j + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"

  :herbie-target
  (if (< t -8.120978919195912e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.712553818218485e-169) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -7.633533346031584e-308) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 1.0535888557455487e-139) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))))

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