Average Error: 12.1 → 12.3
Time: 11.2s
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 -5.6638058677896054 \cdot 10^{-176}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\left(\sqrt[3]{c \cdot z - i \cdot a} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a} \cdot \sqrt[3]{c \cdot z - i \cdot a}} \cdot \sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a}}\right)\right) \cdot \sqrt[3]{c \cdot z - i \cdot a}\right)\right)\\ \mathbf{elif}\;x \le 3.5355044355755603 \cdot 10^{-198}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \sqrt{x} \cdot \left(\sqrt{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\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}\;x \le -5.6638058677896054 \cdot 10^{-176}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\left(\sqrt[3]{c \cdot z - i \cdot a} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a} \cdot \sqrt[3]{c \cdot z - i \cdot a}} \cdot \sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a}}\right)\right) \cdot \sqrt[3]{c \cdot z - i \cdot a}\right)\right)\\

\mathbf{elif}\;x \le 3.5355044355755603 \cdot 10^{-198}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \sqrt{x} \cdot \left(\sqrt{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\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 r524003 = x;
        double r524004 = y;
        double r524005 = z;
        double r524006 = r524004 * r524005;
        double r524007 = t;
        double r524008 = a;
        double r524009 = r524007 * r524008;
        double r524010 = r524006 - r524009;
        double r524011 = r524003 * r524010;
        double r524012 = b;
        double r524013 = c;
        double r524014 = r524013 * r524005;
        double r524015 = i;
        double r524016 = r524015 * r524008;
        double r524017 = r524014 - r524016;
        double r524018 = r524012 * r524017;
        double r524019 = r524011 - r524018;
        double r524020 = j;
        double r524021 = r524013 * r524007;
        double r524022 = r524015 * r524004;
        double r524023 = r524021 - r524022;
        double r524024 = r524020 * r524023;
        double r524025 = r524019 + r524024;
        return r524025;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r524026 = x;
        double r524027 = -5.6638058677896054e-176;
        bool r524028 = r524026 <= r524027;
        double r524029 = c;
        double r524030 = t;
        double r524031 = r524029 * r524030;
        double r524032 = i;
        double r524033 = y;
        double r524034 = r524032 * r524033;
        double r524035 = r524031 - r524034;
        double r524036 = j;
        double r524037 = z;
        double r524038 = r524033 * r524037;
        double r524039 = a;
        double r524040 = r524030 * r524039;
        double r524041 = r524038 - r524040;
        double r524042 = r524026 * r524041;
        double r524043 = b;
        double r524044 = r524029 * r524037;
        double r524045 = r524032 * r524039;
        double r524046 = r524044 - r524045;
        double r524047 = cbrt(r524046);
        double r524048 = r524047 * r524047;
        double r524049 = cbrt(r524048);
        double r524050 = cbrt(r524047);
        double r524051 = r524049 * r524050;
        double r524052 = r524047 * r524051;
        double r524053 = r524052 * r524047;
        double r524054 = r524043 * r524053;
        double r524055 = r524042 - r524054;
        double r524056 = fma(r524035, r524036, r524055);
        double r524057 = 3.53550443557556e-198;
        bool r524058 = r524026 <= r524057;
        double r524059 = 0.0;
        double r524060 = r524043 * r524046;
        double r524061 = r524059 - r524060;
        double r524062 = fma(r524035, r524036, r524061);
        double r524063 = sqrt(r524026);
        double r524064 = r524063 * r524041;
        double r524065 = r524063 * r524064;
        double r524066 = r524065 - r524060;
        double r524067 = fma(r524035, r524036, r524066);
        double r524068 = r524058 ? r524062 : r524067;
        double r524069 = r524028 ? r524056 : r524068;
        return r524069;
}

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.1
Target16.0
Herbie12.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 3 regimes
  2. if x < -5.6638058677896054e-176

    1. Initial program 10.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. Simplified10.1

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

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

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

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

    if -5.6638058677896054e-176 < x < 3.53550443557556e-198

    1. Initial program 16.4

      \[\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. Simplified16.4

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

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

    if 3.53550443557556e-198 < x

    1. Initial program 11.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. Simplified11.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -5.6638058677896054 \cdot 10^{-176}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(\left(\sqrt[3]{c \cdot z - i \cdot a} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a} \cdot \sqrt[3]{c \cdot z - i \cdot a}} \cdot \sqrt[3]{\sqrt[3]{c \cdot z - i \cdot a}}\right)\right) \cdot \sqrt[3]{c \cdot z - i \cdot a}\right)\right)\\ \mathbf{elif}\;x \le 3.5355044355755603 \cdot 10^{-198}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, 0 - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c \cdot t - i \cdot y, j, \sqrt{x} \cdot \left(\sqrt{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020081 +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)))))