Average Error: 11.9 → 11.3
Time: 14.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}\;j \le -4.8165491942895943 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right)\\ \mathbf{elif}\;j \le 1.667884624892982 \cdot 10^{-102}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, y \cdot \left(x \cdot z - i \cdot j\right) - a \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(y \cdot z\right) \cdot x + \left(-t \cdot \left(x \cdot a\right)\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}\;j \le -4.8165491942895943 \cdot 10^{-263}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(y \cdot z\right) \cdot x + \left(-t \cdot \left(x \cdot a\right)\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 r546927 = x;
        double r546928 = y;
        double r546929 = z;
        double r546930 = r546928 * r546929;
        double r546931 = t;
        double r546932 = a;
        double r546933 = r546931 * r546932;
        double r546934 = r546930 - r546933;
        double r546935 = r546927 * r546934;
        double r546936 = b;
        double r546937 = c;
        double r546938 = r546937 * r546929;
        double r546939 = i;
        double r546940 = r546939 * r546932;
        double r546941 = r546938 - r546940;
        double r546942 = r546936 * r546941;
        double r546943 = r546935 - r546942;
        double r546944 = j;
        double r546945 = r546937 * r546931;
        double r546946 = r546939 * r546928;
        double r546947 = r546945 - r546946;
        double r546948 = r546944 * r546947;
        double r546949 = r546943 + r546948;
        return r546949;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r546950 = j;
        double r546951 = -4.816549194289594e-263;
        bool r546952 = r546950 <= r546951;
        double r546953 = i;
        double r546954 = a;
        double r546955 = r546953 * r546954;
        double r546956 = c;
        double r546957 = z;
        double r546958 = r546956 * r546957;
        double r546959 = r546955 - r546958;
        double r546960 = b;
        double r546961 = t;
        double r546962 = r546956 * r546961;
        double r546963 = y;
        double r546964 = r546953 * r546963;
        double r546965 = r546962 - r546964;
        double r546966 = x;
        double r546967 = r546963 * r546957;
        double r546968 = r546961 * r546954;
        double r546969 = r546967 - r546968;
        double r546970 = cbrt(r546969);
        double r546971 = r546970 * r546970;
        double r546972 = r546966 * r546971;
        double r546973 = r546972 * r546970;
        double r546974 = fma(r546950, r546965, r546973);
        double r546975 = fma(r546959, r546960, r546974);
        double r546976 = 1.667884624892982e-102;
        bool r546977 = r546950 <= r546976;
        double r546978 = r546966 * r546957;
        double r546979 = r546953 * r546950;
        double r546980 = r546978 - r546979;
        double r546981 = r546963 * r546980;
        double r546982 = r546966 * r546961;
        double r546983 = r546954 * r546982;
        double r546984 = r546981 - r546983;
        double r546985 = fma(r546959, r546960, r546984);
        double r546986 = r546967 * r546966;
        double r546987 = r546966 * r546954;
        double r546988 = r546961 * r546987;
        double r546989 = -r546988;
        double r546990 = r546986 + r546989;
        double r546991 = fma(r546950, r546965, r546990);
        double r546992 = fma(r546959, r546960, r546991);
        double r546993 = r546977 ? r546985 : r546992;
        double r546994 = r546952 ? r546975 : r546993;
        return r546994;
}

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.4
Herbie11.3
\[\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 j < -4.816549194289594e-263

    1. Initial program 11.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. Simplified11.1

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

      \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \color{blue}{\left(\left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)}\right)\right)\]
    5. Applied associate-*r*11.4

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

    if -4.816549194289594e-263 < j < 1.667884624892982e-102

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

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

      \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \color{blue}{\left(\left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)}\right)\right)\]
    5. Applied associate-*r*17.0

      \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \color{blue}{\left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}}\right)\right)\]
    6. Using strategy rm
    7. Applied add-cube-cbrt17.0

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

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

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

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

    if 1.667884624892982e-102 < j

    1. Initial program 8.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. Simplified8.6

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -4.8165491942895943 \cdot 10^{-263}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right)\\ \mathbf{elif}\;j \le 1.667884624892982 \cdot 10^{-102}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, y \cdot \left(x \cdot z - i \cdot j\right) - a \cdot \left(x \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(y \cdot z\right) \cdot x + \left(-t \cdot \left(x \cdot a\right)\right)\right)\right)\\ \end{array}\]

Reproduce

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