Average Error: 12.4 → 11.1
Time: 8.0s
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}\;z \le -9169080864.7199039459228515625:\\ \;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + x \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\\ \mathbf{elif}\;z \le 2.212691018330258209137031339767401690725 \cdot 10^{-103}:\\ \;\;\;\;\left(\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z\right)\right) + x \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + 1 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot t\right)\right)\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\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}\;z \le -9169080864.7199039459228515625:\\
\;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + x \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + \left(\sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - i \cdot y\right)}\\

\mathbf{elif}\;z \le 2.212691018330258209137031339767401690725 \cdot 10^{-103}:\\
\;\;\;\;\left(\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z\right)\right) + x \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + 1 \cdot \left(-1 \cdot \left(a \cdot \left(x \cdot t\right)\right)\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r457192 = x;
        double r457193 = y;
        double r457194 = z;
        double r457195 = r457193 * r457194;
        double r457196 = t;
        double r457197 = a;
        double r457198 = r457196 * r457197;
        double r457199 = r457195 - r457198;
        double r457200 = r457192 * r457199;
        double r457201 = b;
        double r457202 = c;
        double r457203 = r457202 * r457194;
        double r457204 = i;
        double r457205 = r457204 * r457197;
        double r457206 = r457203 - r457205;
        double r457207 = r457201 * r457206;
        double r457208 = r457200 - r457207;
        double r457209 = j;
        double r457210 = r457202 * r457196;
        double r457211 = r457204 * r457193;
        double r457212 = r457210 - r457211;
        double r457213 = r457209 * r457212;
        double r457214 = r457208 + r457213;
        return r457214;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r457215 = z;
        double r457216 = -9169080864.719904;
        bool r457217 = r457215 <= r457216;
        double r457218 = x;
        double r457219 = y;
        double r457220 = r457218 * r457219;
        double r457221 = r457220 * r457215;
        double r457222 = t;
        double r457223 = a;
        double r457224 = r457222 * r457223;
        double r457225 = -r457224;
        double r457226 = r457218 * r457225;
        double r457227 = r457221 + r457226;
        double r457228 = b;
        double r457229 = c;
        double r457230 = r457229 * r457215;
        double r457231 = i;
        double r457232 = r457231 * r457223;
        double r457233 = r457230 - r457232;
        double r457234 = r457228 * r457233;
        double r457235 = -r457223;
        double r457236 = r457223 * r457231;
        double r457237 = fma(r457235, r457231, r457236);
        double r457238 = r457228 * r457237;
        double r457239 = r457234 + r457238;
        double r457240 = r457227 - r457239;
        double r457241 = j;
        double r457242 = r457229 * r457222;
        double r457243 = r457231 * r457219;
        double r457244 = r457242 - r457243;
        double r457245 = r457241 * r457244;
        double r457246 = cbrt(r457245);
        double r457247 = r457246 * r457246;
        double r457248 = r457247 * r457246;
        double r457249 = r457240 + r457248;
        double r457250 = 2.2126910183302582e-103;
        bool r457251 = r457215 <= r457250;
        double r457252 = cbrt(r457218);
        double r457253 = r457252 * r457252;
        double r457254 = r457219 * r457215;
        double r457255 = r457252 * r457254;
        double r457256 = r457253 * r457255;
        double r457257 = r457256 + r457226;
        double r457258 = r457257 - r457239;
        double r457259 = r457258 + r457245;
        double r457260 = 1.0;
        double r457261 = -1.0;
        double r457262 = r457218 * r457222;
        double r457263 = r457223 * r457262;
        double r457264 = r457261 * r457263;
        double r457265 = r457260 * r457264;
        double r457266 = r457221 + r457265;
        double r457267 = r457266 - r457239;
        double r457268 = r457267 + r457245;
        double r457269 = r457251 ? r457259 : r457268;
        double r457270 = r457217 ? r457249 : r457269;
        return r457270;
}

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.4
Target16.1
Herbie11.1
\[\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 z < -9169080864.719904

    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. Using strategy rm
    3. Applied prod-diff17.6

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

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

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

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

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

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

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

    if -9169080864.719904 < z < 2.2126910183302582e-103

    1. Initial program 9.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. Using strategy rm
    3. Applied prod-diff9.6

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

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

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

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

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

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

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

    if 2.2126910183302582e-103 < z

    1. Initial program 14.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. Using strategy rm
    3. Applied prod-diff14.0

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

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

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

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

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

      \[\leadsto \left(\left(\color{blue}{\left(x \cdot y\right) \cdot z} + x \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    11. Using strategy rm
    12. Applied *-un-lft-identity12.0

      \[\leadsto \left(\left(\left(x \cdot y\right) \cdot z + \color{blue}{\left(1 \cdot x\right)} \cdot \left(-t \cdot a\right)\right) - \left(b \cdot \left(c \cdot z - i \cdot a\right) + b \cdot \mathsf{fma}\left(-a, i, a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    13. Applied associate-*l*12.0

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

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

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

Reproduce

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