Average Error: 11.9 → 11.2
Time: 41.5s
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.2795782386377772 \cdot 10^{-181}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \le -2.2728874929835057 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \left(y \cdot x - c \cdot b\right) \cdot z - x \cdot \left(t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\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}\;b \le -2.2795782386377772 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\right)\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\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 r26149202 = x;
        double r26149203 = y;
        double r26149204 = z;
        double r26149205 = r26149203 * r26149204;
        double r26149206 = t;
        double r26149207 = a;
        double r26149208 = r26149206 * r26149207;
        double r26149209 = r26149205 - r26149208;
        double r26149210 = r26149202 * r26149209;
        double r26149211 = b;
        double r26149212 = c;
        double r26149213 = r26149212 * r26149204;
        double r26149214 = i;
        double r26149215 = r26149214 * r26149207;
        double r26149216 = r26149213 - r26149215;
        double r26149217 = r26149211 * r26149216;
        double r26149218 = r26149210 - r26149217;
        double r26149219 = j;
        double r26149220 = r26149212 * r26149206;
        double r26149221 = r26149214 * r26149203;
        double r26149222 = r26149220 - r26149221;
        double r26149223 = r26149219 * r26149222;
        double r26149224 = r26149218 + r26149223;
        return r26149224;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r26149225 = b;
        double r26149226 = -2.2795782386377772e-181;
        bool r26149227 = r26149225 <= r26149226;
        double r26149228 = t;
        double r26149229 = c;
        double r26149230 = r26149228 * r26149229;
        double r26149231 = i;
        double r26149232 = y;
        double r26149233 = r26149231 * r26149232;
        double r26149234 = r26149230 - r26149233;
        double r26149235 = j;
        double r26149236 = a;
        double r26149237 = r26149236 * r26149231;
        double r26149238 = z;
        double r26149239 = r26149229 * r26149238;
        double r26149240 = r26149237 - r26149239;
        double r26149241 = r26149228 * r26149236;
        double r26149242 = -r26149241;
        double r26149243 = fma(r26149232, r26149238, r26149242);
        double r26149244 = x;
        double r26149245 = r26149243 * r26149244;
        double r26149246 = -r26149228;
        double r26149247 = fma(r26149246, r26149236, r26149241);
        double r26149248 = r26149244 * r26149247;
        double r26149249 = r26149245 + r26149248;
        double r26149250 = fma(r26149240, r26149225, r26149249);
        double r26149251 = fma(r26149234, r26149235, r26149250);
        double r26149252 = -2.2728874929835057e-303;
        bool r26149253 = r26149225 <= r26149252;
        double r26149254 = r26149232 * r26149244;
        double r26149255 = r26149229 * r26149225;
        double r26149256 = r26149254 - r26149255;
        double r26149257 = r26149256 * r26149238;
        double r26149258 = r26149244 * r26149241;
        double r26149259 = r26149257 - r26149258;
        double r26149260 = fma(r26149234, r26149235, r26149259);
        double r26149261 = r26149253 ? r26149260 : r26149251;
        double r26149262 = r26149227 ? r26149251 : r26149261;
        return r26149262;
}

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.9
Target15.3
Herbie11.2
\[\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 < -2.2795782386377772e-181 or -2.2728874929835057e-303 < b

    1. Initial program 11.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. Simplified11.0

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - z \cdot c, b, \color{blue}{x \cdot \left(y \cdot z - a \cdot t\right)}\right)\right)\]
    8. Using strategy rm
    9. Applied prod-diff11.1

      \[\leadsto \mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - z \cdot c, b, x \cdot \color{blue}{\left(\mathsf{fma}\left(y, z, -t \cdot a\right) + \mathsf{fma}\left(-t, a, t \cdot a\right)\right)}\right)\right)\]
    10. Applied distribute-rgt-in11.1

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

    if -2.2795782386377772e-181 < b < -2.2728874929835057e-303

    1. Initial program 17.6

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t \cdot c - y \cdot i, 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)\]
    7. Simplified12.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -2.2795782386377772 \cdot 10^{-181}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\right)\right)\right)\\ \mathbf{elif}\;b \le -2.2728874929835057 \cdot 10^{-303}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \left(y \cdot x - c \cdot b\right) \cdot z - x \cdot \left(t \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \mathsf{fma}\left(y, z, -t \cdot a\right) \cdot x + x \cdot \mathsf{fma}\left(-t, a, t \cdot a\right)\right)\right)\\ \end{array}\]

Reproduce

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