Average Error: 12.1 → 12.4
Time: 9.1s
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)\]
\[\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) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\]
\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)
\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) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r446934 = x;
        double r446935 = y;
        double r446936 = z;
        double r446937 = r446935 * r446936;
        double r446938 = t;
        double r446939 = a;
        double r446940 = r446938 * r446939;
        double r446941 = r446937 - r446940;
        double r446942 = r446934 * r446941;
        double r446943 = b;
        double r446944 = c;
        double r446945 = r446944 * r446936;
        double r446946 = i;
        double r446947 = r446946 * r446939;
        double r446948 = r446945 - r446947;
        double r446949 = r446943 * r446948;
        double r446950 = r446942 - r446949;
        double r446951 = j;
        double r446952 = r446944 * r446938;
        double r446953 = r446946 * r446935;
        double r446954 = r446952 - r446953;
        double r446955 = r446951 * r446954;
        double r446956 = r446950 + r446955;
        return r446956;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r446957 = x;
        double r446958 = y;
        double r446959 = z;
        double r446960 = a;
        double r446961 = t;
        double r446962 = r446960 * r446961;
        double r446963 = -r446962;
        double r446964 = fma(r446958, r446959, r446963);
        double r446965 = r446957 * r446964;
        double r446966 = -r446960;
        double r446967 = fma(r446966, r446961, r446962);
        double r446968 = r446957 * r446967;
        double r446969 = r446965 + r446968;
        double r446970 = b;
        double r446971 = c;
        double r446972 = r446971 * r446959;
        double r446973 = i;
        double r446974 = r446973 * r446960;
        double r446975 = r446972 - r446974;
        double r446976 = r446970 * r446975;
        double r446977 = r446960 * r446973;
        double r446978 = fma(r446966, r446973, r446977);
        double r446979 = r446970 * r446978;
        double r446980 = r446976 + r446979;
        double r446981 = r446969 - r446980;
        double r446982 = j;
        double r446983 = r446971 * r446961;
        double r446984 = r446973 * r446958;
        double r446985 = r446983 - r446984;
        double r446986 = r446982 * r446985;
        double r446987 = cbrt(r446986);
        double r446988 = r446987 * r446987;
        double r446989 = r446988 * r446987;
        double r446990 = r446981 + r446989;
        return r446990;
}

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
Target15.9
Herbie12.4
\[\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. Initial program 12.1

    \[\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 prod-diff12.1

    \[\leadsto \left(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) + j \cdot \left(c \cdot t - i \cdot y\right)\]
  4. Applied distribute-lft-in12.1

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

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

    \[\leadsto \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)} - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
  8. Applied distribute-lft-in12.1

    \[\leadsto \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)} - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
  9. Using strategy rm
  10. Applied add-cube-cbrt12.4

    \[\leadsto \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) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \color{blue}{\left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}}\]
  11. Final simplification12.4

    \[\leadsto \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) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\]

Reproduce

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