Average Error: 11.2 → 9.5
Time: 33.1s
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}\;z \le -5.827232257640776 \cdot 10^{+78}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - a \cdot \left(t \cdot x\right)\right)\\ \mathbf{elif}\;z \le 2.3673218340026943 \cdot 10^{+98}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - a \cdot \left(t \cdot x\right)\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}\;z \le -5.827232257640776 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - a \cdot \left(t \cdot x\right)\right)\\

\mathbf{elif}\;z \le 2.3673218340026943 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r24225210 = x;
        double r24225211 = y;
        double r24225212 = z;
        double r24225213 = r24225211 * r24225212;
        double r24225214 = t;
        double r24225215 = a;
        double r24225216 = r24225214 * r24225215;
        double r24225217 = r24225213 - r24225216;
        double r24225218 = r24225210 * r24225217;
        double r24225219 = b;
        double r24225220 = c;
        double r24225221 = r24225220 * r24225212;
        double r24225222 = i;
        double r24225223 = r24225222 * r24225215;
        double r24225224 = r24225221 - r24225223;
        double r24225225 = r24225219 * r24225224;
        double r24225226 = r24225218 - r24225225;
        double r24225227 = j;
        double r24225228 = r24225220 * r24225214;
        double r24225229 = r24225222 * r24225211;
        double r24225230 = r24225228 - r24225229;
        double r24225231 = r24225227 * r24225230;
        double r24225232 = r24225226 + r24225231;
        return r24225232;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r24225233 = z;
        double r24225234 = -5.827232257640776e+78;
        bool r24225235 = r24225233 <= r24225234;
        double r24225236 = t;
        double r24225237 = c;
        double r24225238 = r24225236 * r24225237;
        double r24225239 = y;
        double r24225240 = i;
        double r24225241 = r24225239 * r24225240;
        double r24225242 = r24225238 - r24225241;
        double r24225243 = j;
        double r24225244 = x;
        double r24225245 = r24225244 * r24225239;
        double r24225246 = b;
        double r24225247 = r24225237 * r24225246;
        double r24225248 = r24225245 - r24225247;
        double r24225249 = r24225248 * r24225233;
        double r24225250 = a;
        double r24225251 = r24225236 * r24225244;
        double r24225252 = r24225250 * r24225251;
        double r24225253 = r24225249 - r24225252;
        double r24225254 = fma(r24225242, r24225243, r24225253);
        double r24225255 = 2.3673218340026943e+98;
        bool r24225256 = r24225233 <= r24225255;
        double r24225257 = r24225250 * r24225240;
        double r24225258 = r24225237 * r24225233;
        double r24225259 = r24225257 - r24225258;
        double r24225260 = r24225239 * r24225233;
        double r24225261 = r24225236 * r24225250;
        double r24225262 = r24225260 - r24225261;
        double r24225263 = r24225262 * r24225244;
        double r24225264 = fma(r24225259, r24225246, r24225263);
        double r24225265 = cbrt(r24225242);
        double r24225266 = r24225265 * r24225265;
        double r24225267 = r24225265 * r24225243;
        double r24225268 = r24225266 * r24225267;
        double r24225269 = r24225264 + r24225268;
        double r24225270 = r24225256 ? r24225269 : r24225254;
        double r24225271 = r24225235 ? r24225254 : r24225270;
        return r24225271;
}

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

Target

Original11.2
Target15.1
Herbie9.5
\[\begin{array}{l} \mathbf{if}\;t \lt -8.120978919195912 \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.712553818218485 \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.633533346031584 \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.0535888557455487 \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 2 regimes
  2. if z < -5.827232257640776e+78 or 2.3673218340026943e+98 < z

    1. Initial program 19.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(i \cdot a - z \cdot c, b, \left(z \cdot y - t \cdot a\right) \cdot x\right)\right)}\]
    3. Taylor expanded around inf 18.1

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

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

    if -5.827232257640776e+78 < z < 2.3673218340026943e+98

    1. Initial program 8.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. Simplified8.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot c - i \cdot y, j, \mathsf{fma}\left(i \cdot a - z \cdot c, b, \left(z \cdot y - t \cdot a\right) \cdot x\right)\right)}\]
    3. Using strategy rm
    4. Applied fma-udef8.5

      \[\leadsto \color{blue}{\left(t \cdot c - i \cdot y\right) \cdot j + \mathsf{fma}\left(i \cdot a - z \cdot c, b, \left(z \cdot y - t \cdot a\right) \cdot x\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt8.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.827232257640776 \cdot 10^{+78}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - a \cdot \left(t \cdot x\right)\right)\\ \mathbf{elif}\;z \le 2.3673218340026943 \cdot 10^{+98}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(y \cdot z - t \cdot a\right) \cdot x\right) + \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot \sqrt[3]{t \cdot c - y \cdot i}\right) \cdot \left(\sqrt[3]{t \cdot c - y \cdot i} \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \left(x \cdot y - c \cdot b\right) \cdot z - a \cdot \left(t \cdot x\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019168 +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) (pow (* i y) 2))) (+ (* 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) (pow (* i y) 2))) (+ (* 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)))))