Average Error: 12.1 → 13.1
Time: 19.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}\;c \le 8.019229054588489985064115706344396752848 \cdot 10^{-225} \lor \neg \left(c \le 1.128905115509222076296604198732927607533 \cdot 10^{-156}\right) \land c \le 30615112571703145791488:\\ \;\;\;\;\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]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \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)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\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}\;c \le 8.019229054588489985064115706344396752848 \cdot 10^{-225} \lor \neg \left(c \le 1.128905115509222076296604198732927607533 \cdot 10^{-156}\right) \land c \le 30615112571703145791488:\\
\;\;\;\;\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]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \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)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\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 r753444 = x;
        double r753445 = y;
        double r753446 = z;
        double r753447 = r753445 * r753446;
        double r753448 = t;
        double r753449 = a;
        double r753450 = r753448 * r753449;
        double r753451 = r753447 - r753450;
        double r753452 = r753444 * r753451;
        double r753453 = b;
        double r753454 = c;
        double r753455 = r753454 * r753446;
        double r753456 = i;
        double r753457 = r753456 * r753449;
        double r753458 = r753455 - r753457;
        double r753459 = r753453 * r753458;
        double r753460 = r753452 - r753459;
        double r753461 = j;
        double r753462 = r753454 * r753448;
        double r753463 = r753456 * r753445;
        double r753464 = r753462 - r753463;
        double r753465 = r753461 * r753464;
        double r753466 = r753460 + r753465;
        return r753466;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r753467 = c;
        double r753468 = 8.01922905458849e-225;
        bool r753469 = r753467 <= r753468;
        double r753470 = 1.1289051155092221e-156;
        bool r753471 = r753467 <= r753470;
        double r753472 = !r753471;
        double r753473 = 3.0615112571703146e+22;
        bool r753474 = r753467 <= r753473;
        bool r753475 = r753472 && r753474;
        bool r753476 = r753469 || r753475;
        double r753477 = x;
        double r753478 = y;
        double r753479 = z;
        double r753480 = r753478 * r753479;
        double r753481 = t;
        double r753482 = a;
        double r753483 = r753481 * r753482;
        double r753484 = r753480 - r753483;
        double r753485 = b;
        double r753486 = i;
        double r753487 = r753486 * r753482;
        double r753488 = r753467 * r753479;
        double r753489 = r753487 - r753488;
        double r753490 = j;
        double r753491 = r753467 * r753481;
        double r753492 = r753486 * r753478;
        double r753493 = r753491 - r753492;
        double r753494 = cbrt(r753493);
        double r753495 = r753494 * r753494;
        double r753496 = r753490 * r753495;
        double r753497 = cbrt(r753495);
        double r753498 = cbrt(r753494);
        double r753499 = r753497 * r753498;
        double r753500 = r753496 * r753499;
        double r753501 = fma(r753485, r753489, r753500);
        double r753502 = fma(r753477, r753484, r753501);
        double r753503 = r753481 * r753490;
        double r753504 = r753479 * r753485;
        double r753505 = r753503 - r753504;
        double r753506 = r753467 * r753505;
        double r753507 = r753478 * r753490;
        double r753508 = r753486 * r753507;
        double r753509 = r753506 - r753508;
        double r753510 = fma(r753477, r753484, r753509);
        double r753511 = r753476 ? r753502 : r753510;
        return r753511;
}

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.1
Target16.0
Herbie13.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 2 regimes
  2. if c < 8.01922905458849e-225 or 1.1289051155092221e-156 < c < 3.0615112571703146e+22

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

      \[\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*11.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. Using strategy rm
    7. Applied add-cube-cbrt11.6

      \[\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]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \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}}}\right)\right)\]
    8. Applied cbrt-prod11.6

      \[\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]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \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)}\right)\right)\]

    if 8.01922905458849e-225 < c < 1.1289051155092221e-156 or 3.0615112571703146e+22 < c

    1. Initial program 14.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. Simplified14.7

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

      \[\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*15.0

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

      \[\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)\]
    7. Simplified17.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \le 8.019229054588489985064115706344396752848 \cdot 10^{-225} \lor \neg \left(c \le 1.128905115509222076296604198732927607533 \cdot 10^{-156}\right) \land c \le 30615112571703145791488:\\ \;\;\;\;\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]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \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)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(t \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\right)\right)\\ \end{array}\]

Reproduce

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