Average Error: 11.9 → 9.1
Time: 20.9s
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 -9.62427126302633396 \cdot 10^{52} \lor \neg \left(x \le 7.24120035060947113 \cdot 10^{55}\right):\\ \;\;\;\;\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{else}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(-\left(x \cdot a\right) \cdot t\right) + \left(x \cdot z\right) \cdot y\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}\;x \le -9.62427126302633396 \cdot 10^{52} \lor \neg \left(x \le 7.24120035060947113 \cdot 10^{55}\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(-\left(x \cdot a\right) \cdot t\right) + \left(x \cdot z\right) \cdot y\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 r218067 = x;
        double r218068 = y;
        double r218069 = z;
        double r218070 = r218068 * r218069;
        double r218071 = t;
        double r218072 = a;
        double r218073 = r218071 * r218072;
        double r218074 = r218070 - r218073;
        double r218075 = r218067 * r218074;
        double r218076 = b;
        double r218077 = c;
        double r218078 = r218077 * r218069;
        double r218079 = i;
        double r218080 = r218079 * r218072;
        double r218081 = r218078 - r218080;
        double r218082 = r218076 * r218081;
        double r218083 = r218075 - r218082;
        double r218084 = j;
        double r218085 = r218077 * r218071;
        double r218086 = r218079 * r218068;
        double r218087 = r218085 - r218086;
        double r218088 = r218084 * r218087;
        double r218089 = r218083 + r218088;
        return r218089;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r218090 = x;
        double r218091 = -9.624271263026334e+52;
        bool r218092 = r218090 <= r218091;
        double r218093 = 7.241200350609471e+55;
        bool r218094 = r218090 <= r218093;
        double r218095 = !r218094;
        bool r218096 = r218092 || r218095;
        double r218097 = i;
        double r218098 = a;
        double r218099 = r218097 * r218098;
        double r218100 = c;
        double r218101 = z;
        double r218102 = r218100 * r218101;
        double r218103 = r218099 - r218102;
        double r218104 = b;
        double r218105 = j;
        double r218106 = t;
        double r218107 = r218100 * r218106;
        double r218108 = y;
        double r218109 = r218097 * r218108;
        double r218110 = r218107 - r218109;
        double r218111 = r218108 * r218101;
        double r218112 = r218106 * r218098;
        double r218113 = r218111 - r218112;
        double r218114 = cbrt(r218113);
        double r218115 = r218114 * r218114;
        double r218116 = r218090 * r218115;
        double r218117 = r218116 * r218114;
        double r218118 = fma(r218105, r218110, r218117);
        double r218119 = fma(r218103, r218104, r218118);
        double r218120 = r218090 * r218098;
        double r218121 = r218120 * r218106;
        double r218122 = -r218121;
        double r218123 = r218090 * r218101;
        double r218124 = r218123 * r218108;
        double r218125 = r218122 + r218124;
        double r218126 = fma(r218105, r218110, r218125);
        double r218127 = fma(r218103, r218104, r218126);
        double r218128 = r218096 ? r218119 : r218127;
        return r218128;
}

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
Target16.0
Herbie9.1
\[\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 2 regimes
  2. if x < -9.624271263026334e+52 or 7.241200350609471e+55 < x

    1. Initial program 6.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. Simplified6.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 add-cube-cbrt7.2

      \[\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*7.2

      \[\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 -9.624271263026334e+52 < x < 7.241200350609471e+55

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

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

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

      \[\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(z \cdot y\right)} + x \cdot \left(-t \cdot a\right)\right)\right)\]
    7. Simplified12.1

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, x \cdot \left(z \cdot y\right) + \left(-{\color{blue}{\left(t \cdot \left(x \cdot a\right)\right)}}^{1}\right)\right)\right)\]
    15. Using strategy rm
    16. Applied associate-*r*9.9

      \[\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 z\right) \cdot y} + \left(-{\left(t \cdot \left(x \cdot a\right)\right)}^{1}\right)\right)\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -9.62427126302633396 \cdot 10^{52} \lor \neg \left(x \le 7.24120035060947113 \cdot 10^{55}\right):\\ \;\;\;\;\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{else}:\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(j, c \cdot t - i \cdot y, \left(-\left(x \cdot a\right) \cdot t\right) + \left(x \cdot z\right) \cdot y\right)\right)\\ \end{array}\]

Reproduce

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