Average Error: 12.1 → 12.1
Time: 14.8s
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 -2.88745775492739174 \cdot 10^{-157} \lor \neg \left(x \le 1.4823283017637211 \cdot 10^{-217}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right) \cdot \sqrt[3]{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)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j + \left(0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\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 -2.88745775492739174 \cdot 10^{-157} \lor \neg \left(x \le 1.4823283017637211 \cdot 10^{-217}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right) \cdot \sqrt[3]{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)\\

\mathbf{else}:\\
\;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j + \left(0 - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\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 r585582 = x;
        double r585583 = y;
        double r585584 = z;
        double r585585 = r585583 * r585584;
        double r585586 = t;
        double r585587 = a;
        double r585588 = r585586 * r585587;
        double r585589 = r585585 - r585588;
        double r585590 = r585582 * r585589;
        double r585591 = b;
        double r585592 = c;
        double r585593 = r585592 * r585584;
        double r585594 = i;
        double r585595 = r585594 * r585587;
        double r585596 = r585593 - r585595;
        double r585597 = r585591 * r585596;
        double r585598 = r585590 - r585597;
        double r585599 = j;
        double r585600 = r585592 * r585586;
        double r585601 = r585594 * r585583;
        double r585602 = r585600 - r585601;
        double r585603 = r585599 * r585602;
        double r585604 = r585598 + r585603;
        return r585604;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r585605 = x;
        double r585606 = -2.8874577549273917e-157;
        bool r585607 = r585605 <= r585606;
        double r585608 = 1.482328301763721e-217;
        bool r585609 = r585605 <= r585608;
        double r585610 = !r585609;
        bool r585611 = r585607 || r585610;
        double r585612 = c;
        double r585613 = t;
        double r585614 = r585612 * r585613;
        double r585615 = i;
        double r585616 = y;
        double r585617 = r585615 * r585616;
        double r585618 = r585614 - r585617;
        double r585619 = cbrt(r585618);
        double r585620 = r585619 * r585619;
        double r585621 = r585620 * r585619;
        double r585622 = j;
        double r585623 = z;
        double r585624 = r585616 * r585623;
        double r585625 = a;
        double r585626 = r585613 * r585625;
        double r585627 = r585624 - r585626;
        double r585628 = r585605 * r585627;
        double r585629 = b;
        double r585630 = r585612 * r585623;
        double r585631 = r585615 * r585625;
        double r585632 = r585630 - r585631;
        double r585633 = r585629 * r585632;
        double r585634 = r585628 - r585633;
        double r585635 = fma(r585621, r585622, r585634);
        double r585636 = r585618 * r585622;
        double r585637 = 0.0;
        double r585638 = -r585625;
        double r585639 = r585625 * r585615;
        double r585640 = fma(r585638, r585615, r585639);
        double r585641 = r585629 * r585640;
        double r585642 = r585633 + r585641;
        double r585643 = r585637 - r585642;
        double r585644 = r585636 + r585643;
        double r585645 = r585611 ? r585635 : r585644;
        return r585645;
}

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.1
Target15.8
Herbie12.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 < -2.8874577549273917e-157 or 1.482328301763721e-217 < x

    1. Initial program 10.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. Simplified10.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. Using strategy rm
    4. Applied add-cube-cbrt10.4

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

    if -2.8874577549273917e-157 < x < 1.482328301763721e-217

    1. Initial program 17.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. Simplified17.9

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

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

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

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

      \[\leadsto \color{blue}{\left(c \cdot t - i \cdot y\right) \cdot j + \left(x \cdot \left(y \cdot z - t \cdot a\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. Taylor expanded around 0 17.3

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

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

Reproduce

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