Average Error: 12.3 → 12.0
Time: 33.3s
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 r171661202 = x;
        double r171661203 = y;
        double r171661204 = z;
        double r171661205 = r171661203 * r171661204;
        double r171661206 = t;
        double r171661207 = a;
        double r171661208 = r171661206 * r171661207;
        double r171661209 = r171661205 - r171661208;
        double r171661210 = r171661202 * r171661209;
        double r171661211 = b;
        double r171661212 = c;
        double r171661213 = r171661212 * r171661204;
        double r171661214 = i;
        double r171661215 = r171661214 * r171661207;
        double r171661216 = r171661213 - r171661215;
        double r171661217 = r171661211 * r171661216;
        double r171661218 = r171661210 - r171661217;
        double r171661219 = j;
        double r171661220 = r171661212 * r171661206;
        double r171661221 = r171661214 * r171661203;
        double r171661222 = r171661220 - r171661221;
        double r171661223 = r171661219 * r171661222;
        double r171661224 = r171661218 + r171661223;
        return r171661224;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r171661225 = i;
        double r171661226 = -2.7345770242756358e-142;
        bool r171661227 = r171661225 <= r171661226;
        double r171661228 = x;
        double r171661229 = y;
        double r171661230 = z;
        double r171661231 = r171661229 * r171661230;
        double r171661232 = t;
        double r171661233 = a;
        double r171661234 = r171661232 * r171661233;
        double r171661235 = r171661231 - r171661234;
        double r171661236 = r171661228 * r171661235;
        double r171661237 = b;
        double r171661238 = c;
        double r171661239 = r171661238 * r171661230;
        double r171661240 = r171661225 * r171661233;
        double r171661241 = r171661239 - r171661240;
        double r171661242 = r171661237 * r171661241;
        double r171661243 = r171661236 - r171661242;
        double r171661244 = r171661238 * r171661232;
        double r171661245 = j;
        double r171661246 = r171661244 * r171661245;
        double r171661247 = -r171661229;
        double r171661248 = r171661247 * r171661245;
        double r171661249 = r171661225 * r171661248;
        double r171661250 = r171661246 + r171661249;
        double r171661251 = r171661243 + r171661250;
        double r171661252 = 3.1894835506665283e-261;
        bool r171661253 = r171661225 <= r171661252;
        double r171661254 = r171661232 * r171661245;
        double r171661255 = r171661238 * r171661254;
        double r171661256 = r171661225 * r171661229;
        double r171661257 = -r171661256;
        double r171661258 = r171661257 * r171661245;
        double r171661259 = r171661255 + r171661258;
        double r171661260 = r171661243 + r171661259;
        double r171661261 = r171661245 * r171661238;
        double r171661262 = r171661232 * r171661261;
        double r171661263 = r171661262 + r171661258;
        double r171661264 = r171661243 + r171661263;
        double r171661265 = r171661253 ? r171661260 : r171661264;
        double r171661266 = r171661227 ? r171661251 : r171661265;
        return r171661266;
}

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 
(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)))))