Average Error: 12.5 → 9.7
Time: 24.0s
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 -4.342962072183161763686249274375685878126 \cdot 10^{90}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right)\\ \mathbf{elif}\;b \le 1.234552070064316728666303086170435366235 \cdot 10^{-278}:\\ \;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \le 2.847169551403341668887341056609846141356 \cdot 10^{-224}:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x + \left(-\left(a \cdot x\right) \cdot t\right)\right) - \left(z \cdot \left(b \cdot c\right) + b \cdot \left(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \le 5.528046101523884974127325839682326929048 \cdot 10^{-20}:\\ \;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\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 -4.342962072183161763686249274375685878126 \cdot 10^{90}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right)\\

\mathbf{elif}\;b \le 1.234552070064316728666303086170435366235 \cdot 10^{-278}:\\
\;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\

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

\mathbf{elif}\;b \le 5.528046101523884974127325839682326929048 \cdot 10^{-20}:\\
\;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\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 r315890 = x;
        double r315891 = y;
        double r315892 = z;
        double r315893 = r315891 * r315892;
        double r315894 = t;
        double r315895 = a;
        double r315896 = r315894 * r315895;
        double r315897 = r315893 - r315896;
        double r315898 = r315890 * r315897;
        double r315899 = b;
        double r315900 = c;
        double r315901 = r315900 * r315892;
        double r315902 = i;
        double r315903 = r315902 * r315895;
        double r315904 = r315901 - r315903;
        double r315905 = r315899 * r315904;
        double r315906 = r315898 - r315905;
        double r315907 = j;
        double r315908 = r315900 * r315894;
        double r315909 = r315902 * r315891;
        double r315910 = r315908 - r315909;
        double r315911 = r315907 * r315910;
        double r315912 = r315906 + r315911;
        return r315912;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r315913 = b;
        double r315914 = -4.342962072183162e+90;
        bool r315915 = r315913 <= r315914;
        double r315916 = x;
        double r315917 = y;
        double r315918 = z;
        double r315919 = r315917 * r315918;
        double r315920 = t;
        double r315921 = a;
        double r315922 = r315920 * r315921;
        double r315923 = r315919 - r315922;
        double r315924 = r315916 * r315923;
        double r315925 = c;
        double r315926 = r315925 * r315918;
        double r315927 = i;
        double r315928 = r315927 * r315921;
        double r315929 = r315926 - r315928;
        double r315930 = r315913 * r315929;
        double r315931 = r315924 - r315930;
        double r315932 = j;
        double r315933 = r315932 * r315925;
        double r315934 = r315920 * r315933;
        double r315935 = r315932 * r315917;
        double r315936 = r315927 * r315935;
        double r315937 = -r315936;
        double r315938 = r315934 + r315937;
        double r315939 = r315931 + r315938;
        double r315940 = 1.2345520700643167e-278;
        bool r315941 = r315913 <= r315940;
        double r315942 = r315918 * r315916;
        double r315943 = r315917 * r315942;
        double r315944 = r315916 * r315920;
        double r315945 = r315921 * r315944;
        double r315946 = -r315945;
        double r315947 = r315943 + r315946;
        double r315948 = r315913 * r315925;
        double r315949 = r315918 * r315948;
        double r315950 = r315927 * r315913;
        double r315951 = r315921 * r315950;
        double r315952 = -r315951;
        double r315953 = r315949 + r315952;
        double r315954 = r315947 - r315953;
        double r315955 = r315925 * r315920;
        double r315956 = r315927 * r315917;
        double r315957 = r315955 - r315956;
        double r315958 = r315932 * r315957;
        double r315959 = r315954 + r315958;
        double r315960 = 2.8471695514033417e-224;
        bool r315961 = r315913 <= r315960;
        double r315962 = r315919 * r315916;
        double r315963 = r315921 * r315916;
        double r315964 = r315963 * r315920;
        double r315965 = -r315964;
        double r315966 = r315962 + r315965;
        double r315967 = -r315928;
        double r315968 = r315913 * r315967;
        double r315969 = r315949 + r315968;
        double r315970 = r315966 - r315969;
        double r315971 = r315970 + r315958;
        double r315972 = 5.528046101523885e-20;
        bool r315973 = r315913 <= r315972;
        double r315974 = r315928 - r315926;
        double r315975 = fma(r315913, r315974, r315958);
        double r315976 = fma(r315916, r315923, r315975);
        double r315977 = r315973 ? r315959 : r315976;
        double r315978 = r315961 ? r315971 : r315977;
        double r315979 = r315941 ? r315959 : r315978;
        double r315980 = r315915 ? r315939 : r315979;
        return r315980;
}

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

Original12.5
Target16.3
Herbie9.7
\[\begin{array}{l} \mathbf{if}\;t \lt -8.12097891919591218149793027759825150959 \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.712553818218485141757938537793350881052 \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.633533346031583686060259351057142920433 \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.053588855745548710002760210539645467715 \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 4 regimes
  2. if b < -4.342962072183162e+90

    1. Initial program 7.0

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

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

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

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

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

    if -4.342962072183162e+90 < b < 1.2345520700643167e-278 or 2.8471695514033417e-224 < b < 5.528046101523885e-20

    1. Initial program 14.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-neg14.6

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

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

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

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

      \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \left(-a \cdot \left(x \cdot t\right)\right)\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)\]
    9. Applied distribute-lft-in14.5

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

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

      \[\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) + b \cdot \left(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    13. Using strategy rm
    14. Applied distribute-rgt-neg-out12.6

      \[\leadsto \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) + \color{blue}{\left(-b \cdot \left(i \cdot a\right)\right)}\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    15. Simplified10.2

      \[\leadsto \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(-\color{blue}{a \cdot \left(i \cdot b\right)}\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]

    if 1.2345520700643167e-278 < b < 2.8471695514033417e-224

    1. Initial program 18.9

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

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

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

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

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

      \[\leadsto \left(\left(\left(y \cdot z\right) \cdot x + \left(-a \cdot \left(x \cdot t\right)\right)\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)\]
    9. Applied distribute-lft-in19.7

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

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

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

    if 5.528046101523885e-20 < b

    1. Initial program 7.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -4.342962072183161763686249274375685878126 \cdot 10^{90}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(t \cdot \left(j \cdot c\right) + \left(-i \cdot \left(j \cdot y\right)\right)\right)\\ \mathbf{elif}\;b \le 1.234552070064316728666303086170435366235 \cdot 10^{-278}:\\ \;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \le 2.847169551403341668887341056609846141356 \cdot 10^{-224}:\\ \;\;\;\;\left(\left(\left(y \cdot z\right) \cdot x + \left(-\left(a \cdot x\right) \cdot t\right)\right) - \left(z \cdot \left(b \cdot c\right) + b \cdot \left(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{elif}\;b \le 5.528046101523884974127325839682326929048 \cdot 10^{-20}:\\ \;\;\;\;\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(-a \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< t -8.1209789191959122e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.7125538182184851e-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.63353334603158369e-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)))))