Average Error: 11.7 → 11.7
Time: 35.9s
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 -3.109685036748723 \cdot 10^{-15}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\\ \mathbf{elif}\;b \le 3.5516828515061712 \cdot 10^{-109}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(y \cdot z - t \cdot a\right) \cdot x - c \cdot \left(z \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\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 -3.109685036748723 \cdot 10^{-15}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\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 r28197142 = x;
        double r28197143 = y;
        double r28197144 = z;
        double r28197145 = r28197143 * r28197144;
        double r28197146 = t;
        double r28197147 = a;
        double r28197148 = r28197146 * r28197147;
        double r28197149 = r28197145 - r28197148;
        double r28197150 = r28197142 * r28197149;
        double r28197151 = b;
        double r28197152 = c;
        double r28197153 = r28197152 * r28197144;
        double r28197154 = i;
        double r28197155 = r28197154 * r28197147;
        double r28197156 = r28197153 - r28197155;
        double r28197157 = r28197151 * r28197156;
        double r28197158 = r28197150 - r28197157;
        double r28197159 = j;
        double r28197160 = r28197152 * r28197146;
        double r28197161 = r28197154 * r28197143;
        double r28197162 = r28197160 - r28197161;
        double r28197163 = r28197159 * r28197162;
        double r28197164 = r28197158 + r28197163;
        return r28197164;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r28197165 = b;
        double r28197166 = -3.109685036748723e-15;
        bool r28197167 = r28197165 <= r28197166;
        double r28197168 = t;
        double r28197169 = c;
        double r28197170 = r28197168 * r28197169;
        double r28197171 = y;
        double r28197172 = i;
        double r28197173 = r28197171 * r28197172;
        double r28197174 = r28197170 - r28197173;
        double r28197175 = j;
        double r28197176 = a;
        double r28197177 = r28197176 * r28197172;
        double r28197178 = z;
        double r28197179 = r28197169 * r28197178;
        double r28197180 = r28197177 - r28197179;
        double r28197181 = r28197171 * r28197178;
        double r28197182 = r28197168 * r28197176;
        double r28197183 = r28197181 - r28197182;
        double r28197184 = x;
        double r28197185 = r28197183 * r28197184;
        double r28197186 = fma(r28197180, r28197165, r28197185);
        double r28197187 = fma(r28197174, r28197175, r28197186);
        double r28197188 = cbrt(r28197187);
        double r28197189 = r28197188 * r28197188;
        double r28197190 = r28197189 * r28197188;
        double r28197191 = 3.5516828515061712e-109;
        bool r28197192 = r28197165 <= r28197191;
        double r28197193 = r28197178 * r28197165;
        double r28197194 = r28197169 * r28197193;
        double r28197195 = r28197185 - r28197194;
        double r28197196 = fma(r28197174, r28197175, r28197195);
        double r28197197 = r28197192 ? r28197196 : r28197190;
        double r28197198 = r28197167 ? r28197190 : r28197197;
        return r28197198;
}

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.7
\[\begin{array}{l} \mathbf{if}\;t \lt -8.120978919195912 \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.712553818218485 \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.633533346031584 \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 b < -3.109685036748723e-15 or 3.5516828515061712e-109 < b

    1. Initial program 8.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. Simplified7.9

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

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

    if -3.109685036748723e-15 < b < 3.5516828515061712e-109

    1. Initial program 15.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. Simplified15.4

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

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

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

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

Reproduce

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