Average Error: 12.4 → 13.7
Time: 12.2s
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.5447436542332151 \cdot 10^{-127}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\ \mathbf{elif}\;b \le -3.40149356120774805 \cdot 10^{-152}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{elif}\;b \le 1.8227810540647952 \cdot 10^{-177}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - 0\right)\\ \mathbf{elif}\;b \le 1.865590680694256 \cdot 10^{-152}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - \sqrt{b} \cdot \left(\sqrt{b} \cdot \left(c \cdot z - i \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 -3.5447436542332151 \cdot 10^{-127}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - \sqrt{b} \cdot \left(\sqrt{b} \cdot \left(c \cdot z - i \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 r630252 = x;
        double r630253 = y;
        double r630254 = z;
        double r630255 = r630253 * r630254;
        double r630256 = t;
        double r630257 = a;
        double r630258 = r630256 * r630257;
        double r630259 = r630255 - r630258;
        double r630260 = r630252 * r630259;
        double r630261 = b;
        double r630262 = c;
        double r630263 = r630262 * r630254;
        double r630264 = i;
        double r630265 = r630264 * r630257;
        double r630266 = r630263 - r630265;
        double r630267 = r630261 * r630266;
        double r630268 = r630260 - r630267;
        double r630269 = j;
        double r630270 = r630262 * r630256;
        double r630271 = r630264 * r630253;
        double r630272 = r630270 - r630271;
        double r630273 = r630269 * r630272;
        double r630274 = r630268 + r630273;
        return r630274;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r630275 = b;
        double r630276 = -3.544743654233215e-127;
        bool r630277 = r630275 <= r630276;
        double r630278 = c;
        double r630279 = t;
        double r630280 = r630278 * r630279;
        double r630281 = i;
        double r630282 = y;
        double r630283 = r630281 * r630282;
        double r630284 = r630280 - r630283;
        double r630285 = j;
        double r630286 = x;
        double r630287 = cbrt(r630286);
        double r630288 = r630287 * r630287;
        double r630289 = z;
        double r630290 = r630282 * r630289;
        double r630291 = a;
        double r630292 = r630279 * r630291;
        double r630293 = r630290 - r630292;
        double r630294 = r630287 * r630293;
        double r630295 = r630288 * r630294;
        double r630296 = r630278 * r630289;
        double r630297 = r630281 * r630291;
        double r630298 = r630296 - r630297;
        double r630299 = r630275 * r630298;
        double r630300 = r630295 - r630299;
        double r630301 = fma(r630284, r630285, r630300);
        double r630302 = -3.401493561207748e-152;
        bool r630303 = r630275 <= r630302;
        double r630304 = r630281 * r630275;
        double r630305 = r630275 * r630278;
        double r630306 = r630286 * r630279;
        double r630307 = r630291 * r630306;
        double r630308 = fma(r630289, r630305, r630307);
        double r630309 = -r630308;
        double r630310 = fma(r630291, r630304, r630309);
        double r630311 = 1.8227810540647952e-177;
        bool r630312 = r630275 <= r630311;
        double r630313 = r630286 * r630293;
        double r630314 = 0.0;
        double r630315 = r630313 - r630314;
        double r630316 = fma(r630284, r630285, r630315);
        double r630317 = 1.8655906806942557e-152;
        bool r630318 = r630275 <= r630317;
        double r630319 = sqrt(r630275);
        double r630320 = r630319 * r630298;
        double r630321 = r630319 * r630320;
        double r630322 = r630313 - r630321;
        double r630323 = fma(r630284, r630285, r630322);
        double r630324 = r630318 ? r630310 : r630323;
        double r630325 = r630312 ? r630316 : r630324;
        double r630326 = r630303 ? r630310 : r630325;
        double r630327 = r630277 ? r630301 : r630326;
        return r630327;
}

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
Herbie13.7
\[\begin{array}{l} \mathbf{if}\;t \lt -8.1209789191959122 \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.7125538182184851 \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.63353334603158369 \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 4 regimes
  2. if b < -3.544743654233215e-127

    1. Initial program 9.5

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

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

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

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

    if -3.544743654233215e-127 < b < -3.401493561207748e-152 or 1.8227810540647952e-177 < b < 1.8655906806942557e-152

    1. Initial program 16.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. Simplified16.4

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

      \[\leadsto \color{blue}{a \cdot \left(i \cdot b\right) - \left(z \cdot \left(b \cdot c\right) + a \cdot \left(x \cdot t\right)\right)}\]
    4. Simplified37.2

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

    if -3.401493561207748e-152 < b < 1.8227810540647952e-177

    1. Initial program 17.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. Simplified17.7

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

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

    if 1.8655906806942557e-152 < b

    1. Initial program 9.8

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -3.5447436542332151 \cdot 10^{-127}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\ \mathbf{elif}\;b \le -3.40149356120774805 \cdot 10^{-152}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{elif}\;b \le 1.8227810540647952 \cdot 10^{-177}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - 0\right)\\ \mathbf{elif}\;b \le 1.865590680694256 \cdot 10^{-152}:\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - \sqrt{b} \cdot \left(\sqrt{b} \cdot \left(c \cdot z - i \cdot a\right)\right)\right)\\ \end{array}\]

Reproduce

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