Average Error: 11.9 → 10.4
Time: 29.0s
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 2.601442109879438909334021118328802127187 \cdot 10^{51}:\\ \;\;\;\;\left(\left(x \cdot z\right) \cdot y + \left(-\left(x \cdot a\right) \cdot t\right)\right) + \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot z - t \cdot a\right) + \mathsf{fma}\left(b, i \cdot a - c \cdot z, \left(j \cdot \left(\sqrt[3]{c \cdot t - i \cdot y} \cdot \sqrt[3]{c \cdot t - i \cdot y}\right)\right) \cdot \sqrt[3]{c \cdot t - i \cdot y}\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 2.601442109879438909334021118328802127187 \cdot 10^{51}:\\
\;\;\;\;\left(\left(x \cdot z\right) \cdot y + \left(-\left(x \cdot a\right) \cdot t\right)\right) + \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r284694 = x;
        double r284695 = y;
        double r284696 = z;
        double r284697 = r284695 * r284696;
        double r284698 = t;
        double r284699 = a;
        double r284700 = r284698 * r284699;
        double r284701 = r284697 - r284700;
        double r284702 = r284694 * r284701;
        double r284703 = b;
        double r284704 = c;
        double r284705 = r284704 * r284696;
        double r284706 = i;
        double r284707 = r284706 * r284699;
        double r284708 = r284705 - r284707;
        double r284709 = r284703 * r284708;
        double r284710 = r284702 - r284709;
        double r284711 = j;
        double r284712 = r284704 * r284698;
        double r284713 = r284706 * r284695;
        double r284714 = r284712 - r284713;
        double r284715 = r284711 * r284714;
        double r284716 = r284710 + r284715;
        return r284716;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r284717 = x;
        double r284718 = 2.601442109879439e+51;
        bool r284719 = r284717 <= r284718;
        double r284720 = z;
        double r284721 = r284717 * r284720;
        double r284722 = y;
        double r284723 = r284721 * r284722;
        double r284724 = a;
        double r284725 = r284717 * r284724;
        double r284726 = t;
        double r284727 = r284725 * r284726;
        double r284728 = -r284727;
        double r284729 = r284723 + r284728;
        double r284730 = b;
        double r284731 = i;
        double r284732 = r284731 * r284724;
        double r284733 = c;
        double r284734 = r284733 * r284720;
        double r284735 = r284732 - r284734;
        double r284736 = j;
        double r284737 = r284733 * r284726;
        double r284738 = r284731 * r284722;
        double r284739 = r284737 - r284738;
        double r284740 = r284736 * r284739;
        double r284741 = fma(r284730, r284735, r284740);
        double r284742 = r284729 + r284741;
        double r284743 = r284722 * r284720;
        double r284744 = r284726 * r284724;
        double r284745 = r284743 - r284744;
        double r284746 = r284717 * r284745;
        double r284747 = cbrt(r284739);
        double r284748 = r284747 * r284747;
        double r284749 = r284736 * r284748;
        double r284750 = r284749 * r284747;
        double r284751 = fma(r284730, r284735, r284750);
        double r284752 = r284746 + r284751;
        double r284753 = r284719 ? r284742 : r284752;
        return r284753;
}

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.9
Target15.8
Herbie10.4
\[\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 x < 2.601442109879439e+51

    1. Initial program 12.7

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \left(z \cdot y\right) + \color{blue}{\left(-a \cdot \left(x \cdot t\right)\right)}\right) + \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\]
    10. Using strategy rm
    11. Applied associate-*r*12.2

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

      \[\leadsto \left(x \cdot \left(z \cdot y\right) + \left(-\color{blue}{\left(x \cdot a\right)} \cdot t\right)\right) + \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - i \cdot y\right)\right)\]
    13. Using strategy rm
    14. Applied associate-*r*10.9

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

    if 2.601442109879439e+51 < x

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

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

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

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

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

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

Reproduce

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