Average Error: 11.7 → 11.1
Time: 29.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}\;t \le 6.104415418042492018850338195350200047667 \cdot 10^{-68}:\\ \;\;\;\;\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]{c \cdot t - i \cdot y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \sqrt{t} \cdot \left(\sqrt{t} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\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}\;t \le 6.104415418042492018850338195350200047667 \cdot 10^{-68}:\\
\;\;\;\;\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]{c \cdot t - i \cdot y}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \sqrt{t} \cdot \left(\sqrt{t} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\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 r413293 = x;
        double r413294 = y;
        double r413295 = z;
        double r413296 = r413294 * r413295;
        double r413297 = t;
        double r413298 = a;
        double r413299 = r413297 * r413298;
        double r413300 = r413296 - r413299;
        double r413301 = r413293 * r413300;
        double r413302 = b;
        double r413303 = c;
        double r413304 = r413303 * r413295;
        double r413305 = i;
        double r413306 = r413305 * r413298;
        double r413307 = r413304 - r413306;
        double r413308 = r413302 * r413307;
        double r413309 = r413301 - r413308;
        double r413310 = j;
        double r413311 = r413303 * r413297;
        double r413312 = r413305 * r413294;
        double r413313 = r413311 - r413312;
        double r413314 = r413310 * r413313;
        double r413315 = r413309 + r413314;
        return r413315;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r413316 = t;
        double r413317 = 6.104415418042492e-68;
        bool r413318 = r413316 <= r413317;
        double r413319 = x;
        double r413320 = y;
        double r413321 = z;
        double r413322 = r413320 * r413321;
        double r413323 = a;
        double r413324 = r413316 * r413323;
        double r413325 = r413322 - r413324;
        double r413326 = b;
        double r413327 = i;
        double r413328 = r413327 * r413323;
        double r413329 = c;
        double r413330 = r413329 * r413321;
        double r413331 = r413328 - r413330;
        double r413332 = j;
        double r413333 = r413329 * r413316;
        double r413334 = r413327 * r413320;
        double r413335 = r413333 - r413334;
        double r413336 = cbrt(r413335);
        double r413337 = r413336 * r413336;
        double r413338 = r413332 * r413337;
        double r413339 = r413338 * r413336;
        double r413340 = fma(r413326, r413331, r413339);
        double r413341 = fma(r413319, r413325, r413340);
        double r413342 = sqrt(r413316);
        double r413343 = r413332 * r413329;
        double r413344 = r413342 * r413343;
        double r413345 = r413342 * r413344;
        double r413346 = r413320 * r413332;
        double r413347 = r413327 * r413346;
        double r413348 = -r413347;
        double r413349 = r413345 + r413348;
        double r413350 = fma(r413326, r413331, r413349);
        double r413351 = fma(r413319, r413325, r413350);
        double r413352 = r413318 ? r413341 : r413351;
        return r413352;
}

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

Original11.7
Target15.8
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 2 regimes
  2. if t < 6.104415418042492e-68

    1. Initial program 10.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. Simplified10.4

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

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

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

    if 6.104415418042492e-68 < t

    1. Initial program 15.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. Simplified15.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 *-un-lft-identity15.7

      \[\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(1 \cdot \left(c \cdot t - i \cdot y\right)\right)}\right)\right)\]
    5. Using strategy rm
    6. Applied sub-neg15.7

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

      \[\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(1 \cdot \left(c \cdot t\right) + 1 \cdot \left(-i \cdot y\right)\right)}\right)\right)\]
    8. Applied distribute-lft-in15.7

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le 6.104415418042492018850338195350200047667 \cdot 10^{-68}:\\ \;\;\;\;\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]{c \cdot t - i \cdot y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \sqrt{t} \cdot \left(\sqrt{t} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \end{array}\]

Reproduce

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