Average Error: 11.7 → 11.8
Time: 22.6s
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}\;t \le -2.367661608120388025318137240788140406435 \cdot 10^{-200} \lor \neg \left(t \le 9.179223912689475909641589588989790289098 \cdot 10^{-246}\right):\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\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}\;t \le -2.367661608120388025318137240788140406435 \cdot 10^{-200} \lor \neg \left(t \le 9.179223912689475909641589588989790289098 \cdot 10^{-246}\right):\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\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 r370814 = x;
        double r370815 = y;
        double r370816 = z;
        double r370817 = r370815 * r370816;
        double r370818 = t;
        double r370819 = a;
        double r370820 = r370818 * r370819;
        double r370821 = r370817 - r370820;
        double r370822 = r370814 * r370821;
        double r370823 = b;
        double r370824 = c;
        double r370825 = r370824 * r370816;
        double r370826 = i;
        double r370827 = r370826 * r370819;
        double r370828 = r370825 - r370827;
        double r370829 = r370823 * r370828;
        double r370830 = r370822 - r370829;
        double r370831 = j;
        double r370832 = r370824 * r370818;
        double r370833 = r370826 * r370815;
        double r370834 = r370832 - r370833;
        double r370835 = r370831 * r370834;
        double r370836 = r370830 + r370835;
        return r370836;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r370837 = t;
        double r370838 = -2.367661608120388e-200;
        bool r370839 = r370837 <= r370838;
        double r370840 = 9.179223912689476e-246;
        bool r370841 = r370837 <= r370840;
        double r370842 = !r370841;
        bool r370843 = r370839 || r370842;
        double r370844 = x;
        double r370845 = y;
        double r370846 = z;
        double r370847 = r370845 * r370846;
        double r370848 = a;
        double r370849 = r370837 * r370848;
        double r370850 = r370847 - r370849;
        double r370851 = b;
        double r370852 = i;
        double r370853 = r370852 * r370848;
        double r370854 = c;
        double r370855 = r370854 * r370846;
        double r370856 = r370853 - r370855;
        double r370857 = j;
        double r370858 = r370857 * r370854;
        double r370859 = r370858 * r370837;
        double r370860 = r370845 * r370857;
        double r370861 = r370852 * r370860;
        double r370862 = -r370861;
        double r370863 = r370859 + r370862;
        double r370864 = fma(r370851, r370856, r370863);
        double r370865 = fma(r370844, r370850, r370864);
        double r370866 = r370846 * r370854;
        double r370867 = -r370866;
        double r370868 = fma(r370852, r370848, r370867);
        double r370869 = r370854 * r370837;
        double r370870 = r370852 * r370845;
        double r370871 = r370869 - r370870;
        double r370872 = r370857 * r370871;
        double r370873 = fma(r370851, r370868, r370872);
        double r370874 = fma(r370844, r370850, r370873);
        double r370875 = cbrt(r370874);
        double r370876 = r370875 * r370875;
        double r370877 = r370876 * r370875;
        double r370878 = r370843 ? r370865 : r370877;
        return r370878;
}

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

Original11.7
Target15.6
Herbie11.8
\[\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 2 regimes
  2. if t < -2.367661608120388e-200 or 9.179223912689476e-246 < t

    1. Initial program 12.4

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t\right) + \color{blue}{\left(-i \cdot \left(y \cdot j\right)\right)}\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*12.3

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

    if -2.367661608120388e-200 < t < 9.179223912689476e-246

    1. Initial program 8.4

      \[\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. Simplified8.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.367661608120388025318137240788140406435 \cdot 10^{-200} \lor \neg \left(t \le 9.179223912689475909641589588989790289098 \cdot 10^{-246}\right):\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot c\right) \cdot t + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \mathsf{fma}\left(i, a, -z \cdot c\right), j \cdot \left(c \cdot t - i \cdot y\right)\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019305 +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.1209789191959122e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.7125538182184851e-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.63353334603158369e-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)))))