Average Error: 12.4 → 12.0
Time: 26.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}\;c \le -2.056175201748675770382017624042888738317 \cdot 10^{114}:\\ \;\;\;\;c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)\\ \mathbf{elif}\;c \le 1.487674112536942096916318817771319629867 \cdot 10^{91}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot \left(\left(\sqrt[3]{\sqrt[3]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}} \cdot \sqrt[3]{\sqrt[3]{c \cdot t - i \cdot y}}\right) \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(t \cdot j - z \cdot b\right) - \left(i \cdot y\right) \cdot j\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}\;c \le -2.056175201748675770382017624042888738317 \cdot 10^{114}:\\
\;\;\;\;c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(j \cdot y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r346445 = x;
        double r346446 = y;
        double r346447 = z;
        double r346448 = r346446 * r346447;
        double r346449 = t;
        double r346450 = a;
        double r346451 = r346449 * r346450;
        double r346452 = r346448 - r346451;
        double r346453 = r346445 * r346452;
        double r346454 = b;
        double r346455 = c;
        double r346456 = r346455 * r346447;
        double r346457 = i;
        double r346458 = r346457 * r346450;
        double r346459 = r346456 - r346458;
        double r346460 = r346454 * r346459;
        double r346461 = r346453 - r346460;
        double r346462 = j;
        double r346463 = r346455 * r346449;
        double r346464 = r346457 * r346446;
        double r346465 = r346463 - r346464;
        double r346466 = r346462 * r346465;
        double r346467 = r346461 + r346466;
        return r346467;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r346468 = c;
        double r346469 = -2.0561752017486758e+114;
        bool r346470 = r346468 <= r346469;
        double r346471 = t;
        double r346472 = j;
        double r346473 = r346471 * r346472;
        double r346474 = z;
        double r346475 = b;
        double r346476 = r346474 * r346475;
        double r346477 = r346473 - r346476;
        double r346478 = r346468 * r346477;
        double r346479 = i;
        double r346480 = y;
        double r346481 = r346472 * r346480;
        double r346482 = r346479 * r346481;
        double r346483 = r346478 - r346482;
        double r346484 = 1.4876741125369421e+91;
        bool r346485 = r346468 <= r346484;
        double r346486 = x;
        double r346487 = r346480 * r346474;
        double r346488 = a;
        double r346489 = r346471 * r346488;
        double r346490 = r346487 - r346489;
        double r346491 = r346479 * r346488;
        double r346492 = r346468 * r346474;
        double r346493 = r346491 - r346492;
        double r346494 = r346468 * r346471;
        double r346495 = r346479 * r346480;
        double r346496 = r346494 - r346495;
        double r346497 = cbrt(r346496);
        double r346498 = r346497 * r346497;
        double r346499 = cbrt(r346498);
        double r346500 = cbrt(r346497);
        double r346501 = r346499 * r346500;
        double r346502 = r346501 * r346497;
        double r346503 = r346472 * r346502;
        double r346504 = r346503 * r346497;
        double r346505 = fma(r346475, r346493, r346504);
        double r346506 = fma(r346486, r346490, r346505);
        double r346507 = r346495 * r346472;
        double r346508 = r346478 - r346507;
        double r346509 = fma(r346486, r346490, r346508);
        double r346510 = r346485 ? r346506 : r346509;
        double r346511 = r346470 ? r346483 : r346510;
        return r346511;
}

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.2
Herbie12.0
\[\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 c < -2.0561752017486758e+114

    1. Initial program 21.3

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \color{blue}{\left(j \cdot \left(\sqrt[3]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \sqrt[3]{c \cdot t - i \cdot y}}\right)\right)\]
    6. Taylor expanded around inf 32.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. Simplified22.0

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

    if -2.0561752017486758e+114 < c < 1.4876741125369421e+91

    1. Initial program 10.1

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

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

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

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

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

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

    if 1.4876741125369421e+91 < c

    1. Initial program 20.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. Simplified20.0

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

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

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

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

Reproduce

herbie shell --seed 2019212 +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.1209789191959122e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.7125538182184851e-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.63353334603158369e-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)))))