Average Error: 12.4 → 12.5
Time: 8.5s
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 -1.297231026100319828365025446437552019435 \cdot 10^{-34}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + -1 \cdot \left(t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(\left(-b\right) \cdot t\right) \cdot i\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 -1.297231026100319828365025446437552019435 \cdot 10^{-34}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + -1 \cdot \left(t \cdot \left(i \cdot b\right)\right)\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\left(z \cdot b\right) \cdot c + \left(\left(-b\right) \cdot t\right) \cdot i\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 r1102609 = x;
        double r1102610 = y;
        double r1102611 = z;
        double r1102612 = r1102610 * r1102611;
        double r1102613 = t;
        double r1102614 = a;
        double r1102615 = r1102613 * r1102614;
        double r1102616 = r1102612 - r1102615;
        double r1102617 = r1102609 * r1102616;
        double r1102618 = b;
        double r1102619 = c;
        double r1102620 = r1102619 * r1102611;
        double r1102621 = i;
        double r1102622 = r1102613 * r1102621;
        double r1102623 = r1102620 - r1102622;
        double r1102624 = r1102618 * r1102623;
        double r1102625 = r1102617 - r1102624;
        double r1102626 = j;
        double r1102627 = r1102619 * r1102614;
        double r1102628 = r1102610 * r1102621;
        double r1102629 = r1102627 - r1102628;
        double r1102630 = r1102626 * r1102629;
        double r1102631 = r1102625 + r1102630;
        return r1102631;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r1102632 = j;
        double r1102633 = -1.2972310261003198e-34;
        bool r1102634 = r1102632 <= r1102633;
        double r1102635 = x;
        double r1102636 = y;
        double r1102637 = z;
        double r1102638 = r1102636 * r1102637;
        double r1102639 = t;
        double r1102640 = a;
        double r1102641 = r1102639 * r1102640;
        double r1102642 = r1102638 - r1102641;
        double r1102643 = r1102635 * r1102642;
        double r1102644 = b;
        double r1102645 = c;
        double r1102646 = r1102644 * r1102645;
        double r1102647 = r1102637 * r1102646;
        double r1102648 = -1.0;
        double r1102649 = i;
        double r1102650 = r1102649 * r1102644;
        double r1102651 = r1102639 * r1102650;
        double r1102652 = r1102648 * r1102651;
        double r1102653 = r1102647 + r1102652;
        double r1102654 = r1102643 - r1102653;
        double r1102655 = r1102645 * r1102640;
        double r1102656 = r1102636 * r1102649;
        double r1102657 = r1102655 - r1102656;
        double r1102658 = r1102632 * r1102657;
        double r1102659 = r1102654 + r1102658;
        double r1102660 = r1102637 * r1102644;
        double r1102661 = r1102660 * r1102645;
        double r1102662 = -r1102644;
        double r1102663 = r1102662 * r1102639;
        double r1102664 = r1102663 * r1102649;
        double r1102665 = r1102661 + r1102664;
        double r1102666 = r1102643 - r1102665;
        double r1102667 = r1102666 + r1102658;
        double r1102668 = r1102634 ? r1102659 : r1102667;
        return r1102668;
}

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.4
Target20.4
Herbie12.5
\[\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 2 regimes
  2. if j < -1.2972310261003198e-34

    1. Initial program 8.8

      \[\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 add-cube-cbrt9.0

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \left(c \cdot z - t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Using strategy rm
    6. Applied sub-neg9.0

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

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

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-b\right) \cdot \left(t \cdot i\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    11. Taylor expanded around inf 8.6

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

    if -1.2972310261003198e-34 < j

    1. Initial program 13.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 add-cube-cbrt13.8

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \left(c \cdot z - t \cdot i\right)\right)}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Using strategy rm
    6. Applied sub-neg13.8

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

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

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

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \color{blue}{\left(-b\right) \cdot \left(t \cdot i\right)}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    11. Using strategy rm
    12. Applied associate-*r*13.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(-b\right) \cdot t\right) \cdot i}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    13. Using strategy rm
    14. Applied associate-*r*13.6

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

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

Reproduce

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