Average Error: 12.3 → 12.0
Time: 33.0s
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}\;i \le -2.734577024275635776606896347876237358818 \cdot 10^{-142}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(\left(c \cdot t\right) \cdot j + i \cdot \left(\left(-y\right) \cdot j\right)\right)\\ \mathbf{elif}\;i \le 3.189483550666528306044484300359716331537 \cdot 10^{-261}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(c \cdot \left(t \cdot j\right) + \left(-i \cdot y\right) \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(t \cdot \left(j \cdot c\right) + \left(-i \cdot y\right) \cdot j\right)\\ \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}\;i \le -2.734577024275635776606896347876237358818 \cdot 10^{-142}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \left(\left(c \cdot t\right) \cdot j + i \cdot \left(\left(-y\right) \cdot j\right)\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r78848652 = x;
        double r78848653 = y;
        double r78848654 = z;
        double r78848655 = r78848653 * r78848654;
        double r78848656 = t;
        double r78848657 = a;
        double r78848658 = r78848656 * r78848657;
        double r78848659 = r78848655 - r78848658;
        double r78848660 = r78848652 * r78848659;
        double r78848661 = b;
        double r78848662 = c;
        double r78848663 = r78848662 * r78848654;
        double r78848664 = i;
        double r78848665 = r78848664 * r78848657;
        double r78848666 = r78848663 - r78848665;
        double r78848667 = r78848661 * r78848666;
        double r78848668 = r78848660 - r78848667;
        double r78848669 = j;
        double r78848670 = r78848662 * r78848656;
        double r78848671 = r78848664 * r78848653;
        double r78848672 = r78848670 - r78848671;
        double r78848673 = r78848669 * r78848672;
        double r78848674 = r78848668 + r78848673;
        return r78848674;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r78848675 = i;
        double r78848676 = -2.7345770242756358e-142;
        bool r78848677 = r78848675 <= r78848676;
        double r78848678 = x;
        double r78848679 = y;
        double r78848680 = z;
        double r78848681 = r78848679 * r78848680;
        double r78848682 = t;
        double r78848683 = a;
        double r78848684 = r78848682 * r78848683;
        double r78848685 = r78848681 - r78848684;
        double r78848686 = r78848678 * r78848685;
        double r78848687 = b;
        double r78848688 = c;
        double r78848689 = r78848688 * r78848680;
        double r78848690 = r78848675 * r78848683;
        double r78848691 = r78848689 - r78848690;
        double r78848692 = r78848687 * r78848691;
        double r78848693 = r78848686 - r78848692;
        double r78848694 = r78848688 * r78848682;
        double r78848695 = j;
        double r78848696 = r78848694 * r78848695;
        double r78848697 = -r78848679;
        double r78848698 = r78848697 * r78848695;
        double r78848699 = r78848675 * r78848698;
        double r78848700 = r78848696 + r78848699;
        double r78848701 = r78848693 + r78848700;
        double r78848702 = 3.1894835506665283e-261;
        bool r78848703 = r78848675 <= r78848702;
        double r78848704 = r78848682 * r78848695;
        double r78848705 = r78848688 * r78848704;
        double r78848706 = r78848675 * r78848679;
        double r78848707 = -r78848706;
        double r78848708 = r78848707 * r78848695;
        double r78848709 = r78848705 + r78848708;
        double r78848710 = r78848693 + r78848709;
        double r78848711 = r78848695 * r78848688;
        double r78848712 = r78848682 * r78848711;
        double r78848713 = r78848712 + r78848708;
        double r78848714 = r78848693 + r78848713;
        double r78848715 = r78848703 ? r78848710 : r78848714;
        double r78848716 = r78848677 ? r78848701 : r78848715;
        return r78848716;
}

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
Target15.6
Herbie12.0
\[\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 i < -2.7345770242756358e-142

    1. Initial program 14.3

      \[\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.3

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

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

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

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

    if -2.7345770242756358e-142 < i < 3.1894835506665283e-261

    1. Initial program 10.0

      \[\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-neg10.0

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

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{\left(\left(c \cdot t\right) \cdot j + \left(-i \cdot y\right) \cdot j\right)}\]
    5. Using strategy rm
    6. Applied associate-*l*10.6

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

    if 3.1894835506665283e-261 < i

    1. Initial program 12.0

      \[\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-neg12.0

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

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

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

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

Reproduce

herbie shell --seed 2019173 +o rules:numerics
(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)))))