Average Error: 11.9 → 12.1
Time: 20.7s
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)\]
\[\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, y \cdot \left(x \cdot z\right) - \left(\sqrt[3]{a} \cdot \left(t \cdot x\right)\right) \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right)\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)
\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right), b, y \cdot \left(x \cdot z\right) - \left(\sqrt[3]{a} \cdot \left(t \cdot x\right)\right) \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r9403393 = x;
        double r9403394 = y;
        double r9403395 = z;
        double r9403396 = r9403394 * r9403395;
        double r9403397 = t;
        double r9403398 = a;
        double r9403399 = r9403397 * r9403398;
        double r9403400 = r9403396 - r9403399;
        double r9403401 = r9403393 * r9403400;
        double r9403402 = b;
        double r9403403 = c;
        double r9403404 = r9403403 * r9403395;
        double r9403405 = i;
        double r9403406 = r9403405 * r9403398;
        double r9403407 = r9403404 - r9403406;
        double r9403408 = r9403402 * r9403407;
        double r9403409 = r9403401 - r9403408;
        double r9403410 = j;
        double r9403411 = r9403403 * r9403397;
        double r9403412 = r9403405 * r9403394;
        double r9403413 = r9403411 - r9403412;
        double r9403414 = r9403410 * r9403413;
        double r9403415 = r9403409 + r9403414;
        return r9403415;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r9403416 = t;
        double r9403417 = c;
        double r9403418 = r9403416 * r9403417;
        double r9403419 = i;
        double r9403420 = y;
        double r9403421 = r9403419 * r9403420;
        double r9403422 = r9403418 - r9403421;
        double r9403423 = j;
        double r9403424 = a;
        double r9403425 = -r9403417;
        double r9403426 = z;
        double r9403427 = r9403425 * r9403426;
        double r9403428 = fma(r9403419, r9403424, r9403427);
        double r9403429 = b;
        double r9403430 = x;
        double r9403431 = r9403430 * r9403426;
        double r9403432 = r9403420 * r9403431;
        double r9403433 = cbrt(r9403424);
        double r9403434 = r9403416 * r9403430;
        double r9403435 = r9403433 * r9403434;
        double r9403436 = r9403433 * r9403433;
        double r9403437 = r9403435 * r9403436;
        double r9403438 = r9403432 - r9403437;
        double r9403439 = fma(r9403428, r9403429, r9403438);
        double r9403440 = fma(r9403422, r9403423, r9403439);
        return r9403440;
}

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.6
Herbie12.1
\[\begin{array}{l} \mathbf{if}\;t \lt -8.120978919195912 \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.712553818218485 \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.633533346031584 \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. Initial program 11.9

    \[\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.9

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

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

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

    \[\leadsto \mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(\mathsf{fma}\left(i, a, -z \cdot c\right), b, \color{blue}{x \cdot \left(z \cdot y\right) - a \cdot \left(x \cdot t\right)}\right)\right)\]
  7. Using strategy rm
  8. Applied associate-*r*11.9

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

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

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

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

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"

  :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)))))