Average Error: 11.9 → 11.8
Time: 15.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}\;b \le -2.333089443411724874919697496858099155432 \cdot 10^{-169} \lor \neg \left(b \le 6.405155247491063031791398908208678375602 \cdot 10^{-293}\right):\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z - t \cdot i\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\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}\;b \le -2.333089443411724874919697496858099155432 \cdot 10^{-169} \lor \neg \left(b \le 6.405155247491063031791398908208678375602 \cdot 10^{-293}\right):\\
\;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z - t \cdot i\right) \cdot b\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r624644 = x;
        double r624645 = y;
        double r624646 = z;
        double r624647 = r624645 * r624646;
        double r624648 = t;
        double r624649 = a;
        double r624650 = r624648 * r624649;
        double r624651 = r624647 - r624650;
        double r624652 = r624644 * r624651;
        double r624653 = b;
        double r624654 = c;
        double r624655 = r624654 * r624646;
        double r624656 = i;
        double r624657 = r624648 * r624656;
        double r624658 = r624655 - r624657;
        double r624659 = r624653 * r624658;
        double r624660 = r624652 - r624659;
        double r624661 = j;
        double r624662 = r624654 * r624649;
        double r624663 = r624645 * r624656;
        double r624664 = r624662 - r624663;
        double r624665 = r624661 * r624664;
        double r624666 = r624660 + r624665;
        return r624666;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r624667 = b;
        double r624668 = -2.333089443411725e-169;
        bool r624669 = r624667 <= r624668;
        double r624670 = 6.405155247491063e-293;
        bool r624671 = r624667 <= r624670;
        double r624672 = !r624671;
        bool r624673 = r624669 || r624672;
        double r624674 = j;
        double r624675 = c;
        double r624676 = a;
        double r624677 = r624675 * r624676;
        double r624678 = y;
        double r624679 = i;
        double r624680 = r624678 * r624679;
        double r624681 = r624677 - r624680;
        double r624682 = r624674 * r624681;
        double r624683 = x;
        double r624684 = z;
        double r624685 = r624678 * r624684;
        double r624686 = t;
        double r624687 = r624686 * r624676;
        double r624688 = r624685 - r624687;
        double r624689 = r624683 * r624688;
        double r624690 = r624682 + r624689;
        double r624691 = r624675 * r624684;
        double r624692 = r624686 * r624679;
        double r624693 = r624691 - r624692;
        double r624694 = r624693 * r624667;
        double r624695 = r624690 - r624694;
        double r624696 = r624673 ? r624695 : r624690;
        return r624696;
}

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

Original11.9
Target19.9
Herbie11.8
\[\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 b < -2.333089443411725e-169

    1. Initial program 10.0

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

      \[\leadsto \left(x \cdot \color{blue}{\left(\left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right) \cdot \sqrt[3]{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)\]
    4. Applied associate-*r*10.2

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

    if -2.333089443411725e-169 < b < 6.405155247491063e-293

    1. Initial program 17.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-cbrt17.5

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

      \[\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. Taylor expanded around 0 16.7

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

    if 6.405155247491063e-293 < b

    1. Initial program 11.5

      \[\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-sqr-sqrt11.6

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - \color{blue}{\left(\sqrt{b} \cdot \sqrt{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*11.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -2.333089443411724874919697496858099155432 \cdot 10^{-169} \lor \neg \left(b \le 6.405155247491063031791398908208678375602 \cdot 10^{-293}\right):\\ \;\;\;\;\left(j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\right) - \left(c \cdot z - t \cdot i\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(c \cdot a - y \cdot i\right) + x \cdot \left(y \cdot z - t \cdot a\right)\\ \end{array}\]

Reproduce

herbie shell --seed 1978988140 
(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.46969429677770502e-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)))))