Average Error: 12.3 → 9.6
Time: 30.8s
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}\;x \le -121288029597122872982558160740941824:\\ \;\;\;\;\left(t \cdot \left(c \cdot j\right) + \left(-j \cdot \left(i \cdot y\right)\right)\right) + \left(\left(y \cdot z - a \cdot t\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot a\right) + z \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;x \le 1.577780123178828952016443170858821497875 \cdot 10^{66}:\\ \;\;\;\;\left(c \cdot t - i \cdot y\right) \cdot j + \left(\left(\left(z \cdot x\right) \cdot y + \left(-t\right) \cdot \left(a \cdot x\right)\right) - \left(\left(-i\right) \cdot \left(b \cdot a\right) + z \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(y \cdot z - a \cdot t\right) \cdot x - \left(z \cdot \left(b \cdot c\right) + \left(i \cdot a\right) \cdot \left(-b\right)\right)\right) + \left(c \cdot t - i \cdot y\right) \cdot j\\ \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}\;x \le -121288029597122872982558160740941824:\\
\;\;\;\;\left(t \cdot \left(c \cdot j\right) + \left(-j \cdot \left(i \cdot y\right)\right)\right) + \left(\left(y \cdot z - a \cdot t\right) \cdot x - \left(\left(-i\right) \cdot \left(b \cdot a\right) + z \cdot \left(b \cdot c\right)\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r438594 = x;
        double r438595 = y;
        double r438596 = z;
        double r438597 = r438595 * r438596;
        double r438598 = t;
        double r438599 = a;
        double r438600 = r438598 * r438599;
        double r438601 = r438597 - r438600;
        double r438602 = r438594 * r438601;
        double r438603 = b;
        double r438604 = c;
        double r438605 = r438604 * r438596;
        double r438606 = i;
        double r438607 = r438606 * r438599;
        double r438608 = r438605 - r438607;
        double r438609 = r438603 * r438608;
        double r438610 = r438602 - r438609;
        double r438611 = j;
        double r438612 = r438604 * r438598;
        double r438613 = r438606 * r438595;
        double r438614 = r438612 - r438613;
        double r438615 = r438611 * r438614;
        double r438616 = r438610 + r438615;
        return r438616;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r438617 = x;
        double r438618 = -1.2128802959712287e+35;
        bool r438619 = r438617 <= r438618;
        double r438620 = t;
        double r438621 = c;
        double r438622 = j;
        double r438623 = r438621 * r438622;
        double r438624 = r438620 * r438623;
        double r438625 = i;
        double r438626 = y;
        double r438627 = r438625 * r438626;
        double r438628 = r438622 * r438627;
        double r438629 = -r438628;
        double r438630 = r438624 + r438629;
        double r438631 = z;
        double r438632 = r438626 * r438631;
        double r438633 = a;
        double r438634 = r438633 * r438620;
        double r438635 = r438632 - r438634;
        double r438636 = r438635 * r438617;
        double r438637 = -r438625;
        double r438638 = b;
        double r438639 = r438638 * r438633;
        double r438640 = r438637 * r438639;
        double r438641 = r438638 * r438621;
        double r438642 = r438631 * r438641;
        double r438643 = r438640 + r438642;
        double r438644 = r438636 - r438643;
        double r438645 = r438630 + r438644;
        double r438646 = 1.577780123178829e+66;
        bool r438647 = r438617 <= r438646;
        double r438648 = r438621 * r438620;
        double r438649 = r438648 - r438627;
        double r438650 = r438649 * r438622;
        double r438651 = r438631 * r438617;
        double r438652 = r438651 * r438626;
        double r438653 = -r438620;
        double r438654 = r438633 * r438617;
        double r438655 = r438653 * r438654;
        double r438656 = r438652 + r438655;
        double r438657 = r438656 - r438643;
        double r438658 = r438650 + r438657;
        double r438659 = r438625 * r438633;
        double r438660 = -r438638;
        double r438661 = r438659 * r438660;
        double r438662 = r438642 + r438661;
        double r438663 = r438636 - r438662;
        double r438664 = r438663 + r438650;
        double r438665 = r438647 ? r438658 : r438664;
        double r438666 = r438619 ? r438645 : r438665;
        return r438666;
}

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.3
Target16.1
Herbie9.6
\[\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 3 regimes
  2. if x < -1.2128802959712287e+35

    1. Initial program 7.9

      \[\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. 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(-i \cdot a\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\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(-i \cdot a\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Simplified9.0

      \[\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(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    6. Simplified8.8

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

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

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

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

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

    if -1.2128802959712287e+35 < x < 1.577780123178829e+66

    1. Initial program 14.5

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

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

      \[\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(-i \cdot a\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Simplified14.5

      \[\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(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    6. Simplified14.2

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

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

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

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

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

    if 1.577780123178829e+66 < x

    1. Initial program 6.6

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

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

      \[\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(-i \cdot a\right)\right)}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Simplified8.6

      \[\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(-i \cdot a\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\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(-i\right) \cdot \left(a \cdot b\right)}\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    7. Using strategy rm
    8. Applied *-un-lft-identity8.1

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

      \[\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(\left(-i\right) \cdot \left(a \cdot b\right)\right)}\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    10. Simplified8.6

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

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

Reproduce

herbie shell --seed 2019196 
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"

  :herbie-target
  (if (< t -8.120978919195912e-33) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -4.712553818218485e-169) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2.0) (pow (* i y) 2.0))) (+ (* c t) (* i y)))) (if (< t -7.633533346031584e-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.0) (pow (* i y) 2.0))) (+ (* 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)))))