Average Error: 11.8 → 12.2
Time: 18.7s
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}\;x \le -8.0515881614193051 \cdot 10^{-225}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{elif}\;x \le -3.86856299102935799 \cdot 10^{-265}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{elif}\;x \le -2.33714250920168024 \cdot 10^{-267}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{elif}\;x \le 3.45049822668784865 \cdot 10^{-228}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(0 - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\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}\;x \le -8.0515881614193051 \cdot 10^{-225}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\

\mathbf{elif}\;x \le -3.86856299102935799 \cdot 10^{-265}:\\
\;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\

\mathbf{elif}\;x \le -2.33714250920168024 \cdot 10^{-267}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\

\mathbf{elif}\;x \le 3.45049822668784865 \cdot 10^{-228}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(0 - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r592827 = x;
        double r592828 = y;
        double r592829 = z;
        double r592830 = r592828 * r592829;
        double r592831 = t;
        double r592832 = a;
        double r592833 = r592831 * r592832;
        double r592834 = r592830 - r592833;
        double r592835 = r592827 * r592834;
        double r592836 = b;
        double r592837 = c;
        double r592838 = r592837 * r592829;
        double r592839 = i;
        double r592840 = r592839 * r592832;
        double r592841 = r592838 - r592840;
        double r592842 = r592836 * r592841;
        double r592843 = r592835 - r592842;
        double r592844 = j;
        double r592845 = r592837 * r592831;
        double r592846 = r592839 * r592828;
        double r592847 = r592845 - r592846;
        double r592848 = r592844 * r592847;
        double r592849 = r592843 + r592848;
        return r592849;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r592850 = x;
        double r592851 = -8.051588161419305e-225;
        bool r592852 = r592850 <= r592851;
        double r592853 = c;
        double r592854 = t;
        double r592855 = r592853 * r592854;
        double r592856 = i;
        double r592857 = y;
        double r592858 = r592856 * r592857;
        double r592859 = r592855 - r592858;
        double r592860 = j;
        double r592861 = z;
        double r592862 = a;
        double r592863 = r592862 * r592854;
        double r592864 = -r592863;
        double r592865 = fma(r592857, r592861, r592864);
        double r592866 = r592850 * r592865;
        double r592867 = -r592862;
        double r592868 = fma(r592867, r592854, r592863);
        double r592869 = r592850 * r592868;
        double r592870 = r592866 + r592869;
        double r592871 = r592862 * r592856;
        double r592872 = -r592871;
        double r592873 = fma(r592853, r592861, r592872);
        double r592874 = b;
        double r592875 = r592873 * r592874;
        double r592876 = r592870 - r592875;
        double r592877 = fma(r592867, r592856, r592871);
        double r592878 = r592877 * r592874;
        double r592879 = r592876 - r592878;
        double r592880 = fma(r592859, r592860, r592879);
        double r592881 = -3.868562991029358e-265;
        bool r592882 = r592850 <= r592881;
        double r592883 = r592856 * r592874;
        double r592884 = r592874 * r592853;
        double r592885 = r592850 * r592854;
        double r592886 = r592862 * r592885;
        double r592887 = fma(r592861, r592884, r592886);
        double r592888 = -r592887;
        double r592889 = fma(r592862, r592883, r592888);
        double r592890 = -2.3371425092016802e-267;
        bool r592891 = r592850 <= r592890;
        double r592892 = 3.4504982266878486e-228;
        bool r592893 = r592850 <= r592892;
        double r592894 = 0.0;
        double r592895 = r592894 - r592875;
        double r592896 = r592895 - r592878;
        double r592897 = fma(r592859, r592860, r592896);
        double r592898 = r592893 ? r592897 : r592880;
        double r592899 = r592891 ? r592880 : r592898;
        double r592900 = r592882 ? r592889 : r592899;
        double r592901 = r592852 ? r592880 : r592900;
        return r592901;
}

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.8
Target15.6
Herbie12.2
\[\begin{array}{l} \mathbf{if}\;t \lt -8.1209789191959122 \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.7125538182184851 \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.63353334603158369 \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 x < -8.051588161419305e-225 or -3.868562991029358e-265 < x < -2.3371425092016802e-267 or 3.4504982266878486e-228 < x

    1. Initial program 10.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. Simplified10.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}\]
    3. Using strategy rm
    4. Applied prod-diff10.7

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

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

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

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

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

    if -8.051588161419305e-225 < x < -3.868562991029358e-265

    1. Initial program 18.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. Simplified18.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}\]
    3. Taylor expanded around inf 32.1

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

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

    if -2.3371425092016802e-267 < x < 3.4504982266878486e-228

    1. Initial program 16.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. Simplified16.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)}\]
    3. Using strategy rm
    4. Applied prod-diff16.9

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(\mathsf{fma}\left(c, z, -a \cdot i\right) + \mathsf{fma}\left(-a, i, a \cdot i\right)\right)}\right)\]
    5. Applied distribute-rgt-in16.9

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

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \color{blue}{\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b}\right)\]
    7. Taylor expanded around 0 15.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -8.0515881614193051 \cdot 10^{-225}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{elif}\;x \le -3.86856299102935799 \cdot 10^{-265}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{elif}\;x \le -2.33714250920168024 \cdot 10^{-267}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{elif}\;x \le 3.45049822668784865 \cdot 10^{-228}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(0 - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot \mathsf{fma}\left(y, z, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020020 +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.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)))))