Average Error: 11.9 → 9.1
Time: 22.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)\]
\[\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(x \cdot z\right) \cdot y + \left(-\left(x \cdot a\right) \cdot t\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}\;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(x \cdot z\right) \cdot y + \left(-\left(x \cdot a\right) \cdot t\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 r615216 = x;
        double r615217 = y;
        double r615218 = z;
        double r615219 = r615217 * r615218;
        double r615220 = t;
        double r615221 = a;
        double r615222 = r615220 * r615221;
        double r615223 = r615219 - r615222;
        double r615224 = r615216 * r615223;
        double r615225 = b;
        double r615226 = c;
        double r615227 = r615226 * r615218;
        double r615228 = i;
        double r615229 = r615228 * r615221;
        double r615230 = r615227 - r615229;
        double r615231 = r615225 * r615230;
        double r615232 = r615224 - r615231;
        double r615233 = j;
        double r615234 = r615226 * r615220;
        double r615235 = r615228 * r615217;
        double r615236 = r615234 - r615235;
        double r615237 = r615233 * r615236;
        double r615238 = r615232 + r615237;
        return r615238;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r615239 = x;
        double r615240 = -9.624271263026334e+52;
        bool r615241 = r615239 <= r615240;
        double r615242 = 7.241200350609471e+55;
        bool r615243 = r615239 <= r615242;
        double r615244 = !r615243;
        bool r615245 = r615241 || r615244;
        double r615246 = i;
        double r615247 = a;
        double r615248 = r615246 * r615247;
        double r615249 = c;
        double r615250 = z;
        double r615251 = r615249 * r615250;
        double r615252 = r615248 - r615251;
        double r615253 = b;
        double r615254 = j;
        double r615255 = t;
        double r615256 = r615249 * r615255;
        double r615257 = y;
        double r615258 = r615246 * r615257;
        double r615259 = r615256 - r615258;
        double r615260 = r615257 * r615250;
        double r615261 = r615255 * r615247;
        double r615262 = r615260 - r615261;
        double r615263 = cbrt(r615262);
        double r615264 = r615263 * r615263;
        double r615265 = r615239 * r615264;
        double r615266 = r615265 * r615263;
        double r615267 = fma(r615254, r615259, r615266);
        double r615268 = fma(r615252, r615253, r615267);
        double r615269 = r615239 * r615250;
        double r615270 = r615269 * r615257;
        double r615271 = r615239 * r615247;
        double r615272 = r615271 * r615255;
        double r615273 = -r615272;
        double r615274 = r615270 + r615273;
        double r615275 = fma(r615254, r615259, r615274);
        double r615276 = fma(r615252, r615253, r615275);
        double r615277 = r615245 ? r615268 : r615276;
        return r615277;
}

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 associate-*r*12.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(a \cdot x\right) \cdot t}\right)\right)\right)\]
    10. 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(x \cdot a\right)} \cdot t\right)\right)\right)\]
    11. Using strategy rm
    12. 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(x \cdot a\right) \cdot t\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(x \cdot z\right) \cdot y + \left(-\left(x \cdot a\right) \cdot t\right)\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)))))