Average Error: 12.4 → 12.3
Time: 12.0s
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}\;a \le -2.329574615195142828419975702711333531113 \cdot 10^{-268}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot y\right) \cdot z + 1 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot t\right)\right)\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)\\ \mathbf{elif}\;a \le 1.622426989727679313206537450117033416418 \cdot 10^{122}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z\right)\right) + x \cdot \left(-t \cdot a\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)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \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}\;a \le -2.329574615195142828419975702711333531113 \cdot 10^{-268}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot y\right) \cdot z + 1 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot t\right)\right)\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)\\

\mathbf{elif}\;a \le 1.622426989727679313206537450117033416418 \cdot 10^{122}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z\right)\right) + x \cdot \left(-t \cdot a\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)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \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 r483528 = x;
        double r483529 = y;
        double r483530 = z;
        double r483531 = r483529 * r483530;
        double r483532 = t;
        double r483533 = a;
        double r483534 = r483532 * r483533;
        double r483535 = r483531 - r483534;
        double r483536 = r483528 * r483535;
        double r483537 = b;
        double r483538 = c;
        double r483539 = r483538 * r483530;
        double r483540 = i;
        double r483541 = r483540 * r483533;
        double r483542 = r483539 - r483541;
        double r483543 = r483537 * r483542;
        double r483544 = r483536 - r483543;
        double r483545 = j;
        double r483546 = r483538 * r483532;
        double r483547 = r483540 * r483529;
        double r483548 = r483546 - r483547;
        double r483549 = r483545 * r483548;
        double r483550 = r483544 + r483549;
        return r483550;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r483551 = a;
        double r483552 = -2.3295746151951428e-268;
        bool r483553 = r483551 <= r483552;
        double r483554 = c;
        double r483555 = t;
        double r483556 = r483554 * r483555;
        double r483557 = i;
        double r483558 = y;
        double r483559 = r483557 * r483558;
        double r483560 = r483556 - r483559;
        double r483561 = j;
        double r483562 = x;
        double r483563 = r483562 * r483558;
        double r483564 = z;
        double r483565 = r483563 * r483564;
        double r483566 = 1.0;
        double r483567 = -1.0;
        double r483568 = r483562 * r483555;
        double r483569 = r483551 * r483568;
        double r483570 = r483567 * r483569;
        double r483571 = r483566 * r483570;
        double r483572 = r483565 + r483571;
        double r483573 = b;
        double r483574 = r483554 * r483564;
        double r483575 = r483557 * r483551;
        double r483576 = r483574 - r483575;
        double r483577 = r483573 * r483576;
        double r483578 = -r483551;
        double r483579 = r483551 * r483557;
        double r483580 = fma(r483578, r483557, r483579);
        double r483581 = r483573 * r483580;
        double r483582 = r483577 + r483581;
        double r483583 = r483572 - r483582;
        double r483584 = fma(r483560, r483561, r483583);
        double r483585 = 1.6224269897276793e+122;
        bool r483586 = r483551 <= r483585;
        double r483587 = cbrt(r483562);
        double r483588 = r483587 * r483587;
        double r483589 = r483558 * r483564;
        double r483590 = r483587 * r483589;
        double r483591 = r483588 * r483590;
        double r483592 = r483555 * r483551;
        double r483593 = -r483592;
        double r483594 = r483562 * r483593;
        double r483595 = r483591 + r483594;
        double r483596 = r483595 - r483582;
        double r483597 = fma(r483560, r483561, r483596);
        double r483598 = r483557 * r483573;
        double r483599 = r483573 * r483554;
        double r483600 = fma(r483564, r483599, r483569);
        double r483601 = -r483600;
        double r483602 = fma(r483551, r483598, r483601);
        double r483603 = r483586 ? r483597 : r483602;
        double r483604 = r483553 ? r483584 : r483603;
        return r483604;
}

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.4
Target16.1
Herbie12.3
\[\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. Split input into 3 regimes
  2. if a < -2.3295746151951428e-268

    1. Initial program 12.2

      \[\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. Simplified12.2

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

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    5. Applied distribute-lft-in12.2

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    6. Simplified12.2

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    7. Using strategy rm
    8. Applied sub-neg12.2

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \color{blue}{\left(y \cdot z + \left(-t \cdot a\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)\]
    9. Applied distribute-lft-in12.2

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\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)\]
    10. Using strategy rm
    11. Applied associate-*r*12.6

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\color{blue}{\left(x \cdot y\right) \cdot z} + x \cdot \left(-t \cdot a\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)\]
    12. Using strategy rm
    13. Applied *-un-lft-identity12.6

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot y\right) \cdot z + \color{blue}{\left(1 \cdot x\right)} \cdot \left(-t \cdot a\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)\]
    14. Applied associate-*l*12.6

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot y\right) \cdot z + \color{blue}{1 \cdot \left(x \cdot \left(-t \cdot a\right)\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)\]
    15. Simplified12.4

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

    if -2.3295746151951428e-268 < a < 1.6224269897276793e+122

    1. Initial program 10.3

      \[\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. Simplified10.3

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

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    5. Applied distribute-lft-in10.3

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    6. Simplified10.3

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, 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)\]
    7. Using strategy rm
    8. Applied sub-neg10.3

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \color{blue}{\left(y \cdot z + \left(-t \cdot a\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)\]
    9. Applied distribute-lft-in10.3

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

      \[\leadsto \mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\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)\]
    12. Applied associate-*l*10.5

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

    if 1.6224269897276793e+122 < a

    1. Initial program 23.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. Simplified23.1

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

      \[\leadsto \color{blue}{a \cdot \left(i \cdot b\right) - \left(z \cdot \left(b \cdot c\right) + a \cdot \left(x \cdot t\right)\right)}\]
    4. Simplified20.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -2.329574615195142828419975702711333531113 \cdot 10^{-268}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(x \cdot y\right) \cdot z + 1 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot t\right)\right)\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)\\ \mathbf{elif}\;a \le 1.622426989727679313206537450117033416418 \cdot 10^{122}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z\right)\right) + x \cdot \left(-t \cdot a\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)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \end{array}\]

Reproduce

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