Average Error: 12.1 → 12.1
Time: 12.3s
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(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot 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(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot 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 r566746 = x;
        double r566747 = y;
        double r566748 = z;
        double r566749 = r566747 * r566748;
        double r566750 = t;
        double r566751 = a;
        double r566752 = r566750 * r566751;
        double r566753 = r566749 - r566752;
        double r566754 = r566746 * r566753;
        double r566755 = b;
        double r566756 = c;
        double r566757 = r566756 * r566748;
        double r566758 = i;
        double r566759 = r566758 * r566751;
        double r566760 = r566757 - r566759;
        double r566761 = r566755 * r566760;
        double r566762 = r566754 - r566761;
        double r566763 = j;
        double r566764 = r566756 * r566750;
        double r566765 = r566758 * r566747;
        double r566766 = r566764 - r566765;
        double r566767 = r566763 * r566766;
        double r566768 = r566762 + r566767;
        return r566768;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r566769 = x;
        double r566770 = -2.8874577549273917e-157;
        bool r566771 = r566769 <= r566770;
        double r566772 = 1.482328301763721e-217;
        bool r566773 = r566769 <= r566772;
        double r566774 = !r566773;
        bool r566775 = r566771 || r566774;
        double r566776 = c;
        double r566777 = t;
        double r566778 = r566776 * r566777;
        double r566779 = i;
        double r566780 = y;
        double r566781 = r566779 * r566780;
        double r566782 = r566778 - r566781;
        double r566783 = cbrt(r566782);
        double r566784 = r566783 * r566783;
        double r566785 = r566784 * r566783;
        double r566786 = j;
        double r566787 = z;
        double r566788 = r566780 * r566787;
        double r566789 = a;
        double r566790 = r566777 * r566789;
        double r566791 = r566788 - r566790;
        double r566792 = r566769 * r566791;
        double r566793 = b;
        double r566794 = r566776 * r566787;
        double r566795 = r566779 * r566789;
        double r566796 = r566794 - r566795;
        double r566797 = r566793 * r566796;
        double r566798 = r566792 - r566797;
        double r566799 = fma(r566785, r566786, r566798);
        double r566800 = r566782 * r566786;
        double r566801 = cbrt(r566769);
        double r566802 = r566801 * r566801;
        double r566803 = 0.0;
        double r566804 = r566802 * r566803;
        double r566805 = -r566789;
        double r566806 = r566789 * r566779;
        double r566807 = fma(r566805, r566779, r566806);
        double r566808 = r566793 * r566807;
        double r566809 = r566797 + r566808;
        double r566810 = r566804 - r566809;
        double r566811 = r566800 + r566810;
        double r566812 = r566775 ? r566799 : r566811;
        return r566812;
}

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. Using strategy rm
    10. Applied add-cube-cbrt17.9

      \[\leadsto \left(c \cdot t - i \cdot y\right) \cdot j + \left(\color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \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)\]
    11. Applied associate-*l*17.9

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

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