Average Error: 12.0 → 12.1
Time: 34.5s
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 9.242667919964829558492511784649235589271 \cdot 10^{144}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot y - c \cdot b\right) - \left(t \cdot a\right) \cdot x\\ \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 9.242667919964829558492511784649235589271 \cdot 10^{144}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot c - y \cdot i, j, \mathsf{fma}\left(a \cdot i - c \cdot z, b, \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot x\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r30300726 = x;
        double r30300727 = y;
        double r30300728 = z;
        double r30300729 = r30300727 * r30300728;
        double r30300730 = t;
        double r30300731 = a;
        double r30300732 = r30300730 * r30300731;
        double r30300733 = r30300729 - r30300732;
        double r30300734 = r30300726 * r30300733;
        double r30300735 = b;
        double r30300736 = c;
        double r30300737 = r30300736 * r30300728;
        double r30300738 = i;
        double r30300739 = r30300738 * r30300731;
        double r30300740 = r30300737 - r30300739;
        double r30300741 = r30300735 * r30300740;
        double r30300742 = r30300734 - r30300741;
        double r30300743 = j;
        double r30300744 = r30300736 * r30300730;
        double r30300745 = r30300738 * r30300727;
        double r30300746 = r30300744 - r30300745;
        double r30300747 = r30300743 * r30300746;
        double r30300748 = r30300742 + r30300747;
        return r30300748;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r30300749 = z;
        double r30300750 = 9.24266791996483e+144;
        bool r30300751 = r30300749 <= r30300750;
        double r30300752 = t;
        double r30300753 = c;
        double r30300754 = r30300752 * r30300753;
        double r30300755 = y;
        double r30300756 = i;
        double r30300757 = r30300755 * r30300756;
        double r30300758 = r30300754 - r30300757;
        double r30300759 = j;
        double r30300760 = a;
        double r30300761 = r30300760 * r30300756;
        double r30300762 = r30300753 * r30300749;
        double r30300763 = r30300761 - r30300762;
        double r30300764 = b;
        double r30300765 = r30300755 * r30300749;
        double r30300766 = r30300752 * r30300760;
        double r30300767 = r30300765 - r30300766;
        double r30300768 = cbrt(r30300767);
        double r30300769 = r30300768 * r30300768;
        double r30300770 = r30300768 * r30300769;
        double r30300771 = x;
        double r30300772 = r30300770 * r30300771;
        double r30300773 = fma(r30300763, r30300764, r30300772);
        double r30300774 = fma(r30300758, r30300759, r30300773);
        double r30300775 = r30300771 * r30300755;
        double r30300776 = r30300753 * r30300764;
        double r30300777 = r30300775 - r30300776;
        double r30300778 = r30300749 * r30300777;
        double r30300779 = r30300766 * r30300771;
        double r30300780 = r30300778 - r30300779;
        double r30300781 = r30300751 ? r30300774 : r30300780;
        return r30300781;
}

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
Target15.7
Herbie12.1
\[\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 2 regimes
  2. if z < 9.24266791996483e+144

    1. Initial program 10.9

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

      \[\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 add-cube-cbrt11.2

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

    if 9.24266791996483e+144 < z

    1. Initial program 23.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. Simplified23.3

      \[\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 28.7

      \[\leadsto \color{blue}{x \cdot \left(z \cdot y\right) - \left(z \cdot \left(b \cdot c\right) + a \cdot \left(x \cdot t\right)\right)}\]
    4. Simplified21.6

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

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

Reproduce

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