Average Error: 12.5 → 11.2
Time: 13.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.7660440731317677 \cdot 10^{-34}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;j \le 7.79910464432185437 \cdot 10^{-10}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(z \cdot y\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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.7660440731317677 \cdot 10^{-34}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

\mathbf{elif}\;j \le 7.79910464432185437 \cdot 10^{-10}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r1011360 = x;
        double r1011361 = y;
        double r1011362 = z;
        double r1011363 = r1011361 * r1011362;
        double r1011364 = t;
        double r1011365 = a;
        double r1011366 = r1011364 * r1011365;
        double r1011367 = r1011363 - r1011366;
        double r1011368 = r1011360 * r1011367;
        double r1011369 = b;
        double r1011370 = c;
        double r1011371 = r1011370 * r1011362;
        double r1011372 = i;
        double r1011373 = r1011364 * r1011372;
        double r1011374 = r1011371 - r1011373;
        double r1011375 = r1011369 * r1011374;
        double r1011376 = r1011368 - r1011375;
        double r1011377 = j;
        double r1011378 = r1011370 * r1011365;
        double r1011379 = r1011361 * r1011372;
        double r1011380 = r1011378 - r1011379;
        double r1011381 = r1011377 * r1011380;
        double r1011382 = r1011376 + r1011381;
        return r1011382;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r1011383 = j;
        double r1011384 = -3.7660440731317677e-34;
        bool r1011385 = r1011383 <= r1011384;
        double r1011386 = x;
        double r1011387 = y;
        double r1011388 = z;
        double r1011389 = r1011387 * r1011388;
        double r1011390 = t;
        double r1011391 = a;
        double r1011392 = r1011390 * r1011391;
        double r1011393 = r1011389 - r1011392;
        double r1011394 = r1011386 * r1011393;
        double r1011395 = b;
        double r1011396 = c;
        double r1011397 = r1011395 * r1011396;
        double r1011398 = r1011388 * r1011397;
        double r1011399 = cbrt(r1011398);
        double r1011400 = r1011399 * r1011399;
        double r1011401 = r1011400 * r1011399;
        double r1011402 = -r1011390;
        double r1011403 = i;
        double r1011404 = r1011403 * r1011395;
        double r1011405 = r1011402 * r1011404;
        double r1011406 = r1011401 + r1011405;
        double r1011407 = r1011394 - r1011406;
        double r1011408 = r1011396 * r1011391;
        double r1011409 = r1011387 * r1011403;
        double r1011410 = r1011408 - r1011409;
        double r1011411 = r1011383 * r1011410;
        double r1011412 = r1011407 + r1011411;
        double r1011413 = 7.799104644321854e-10;
        bool r1011414 = r1011383 <= r1011413;
        double r1011415 = r1011388 * r1011395;
        double r1011416 = r1011415 * r1011396;
        double r1011417 = r1011416 + r1011405;
        double r1011418 = r1011394 - r1011417;
        double r1011419 = r1011383 * r1011396;
        double r1011420 = r1011391 * r1011419;
        double r1011421 = -r1011409;
        double r1011422 = r1011383 * r1011421;
        double r1011423 = r1011420 + r1011422;
        double r1011424 = r1011418 + r1011423;
        double r1011425 = r1011388 * r1011387;
        double r1011426 = r1011386 * r1011425;
        double r1011427 = r1011386 * r1011390;
        double r1011428 = r1011391 * r1011427;
        double r1011429 = -r1011428;
        double r1011430 = r1011426 + r1011429;
        double r1011431 = r1011430 - r1011417;
        double r1011432 = r1011431 + r1011411;
        double r1011433 = r1011414 ? r1011424 : r1011432;
        double r1011434 = r1011385 ? r1011412 : r1011433;
        return r1011434;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original12.5
Target20.3
Herbie11.2
\[\begin{array}{l} \mathbf{if}\;x \lt -1.46969429677770502 \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.2113527362226803 \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.7660440731317677e-34

    1. Initial program 7.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. Using strategy rm
    3. Applied sub-neg7.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied distribute-lft-in7.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified8.1

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{z \cdot \left(b \cdot c\right)} + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    6. Simplified8.1

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t \cdot i\right) \cdot b}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-in8.1

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(\left(-t\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*7.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied add-cube-cbrt8.0

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

    if -3.7660440731317677e-34 < j < 7.799104644321854e-10

    1. Initial program 16.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. Using strategy rm
    3. Applied sub-neg16.2

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied distribute-lft-in16.2

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified16.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{z \cdot \left(b \cdot c\right)} + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    6. Simplified16.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t \cdot i\right) \cdot b}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-in16.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(\left(-t\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*16.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied associate-*r*15.9

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{\left(z \cdot b\right) \cdot c} + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    12. Using strategy rm
    13. Applied sub-neg15.9

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + \color{blue}{\left(j \cdot \left(c \cdot a\right) + j \cdot \left(-y \cdot i\right)\right)}\]
    15. Simplified13.0

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

    if 7.799104644321854e-10 < j

    1. Initial program 7.4

      \[\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. Using strategy rm
    3. Applied sub-neg7.4

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\left(c \cdot z + \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied distribute-lft-in7.4

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(b \cdot \left(c \cdot z\right) + b \cdot \left(-t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified7.7

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{z \cdot \left(b \cdot c\right)} + b \cdot \left(-t \cdot i\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    6. Simplified7.7

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t \cdot i\right) \cdot b}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-in7.7

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(\left(-t\right) \cdot i\right)} \cdot b\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    9. Applied associate-*l*8.0

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-t\right) \cdot \left(i \cdot b\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    10. Using strategy rm
    11. Applied associate-*r*8.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\color{blue}{\left(z \cdot b\right) \cdot c} + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    12. Using strategy rm
    13. Applied sub-neg8.6

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-t \cdot a\right)\right)} - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    14. Applied distribute-lft-in8.6

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\right)\right)} - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    15. Simplified8.6

      \[\leadsto \left(\left(\color{blue}{x \cdot \left(z \cdot y\right)} + x \cdot \left(-t \cdot a\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    16. Simplified9.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;j \le -3.7660440731317677 \cdot 10^{-34}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(\sqrt[3]{z \cdot \left(b \cdot c\right)} \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)}\right) \cdot \sqrt[3]{z \cdot \left(b \cdot c\right)} + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;j \le 7.79910464432185437 \cdot 10^{-10}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + \left(a \cdot \left(j \cdot c\right) + j \cdot \left(-y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(z \cdot y\right) + \left(-a \cdot \left(x \cdot t\right)\right)\right) - \left(\left(z \cdot b\right) \cdot c + \left(-t\right) \cdot \left(i \cdot b\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020046 
(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)))))