Average Error: 12.3 → 11.6
Time: 30.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}\;b \le -2.168636168951270619647828301902041552146 \cdot 10^{-121}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right), j, \mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(y \cdot z - a \cdot t\right) \cdot x\right)\right)\\ \mathbf{elif}\;b \le 2.834566076854457058584443196390534364264 \cdot 10^{-71}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(y \cdot z - a \cdot t\right) \cdot x - z \cdot \left(c \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right), j, \mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(y \cdot z - a \cdot t\right) \cdot x\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}\;b \le -2.168636168951270619647828301902041552146 \cdot 10^{-121}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right), j, \mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(y \cdot z - a \cdot t\right) \cdot x\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right), j, \mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(y \cdot z - a \cdot t\right) \cdot x\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 r21519133 = x;
        double r21519134 = y;
        double r21519135 = z;
        double r21519136 = r21519134 * r21519135;
        double r21519137 = t;
        double r21519138 = a;
        double r21519139 = r21519137 * r21519138;
        double r21519140 = r21519136 - r21519139;
        double r21519141 = r21519133 * r21519140;
        double r21519142 = b;
        double r21519143 = c;
        double r21519144 = r21519143 * r21519135;
        double r21519145 = i;
        double r21519146 = r21519145 * r21519138;
        double r21519147 = r21519144 - r21519146;
        double r21519148 = r21519142 * r21519147;
        double r21519149 = r21519141 - r21519148;
        double r21519150 = j;
        double r21519151 = r21519143 * r21519137;
        double r21519152 = r21519145 * r21519134;
        double r21519153 = r21519151 - r21519152;
        double r21519154 = r21519150 * r21519153;
        double r21519155 = r21519149 + r21519154;
        return r21519155;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r21519156 = b;
        double r21519157 = -2.1686361689512706e-121;
        bool r21519158 = r21519156 <= r21519157;
        double r21519159 = t;
        double r21519160 = c;
        double r21519161 = r21519159 * r21519160;
        double r21519162 = y;
        double r21519163 = i;
        double r21519164 = r21519162 * r21519163;
        double r21519165 = r21519161 - r21519164;
        double r21519166 = cbrt(r21519165);
        double r21519167 = r21519166 * r21519166;
        double r21519168 = r21519166 * r21519167;
        double r21519169 = j;
        double r21519170 = a;
        double r21519171 = r21519170 * r21519163;
        double r21519172 = z;
        double r21519173 = r21519172 * r21519160;
        double r21519174 = r21519171 - r21519173;
        double r21519175 = r21519162 * r21519172;
        double r21519176 = r21519170 * r21519159;
        double r21519177 = r21519175 - r21519176;
        double r21519178 = x;
        double r21519179 = r21519177 * r21519178;
        double r21519180 = fma(r21519156, r21519174, r21519179);
        double r21519181 = fma(r21519168, r21519169, r21519180);
        double r21519182 = 2.834566076854457e-71;
        bool r21519183 = r21519156 <= r21519182;
        double r21519184 = r21519160 * r21519156;
        double r21519185 = r21519172 * r21519184;
        double r21519186 = r21519179 - r21519185;
        double r21519187 = fma(r21519165, r21519169, r21519186);
        double r21519188 = r21519183 ? r21519187 : r21519181;
        double r21519189 = r21519158 ? r21519181 : r21519188;
        return r21519189;
}

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.3
Target16.1
Herbie11.6
\[\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 b < -2.1686361689512706e-121 or 2.834566076854457e-71 < b

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

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

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

    if -2.1686361689512706e-121 < b < 2.834566076854457e-71

    1. Initial program 16.0

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

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

      \[\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. Simplified14.1

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

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

Reproduce

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