Average Error: 12.2 → 13.4
Time: 34.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 1.674675193324362264664884066454834412143 \cdot 10^{-289}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\right)\\ \mathbf{elif}\;x \le 4.679747423961563999718296004311467328545 \cdot 10^{-222}:\\ \;\;\;\;c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;x \le 3.577455124027497583398538250065712418291 \cdot 10^{-4}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(t \cdot c\right) \cdot j + \left(-i \cdot j\right) \cdot y\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 1.674675193324362264664884066454834412143 \cdot 10^{-289}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\right)\\

\mathbf{elif}\;x \le 4.679747423961563999718296004311467328545 \cdot 10^{-222}:\\
\;\;\;\;c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(t \cdot c\right) \cdot j + \left(-i \cdot j\right) \cdot y\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 r36274185 = x;
        double r36274186 = y;
        double r36274187 = z;
        double r36274188 = r36274186 * r36274187;
        double r36274189 = t;
        double r36274190 = a;
        double r36274191 = r36274189 * r36274190;
        double r36274192 = r36274188 - r36274191;
        double r36274193 = r36274185 * r36274192;
        double r36274194 = b;
        double r36274195 = c;
        double r36274196 = r36274195 * r36274187;
        double r36274197 = i;
        double r36274198 = r36274197 * r36274190;
        double r36274199 = r36274196 - r36274198;
        double r36274200 = r36274194 * r36274199;
        double r36274201 = r36274193 - r36274200;
        double r36274202 = j;
        double r36274203 = r36274195 * r36274189;
        double r36274204 = r36274197 * r36274186;
        double r36274205 = r36274203 - r36274204;
        double r36274206 = r36274202 * r36274205;
        double r36274207 = r36274201 + r36274206;
        return r36274207;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r36274208 = x;
        double r36274209 = 1.6746751933243623e-289;
        bool r36274210 = r36274208 <= r36274209;
        double r36274211 = y;
        double r36274212 = z;
        double r36274213 = r36274211 * r36274212;
        double r36274214 = t;
        double r36274215 = a;
        double r36274216 = r36274214 * r36274215;
        double r36274217 = r36274213 - r36274216;
        double r36274218 = b;
        double r36274219 = i;
        double r36274220 = r36274219 * r36274215;
        double r36274221 = c;
        double r36274222 = r36274221 * r36274212;
        double r36274223 = r36274220 - r36274222;
        double r36274224 = j;
        double r36274225 = r36274224 * r36274221;
        double r36274226 = r36274214 * r36274225;
        double r36274227 = r36274219 * r36274211;
        double r36274228 = -r36274227;
        double r36274229 = r36274228 * r36274224;
        double r36274230 = r36274226 + r36274229;
        double r36274231 = fma(r36274218, r36274223, r36274230);
        double r36274232 = fma(r36274217, r36274208, r36274231);
        double r36274233 = 4.679747423961564e-222;
        bool r36274234 = r36274208 <= r36274233;
        double r36274235 = r36274214 * r36274224;
        double r36274236 = r36274212 * r36274218;
        double r36274237 = r36274235 - r36274236;
        double r36274238 = r36274221 * r36274237;
        double r36274239 = r36274224 * r36274211;
        double r36274240 = r36274219 * r36274239;
        double r36274241 = r36274238 - r36274240;
        double r36274242 = 0.00035774551240274976;
        bool r36274243 = r36274208 <= r36274242;
        double r36274244 = r36274214 * r36274221;
        double r36274245 = r36274244 * r36274224;
        double r36274246 = r36274219 * r36274224;
        double r36274247 = -r36274246;
        double r36274248 = r36274247 * r36274211;
        double r36274249 = r36274245 + r36274248;
        double r36274250 = fma(r36274218, r36274223, r36274249);
        double r36274251 = fma(r36274217, r36274208, r36274250);
        double r36274252 = r36274243 ? r36274232 : r36274251;
        double r36274253 = r36274234 ? r36274241 : r36274252;
        double r36274254 = r36274210 ? r36274232 : r36274253;
        return r36274254;
}

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.2
Target16.3
Herbie13.4
\[\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 3 regimes
  2. if x < 1.6746751933243623e-289 or 4.679747423961564e-222 < x < 0.00035774551240274976

    1. Initial program 12.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. Simplified12.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \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 add-cube-cbrt13.2

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

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

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

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

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

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

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

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

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

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

    if 1.6746751933243623e-289 < x < 4.679747423961564e-222

    1. Initial program 18.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. Simplified18.0

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \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 add-cube-cbrt18.4

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

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

      \[\leadsto \color{blue}{t \cdot \left(j \cdot c\right) - \left(z \cdot \left(b \cdot c\right) + i \cdot \left(j \cdot y\right)\right)}\]
    7. Simplified29.6

      \[\leadsto \color{blue}{c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)}\]

    if 0.00035774551240274976 < x

    1. Initial program 7.7

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \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 add-cube-cbrt7.9

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

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

      \[\leadsto \mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(\sqrt[3]{j} \cdot \sqrt[3]{j}\right) \cdot \left(\sqrt[3]{j} \cdot \color{blue}{\left(c \cdot t + \left(-i \cdot y\right)\right)}\right)\right)\right)\]
    8. Applied distribute-lft-in7.9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 1.674675193324362264664884066454834412143 \cdot 10^{-289}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\right)\\ \mathbf{elif}\;x \le 4.679747423961563999718296004311467328545 \cdot 10^{-222}:\\ \;\;\;\;c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;x \le 3.577455124027497583398538250065712418291 \cdot 10^{-4}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(t \cdot c\right) \cdot j + \left(-i \cdot j\right) \cdot y\right)\right)\\ \end{array}\]

Reproduce

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