Average Error: 12.0 → 10.3
Time: 8.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}\;a \le -1.9093385244904942 \cdot 10^{32} \lor \neg \left(a \le 9.3561614731253176 \cdot 10^{-41}\right):\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + {\left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right)\right)}^{1}\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}\;a \le -1.9093385244904942 \cdot 10^{32} \lor \neg \left(a \le 9.3561614731253176 \cdot 10^{-41}\right):\\
\;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r563257 = x;
        double r563258 = y;
        double r563259 = z;
        double r563260 = r563258 * r563259;
        double r563261 = t;
        double r563262 = a;
        double r563263 = r563261 * r563262;
        double r563264 = r563260 - r563263;
        double r563265 = r563257 * r563264;
        double r563266 = b;
        double r563267 = c;
        double r563268 = r563267 * r563259;
        double r563269 = i;
        double r563270 = r563269 * r563262;
        double r563271 = r563268 - r563270;
        double r563272 = r563266 * r563271;
        double r563273 = r563265 - r563272;
        double r563274 = j;
        double r563275 = r563267 * r563261;
        double r563276 = r563269 * r563258;
        double r563277 = r563275 - r563276;
        double r563278 = r563274 * r563277;
        double r563279 = r563273 + r563278;
        return r563279;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r563280 = a;
        double r563281 = -1.9093385244904942e+32;
        bool r563282 = r563280 <= r563281;
        double r563283 = 9.356161473125318e-41;
        bool r563284 = r563280 <= r563283;
        double r563285 = !r563284;
        bool r563286 = r563282 || r563285;
        double r563287 = i;
        double r563288 = b;
        double r563289 = r563287 * r563288;
        double r563290 = z;
        double r563291 = c;
        double r563292 = r563288 * r563291;
        double r563293 = x;
        double r563294 = t;
        double r563295 = r563293 * r563294;
        double r563296 = r563280 * r563295;
        double r563297 = fma(r563290, r563292, r563296);
        double r563298 = -r563297;
        double r563299 = fma(r563280, r563289, r563298);
        double r563300 = j;
        double r563301 = r563291 * r563294;
        double r563302 = y;
        double r563303 = r563287 * r563302;
        double r563304 = r563301 - r563303;
        double r563305 = r563300 * r563304;
        double r563306 = r563299 + r563305;
        double r563307 = r563302 * r563290;
        double r563308 = r563294 * r563280;
        double r563309 = r563307 - r563308;
        double r563310 = r563293 * r563309;
        double r563311 = r563280 * r563287;
        double r563312 = -r563311;
        double r563313 = fma(r563291, r563290, r563312);
        double r563314 = r563313 * r563288;
        double r563315 = r563310 - r563314;
        double r563316 = -r563280;
        double r563317 = fma(r563316, r563287, r563311);
        double r563318 = r563317 * r563288;
        double r563319 = r563315 - r563318;
        double r563320 = r563300 * r563291;
        double r563321 = r563294 * r563320;
        double r563322 = -1.0;
        double r563323 = r563302 * r563300;
        double r563324 = r563287 * r563323;
        double r563325 = r563322 * r563324;
        double r563326 = 1.0;
        double r563327 = pow(r563325, r563326);
        double r563328 = r563321 + r563327;
        double r563329 = r563319 + r563328;
        double r563330 = r563286 ? r563306 : r563329;
        return r563330;
}

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

Original12.0
Target16.0
Herbie10.3
\[\begin{array}{l} \mathbf{if}\;t \lt -8.1209789191959122 \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.7125538182184851 \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.63353334603158369 \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 a < -1.9093385244904942e+32 or 9.356161473125318e-41 < a

    1. Initial program 16.1

      \[\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. Taylor expanded around inf 13.5

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

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

    if -1.9093385244904942e+32 < a < 9.356161473125318e-41

    1. Initial program 9.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. Using strategy rm
    3. Applied prod-diff9.2

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

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

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

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

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \color{blue}{\left(\sqrt[3]{j} \cdot \sqrt[3]{j}\right) \cdot \left(\sqrt[3]{j} \cdot \left(c \cdot t - i \cdot y\right)\right)}\]
    9. Using strategy rm
    10. Applied sub-neg9.6

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(\sqrt[3]{j} \cdot \sqrt[3]{j}\right) \cdot \left(\sqrt[3]{j} \cdot \color{blue}{\left(c \cdot t + \left(-i \cdot y\right)\right)}\right)\]
    11. Applied distribute-lft-in9.6

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(\sqrt[3]{j} \cdot \sqrt[3]{j}\right) \cdot \color{blue}{\left(\sqrt[3]{j} \cdot \left(c \cdot t\right) + \sqrt[3]{j} \cdot \left(-i \cdot y\right)\right)}\]
    12. Applied distribute-lft-in9.6

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

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

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + \color{blue}{\left(-j\right) \cdot \left(i \cdot y\right)}\right)\]
    15. Using strategy rm
    16. Applied pow18.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + \left(-j\right) \cdot \left(i \cdot \color{blue}{{y}^{1}}\right)\right)\]
    17. Applied pow18.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + \left(-j\right) \cdot \left(\color{blue}{{i}^{1}} \cdot {y}^{1}\right)\right)\]
    18. Applied pow-prod-down8.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + \left(-j\right) \cdot \color{blue}{{\left(i \cdot y\right)}^{1}}\right)\]
    19. Applied pow18.7

      \[\leadsto \left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + \color{blue}{{\left(-j\right)}^{1}} \cdot {\left(i \cdot y\right)}^{1}\right)\]
    20. Applied pow-prod-down8.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.9093385244904942 \cdot 10^{32} \lor \neg \left(a \le 9.3561614731253176 \cdot 10^{-41}\right):\\ \;\;\;\;\mathsf{fma}\left(a, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, a \cdot \left(x \cdot t\right)\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x \cdot \left(y \cdot z - t \cdot a\right) - \mathsf{fma}\left(c, z, -a \cdot i\right) \cdot b\right) - \mathsf{fma}\left(-a, i, a \cdot i\right) \cdot b\right) + \left(t \cdot \left(j \cdot c\right) + {\left(-1 \cdot \left(i \cdot \left(y \cdot j\right)\right)\right)}^{1}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  :precision binary64

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