Average Error: 12.2 → 13.9
Time: 33.5s
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}\;c \le -8268102197384482988509626368:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, z \cdot \left(x \cdot y - b \cdot c\right) - x \cdot \left(t \cdot a\right)\right)\\ \mathbf{elif}\;c \le -6.535140165540710269045334632618486765212 \cdot 10^{-32}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(i \cdot a - c \cdot z, b, 0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(\sqrt[3]{i \cdot a - c \cdot z} \cdot \left(\sqrt[3]{i \cdot a - c \cdot z} \cdot \sqrt[3]{i \cdot a - c \cdot z}\right), b, x \cdot \left(z \cdot y - t \cdot a\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}\;c \le -8268102197384482988509626368:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, z \cdot \left(x \cdot y - b \cdot c\right) - x \cdot \left(t \cdot a\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(\sqrt[3]{i \cdot a - c \cdot z} \cdot \left(\sqrt[3]{i \cdot a - c \cdot z} \cdot \sqrt[3]{i \cdot a - c \cdot z}\right), b, x \cdot \left(z \cdot y - t \cdot a\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 r26266559 = x;
        double r26266560 = y;
        double r26266561 = z;
        double r26266562 = r26266560 * r26266561;
        double r26266563 = t;
        double r26266564 = a;
        double r26266565 = r26266563 * r26266564;
        double r26266566 = r26266562 - r26266565;
        double r26266567 = r26266559 * r26266566;
        double r26266568 = b;
        double r26266569 = c;
        double r26266570 = r26266569 * r26266561;
        double r26266571 = i;
        double r26266572 = r26266571 * r26266564;
        double r26266573 = r26266570 - r26266572;
        double r26266574 = r26266568 * r26266573;
        double r26266575 = r26266567 - r26266574;
        double r26266576 = j;
        double r26266577 = r26266569 * r26266563;
        double r26266578 = r26266571 * r26266560;
        double r26266579 = r26266577 - r26266578;
        double r26266580 = r26266576 * r26266579;
        double r26266581 = r26266575 + r26266580;
        return r26266581;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r26266582 = c;
        double r26266583 = -8.268102197384483e+27;
        bool r26266584 = r26266582 <= r26266583;
        double r26266585 = t;
        double r26266586 = r26266585 * r26266582;
        double r26266587 = i;
        double r26266588 = y;
        double r26266589 = r26266587 * r26266588;
        double r26266590 = r26266586 - r26266589;
        double r26266591 = j;
        double r26266592 = z;
        double r26266593 = x;
        double r26266594 = r26266593 * r26266588;
        double r26266595 = b;
        double r26266596 = r26266595 * r26266582;
        double r26266597 = r26266594 - r26266596;
        double r26266598 = r26266592 * r26266597;
        double r26266599 = a;
        double r26266600 = r26266585 * r26266599;
        double r26266601 = r26266593 * r26266600;
        double r26266602 = r26266598 - r26266601;
        double r26266603 = fma(r26266590, r26266591, r26266602);
        double r26266604 = -6.53514016554071e-32;
        bool r26266605 = r26266582 <= r26266604;
        double r26266606 = r26266587 * r26266599;
        double r26266607 = r26266582 * r26266592;
        double r26266608 = r26266606 - r26266607;
        double r26266609 = 0.0;
        double r26266610 = fma(r26266608, r26266595, r26266609);
        double r26266611 = fma(r26266590, r26266591, r26266610);
        double r26266612 = cbrt(r26266608);
        double r26266613 = r26266612 * r26266612;
        double r26266614 = r26266612 * r26266613;
        double r26266615 = r26266592 * r26266588;
        double r26266616 = r26266615 - r26266600;
        double r26266617 = r26266593 * r26266616;
        double r26266618 = fma(r26266614, r26266595, r26266617);
        double r26266619 = fma(r26266590, r26266591, r26266618);
        double r26266620 = r26266605 ? r26266611 : r26266619;
        double r26266621 = r26266584 ? r26266603 : r26266620;
        return r26266621;
}

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.2
Target16.1
Herbie13.9
\[\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 c < -8.268102197384483e+27

    1. Initial program 16.8

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

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

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

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

    if -8.268102197384483e+27 < c < -6.53514016554071e-32

    1. Initial program 10.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. Simplified10.6

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

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

    if -6.53514016554071e-32 < c

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019170 +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.0) (pow (* i y) 2.0))) (+ (* 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.0) (pow (* i y) 2.0))) (+ (* 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)))))