Average Error: 12.4 → 11.3
Time: 20.2s
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}\;y \le -9.59415701208647555 \cdot 10^{45} \lor \neg \left(y \le 53346.347301601709\right):\\ \;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, y \cdot \left(x \cdot z - i \cdot j\right) - t \cdot \left(x \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}\\ \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}\;y \le -9.59415701208647555 \cdot 10^{45} \lor \neg \left(y \le 53346.347301601709\right):\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, y \cdot \left(x \cdot z - i \cdot j\right) - t \cdot \left(x \cdot a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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)}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r700606 = x;
        double r700607 = y;
        double r700608 = z;
        double r700609 = r700607 * r700608;
        double r700610 = t;
        double r700611 = a;
        double r700612 = r700610 * r700611;
        double r700613 = r700609 - r700612;
        double r700614 = r700606 * r700613;
        double r700615 = b;
        double r700616 = c;
        double r700617 = r700616 * r700608;
        double r700618 = i;
        double r700619 = r700618 * r700611;
        double r700620 = r700617 - r700619;
        double r700621 = r700615 * r700620;
        double r700622 = r700614 - r700621;
        double r700623 = j;
        double r700624 = r700616 * r700610;
        double r700625 = r700618 * r700607;
        double r700626 = r700624 - r700625;
        double r700627 = r700623 * r700626;
        double r700628 = r700622 + r700627;
        return r700628;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r700629 = y;
        double r700630 = -9.594157012086476e+45;
        bool r700631 = r700629 <= r700630;
        double r700632 = 53346.34730160171;
        bool r700633 = r700629 <= r700632;
        double r700634 = !r700633;
        bool r700635 = r700631 || r700634;
        double r700636 = i;
        double r700637 = a;
        double r700638 = r700636 * r700637;
        double r700639 = c;
        double r700640 = z;
        double r700641 = r700639 * r700640;
        double r700642 = r700638 - r700641;
        double r700643 = b;
        double r700644 = x;
        double r700645 = r700644 * r700640;
        double r700646 = j;
        double r700647 = r700636 * r700646;
        double r700648 = r700645 - r700647;
        double r700649 = r700629 * r700648;
        double r700650 = t;
        double r700651 = r700644 * r700637;
        double r700652 = r700650 * r700651;
        double r700653 = r700649 - r700652;
        double r700654 = fma(r700642, r700643, r700653);
        double r700655 = r700639 * r700650;
        double r700656 = r700636 * r700629;
        double r700657 = r700655 - r700656;
        double r700658 = r700629 * r700640;
        double r700659 = r700650 * r700637;
        double r700660 = r700658 - r700659;
        double r700661 = r700644 * r700660;
        double r700662 = fma(r700646, r700657, r700661);
        double r700663 = fma(r700642, r700643, r700662);
        double r700664 = cbrt(r700663);
        double r700665 = r700664 * r700664;
        double r700666 = r700665 * r700664;
        double r700667 = r700635 ? r700654 : r700666;
        return r700667;
}

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.2
Herbie11.3
\[\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 y < -9.594157012086476e+45 or 53346.34730160171 < y

    1. Initial program 17.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. Simplified17.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 sub-neg17.6

      \[\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-in17.6

      \[\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. Simplified17.6

      \[\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. Using strategy rm
    8. Applied associate-*r*13.3

      \[\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} + x \cdot \left(-t \cdot a\right)\right)\right)\]
    9. Taylor expanded around inf 21.8

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

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

    if -9.594157012086476e+45 < y < 53346.34730160171

    1. Initial program 9.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. Simplified9.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-cbrt10.5

      \[\leadsto \color{blue}{\left(\sqrt[3]{\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)} \cdot \sqrt[3]{\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)}\right) \cdot \sqrt[3]{\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. Recombined 2 regimes into one program.
  4. Final simplification11.3

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

Reproduce

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