Average Error: 12.1 → 10.2
Time: 27.0s
Precision: 64
\[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
\[\begin{array}{l} \mathbf{if}\;j \le -3.260401236672284727679543684164179551587 \cdot 10^{62}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\ \mathbf{elif}\;j \le -4.257915606781290149622868595559270143504 \cdot 10^{-54}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(a \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{elif}\;j \le -1.369243025812474085049483349421987472158 \cdot 10^{-158}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - c \cdot z, \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(\sqrt[3]{a} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{elif}\;j \le -5.432127131408618757501355515022627318912 \cdot 10^{-200}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(a \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{elif}\;j \le 186548833176480.1875:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - c \cdot z, \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(\sqrt[3]{a} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\ \end{array}\]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\begin{array}{l}
\mathbf{if}\;j \le -3.260401236672284727679543684164179551587 \cdot 10^{62}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\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 r410292 = x;
        double r410293 = y;
        double r410294 = z;
        double r410295 = r410293 * r410294;
        double r410296 = t;
        double r410297 = a;
        double r410298 = r410296 * r410297;
        double r410299 = r410295 - r410298;
        double r410300 = r410292 * r410299;
        double r410301 = b;
        double r410302 = c;
        double r410303 = r410302 * r410294;
        double r410304 = i;
        double r410305 = r410296 * r410304;
        double r410306 = r410303 - r410305;
        double r410307 = r410301 * r410306;
        double r410308 = r410300 - r410307;
        double r410309 = j;
        double r410310 = r410302 * r410297;
        double r410311 = r410293 * r410304;
        double r410312 = r410310 - r410311;
        double r410313 = r410309 * r410312;
        double r410314 = r410308 + r410313;
        return r410314;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r410315 = j;
        double r410316 = -3.2604012366722847e+62;
        bool r410317 = r410315 <= r410316;
        double r410318 = x;
        double r410319 = y;
        double r410320 = z;
        double r410321 = r410319 * r410320;
        double r410322 = t;
        double r410323 = a;
        double r410324 = r410322 * r410323;
        double r410325 = r410321 - r410324;
        double r410326 = b;
        double r410327 = i;
        double r410328 = r410322 * r410327;
        double r410329 = c;
        double r410330 = r410329 * r410320;
        double r410331 = r410328 - r410330;
        double r410332 = cbrt(r410331);
        double r410333 = r410332 * r410332;
        double r410334 = r410333 * r410332;
        double r410335 = r410329 * r410323;
        double r410336 = r410319 * r410327;
        double r410337 = r410335 - r410336;
        double r410338 = r410315 * r410337;
        double r410339 = fma(r410326, r410334, r410338);
        double r410340 = fma(r410318, r410325, r410339);
        double r410341 = -4.25791560678129e-54;
        bool r410342 = r410315 <= r410341;
        double r410343 = r410323 * r410315;
        double r410344 = r410320 * r410326;
        double r410345 = r410343 - r410344;
        double r410346 = r410329 * r410345;
        double r410347 = r410319 * r410315;
        double r410348 = r410327 * r410347;
        double r410349 = r410346 - r410348;
        double r410350 = fma(r410318, r410325, r410349);
        double r410351 = -1.369243025812474e-158;
        bool r410352 = r410315 <= r410351;
        double r410353 = cbrt(r410323);
        double r410354 = r410353 * r410353;
        double r410355 = r410315 * r410329;
        double r410356 = r410353 * r410355;
        double r410357 = r410354 * r410356;
        double r410358 = -r410348;
        double r410359 = r410357 + r410358;
        double r410360 = fma(r410326, r410331, r410359);
        double r410361 = fma(r410318, r410325, r410360);
        double r410362 = -5.432127131408619e-200;
        bool r410363 = r410315 <= r410362;
        double r410364 = 186548833176480.2;
        bool r410365 = r410315 <= r410364;
        double r410366 = r410365 ? r410361 : r410340;
        double r410367 = r410363 ? r410350 : r410366;
        double r410368 = r410352 ? r410361 : r410367;
        double r410369 = r410342 ? r410350 : r410368;
        double r410370 = r410317 ? r410340 : r410369;
        return r410370;
}

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
Target19.7
Herbie10.2
\[\begin{array}{l} \mathbf{if}\;x \lt -1.469694296777705016266218530347997287942 \cdot 10^{-64}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;x \lt 3.21135273622268028942701600607048800714 \cdot 10^{-147}:\\ \;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if j < -3.2604012366722847e+62 or 186548833176480.2 < j

    1. Initial program 6.9

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Simplified6.9

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

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

    if -3.2604012366722847e+62 < j < -4.25791560678129e-54 or -1.369243025812474e-158 < j < -5.432127131408619e-200

    1. Initial program 12.1

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Simplified12.1

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

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

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

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

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

    if -4.25791560678129e-54 < j < -1.369243025812474e-158 or -5.432127131408619e-200 < j < 186548833176480.2

    1. Initial program 15.2

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Simplified15.2

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -3.260401236672284727679543684164179551587 \cdot 10^{62}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\ \mathbf{elif}\;j \le -4.257915606781290149622868595559270143504 \cdot 10^{-54}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(a \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{elif}\;j \le -1.369243025812474085049483349421987472158 \cdot 10^{-158}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - c \cdot z, \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(\sqrt[3]{a} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{elif}\;j \le -5.432127131408618757501355515022627318912 \cdot 10^{-200}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, c \cdot \left(a \cdot j - z \cdot b\right) - i \cdot \left(y \cdot j\right)\right)\\ \mathbf{elif}\;j \le 186548833176480.1875:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, t \cdot i - c \cdot z, \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \left(\sqrt[3]{a} \cdot \left(j \cdot c\right)\right) + \left(-i \cdot \left(y \cdot j\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, \left(\sqrt[3]{t \cdot i - c \cdot z} \cdot \sqrt[3]{t \cdot i - c \cdot z}\right) \cdot \sqrt[3]{t \cdot i - c \cdot z}, j \cdot \left(c \cdot a - y \cdot i\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
  :precision binary64

  :herbie-target
  (if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))