Average Error: 12.1 → 11.0
Time: 31.4s
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}\;t \le -8.726925738034539270507380773704722857084 \cdot 10^{-133} \lor \neg \left(t \le 5.076318876201314174297201710312870570435 \cdot 10^{-117}\right):\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, b \cdot \left(i \cdot a - c \cdot z\right) + \left(\left(-y \cdot \left(i \cdot j\right)\right) + \left(j \cdot c\right) \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\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}\;t \le -8.726925738034539270507380773704722857084 \cdot 10^{-133} \lor \neg \left(t \le 5.076318876201314174297201710312870570435 \cdot 10^{-117}\right):\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, b \cdot \left(i \cdot a - c \cdot z\right) + \left(\left(-y \cdot \left(i \cdot j\right)\right) + \left(j \cdot c\right) \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\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 r368873 = x;
        double r368874 = y;
        double r368875 = z;
        double r368876 = r368874 * r368875;
        double r368877 = t;
        double r368878 = a;
        double r368879 = r368877 * r368878;
        double r368880 = r368876 - r368879;
        double r368881 = r368873 * r368880;
        double r368882 = b;
        double r368883 = c;
        double r368884 = r368883 * r368875;
        double r368885 = i;
        double r368886 = r368885 * r368878;
        double r368887 = r368884 - r368886;
        double r368888 = r368882 * r368887;
        double r368889 = r368881 - r368888;
        double r368890 = j;
        double r368891 = r368883 * r368877;
        double r368892 = r368885 * r368874;
        double r368893 = r368891 - r368892;
        double r368894 = r368890 * r368893;
        double r368895 = r368889 + r368894;
        return r368895;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r368896 = t;
        double r368897 = -8.72692573803454e-133;
        bool r368898 = r368896 <= r368897;
        double r368899 = 5.076318876201314e-117;
        bool r368900 = r368896 <= r368899;
        double r368901 = !r368900;
        bool r368902 = r368898 || r368901;
        double r368903 = x;
        double r368904 = y;
        double r368905 = z;
        double r368906 = r368904 * r368905;
        double r368907 = a;
        double r368908 = r368896 * r368907;
        double r368909 = r368906 - r368908;
        double r368910 = b;
        double r368911 = i;
        double r368912 = r368911 * r368907;
        double r368913 = c;
        double r368914 = r368913 * r368905;
        double r368915 = r368912 - r368914;
        double r368916 = r368910 * r368915;
        double r368917 = j;
        double r368918 = r368911 * r368917;
        double r368919 = r368904 * r368918;
        double r368920 = -r368919;
        double r368921 = r368917 * r368913;
        double r368922 = r368921 * r368896;
        double r368923 = r368920 + r368922;
        double r368924 = r368916 + r368923;
        double r368925 = fma(r368903, r368909, r368924);
        double r368926 = r368913 * r368896;
        double r368927 = r368904 * r368911;
        double r368928 = r368926 - r368927;
        double r368929 = r368917 * r368928;
        double r368930 = fma(r368915, r368910, r368929);
        double r368931 = fma(r368903, r368909, r368930);
        double r368932 = cbrt(r368931);
        double r368933 = r368932 * r368932;
        double r368934 = r368933 * r368932;
        double r368935 = r368902 ? r368925 : r368934;
        return r368935;
}

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.1
Target16.0
Herbie11.0
\[\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 2 regimes
  2. if t < -8.72692573803454e-133 or 5.076318876201314e-117 < t

    1. Initial program 13.8

      \[\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. Simplified13.8

      \[\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. Using strategy rm
    4. Applied sub-neg13.8

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

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

      \[\leadsto \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\right) + \color{blue}{\left(-i \cdot y\right) \cdot j}\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*11.8

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \color{blue}{\left(j \cdot c\right) \cdot t} + \left(-i \cdot y\right) \cdot j\right)\right)\]
    9. Using strategy rm
    10. Applied neg-mul-111.8

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + \color{blue}{\left(-1 \cdot \left(i \cdot y\right)\right)} \cdot j\right)\right)\]
    11. Applied associate-*l*11.8

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

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + -1 \cdot \color{blue}{\left(y \cdot \left(i \cdot j\right)\right)}\right)\right)\]
    13. Using strategy rm
    14. Applied fma-udef11.5

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

    if -8.72692573803454e-133 < t < 5.076318876201314e-117

    1. Initial program 9.2

      \[\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. Simplified9.2

      \[\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. Using strategy rm
    4. Applied sub-neg9.2

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

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

      \[\leadsto \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\right) + \color{blue}{\left(-i \cdot y\right) \cdot j}\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*13.1

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \color{blue}{\left(j \cdot c\right) \cdot t} + \left(-i \cdot y\right) \cdot j\right)\right)\]
    9. Using strategy rm
    10. Applied neg-mul-113.1

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + \color{blue}{\left(-1 \cdot \left(i \cdot y\right)\right)} \cdot j\right)\right)\]
    11. Applied associate-*l*13.1

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

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + -1 \cdot \color{blue}{\left(y \cdot \left(i \cdot j\right)\right)}\right)\right)\]
    13. Using strategy rm
    14. Applied add-cube-cbrt14.1

      \[\leadsto \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + -1 \cdot \left(y \cdot \left(i \cdot j\right)\right)\right)\right)}}\]
    15. Simplified15.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8.726925738034539270507380773704722857084 \cdot 10^{-133} \lor \neg \left(t \le 5.076318876201314174297201710312870570435 \cdot 10^{-117}\right):\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, b \cdot \left(i \cdot a - c \cdot z\right) + \left(\left(-y \cdot \left(i \cdot j\right)\right) + \left(j \cdot c\right) \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(i \cdot a - c \cdot z, b, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\\ \end{array}\]

Reproduce

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