Average Error: 12.3 → 10.1
Time: 27.9s
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}\;j \le -9.581789170619479121021143638585490423817 \cdot 10^{99}:\\ \;\;\;\;\mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(x \cdot \sqrt[3]{\mathsf{fma}\left(t, -a, z \cdot y\right)}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(-a, t, z \cdot y\right)} \cdot \sqrt[3]{\mathsf{fma}\left(-a, t, z \cdot y\right)}\right)\right) + \mathsf{fma}\left(i, -y, t \cdot c\right) \cdot j\\ \mathbf{elif}\;j \le 1.656476716176859928364799179216327772733 \cdot 10^{-46}:\\ \;\;\;\;\left(\sqrt[3]{b} \cdot \left(\mathsf{fma}\left(i, a, -z \cdot c\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) + x \cdot \mathsf{fma}\left(-a, t, z \cdot y\right)\right) + \left(t \cdot \left(j \cdot c\right) + \left(i \cdot j\right) \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(\sqrt[3]{x} \cdot \left(\mathsf{fma}\left(t, -a, z \cdot y\right) \cdot \sqrt[3]{x}\right)\right) \cdot \sqrt[3]{x}\right) + \mathsf{fma}\left(i, -y, t \cdot c\right) \cdot j\\ \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}\;j \le -9.581789170619479121021143638585490423817 \cdot 10^{99}:\\
\;\;\;\;\mathsf{fma}\left(b, a \cdot i - z \cdot c, \left(x \cdot \sqrt[3]{\mathsf{fma}\left(t, -a, z \cdot y\right)}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(-a, t, z \cdot y\right)} \cdot \sqrt[3]{\mathsf{fma}\left(-a, t, z \cdot y\right)}\right)\right) + \mathsf{fma}\left(i, -y, t \cdot c\right) \cdot j\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r428558 = x;
        double r428559 = y;
        double r428560 = z;
        double r428561 = r428559 * r428560;
        double r428562 = t;
        double r428563 = a;
        double r428564 = r428562 * r428563;
        double r428565 = r428561 - r428564;
        double r428566 = r428558 * r428565;
        double r428567 = b;
        double r428568 = c;
        double r428569 = r428568 * r428560;
        double r428570 = i;
        double r428571 = r428570 * r428563;
        double r428572 = r428569 - r428571;
        double r428573 = r428567 * r428572;
        double r428574 = r428566 - r428573;
        double r428575 = j;
        double r428576 = r428568 * r428562;
        double r428577 = r428570 * r428559;
        double r428578 = r428576 - r428577;
        double r428579 = r428575 * r428578;
        double r428580 = r428574 + r428579;
        return r428580;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r428581 = j;
        double r428582 = -9.58178917061948e+99;
        bool r428583 = r428581 <= r428582;
        double r428584 = b;
        double r428585 = a;
        double r428586 = i;
        double r428587 = r428585 * r428586;
        double r428588 = z;
        double r428589 = c;
        double r428590 = r428588 * r428589;
        double r428591 = r428587 - r428590;
        double r428592 = x;
        double r428593 = t;
        double r428594 = -r428585;
        double r428595 = y;
        double r428596 = r428588 * r428595;
        double r428597 = fma(r428593, r428594, r428596);
        double r428598 = cbrt(r428597);
        double r428599 = r428592 * r428598;
        double r428600 = fma(r428594, r428593, r428596);
        double r428601 = cbrt(r428600);
        double r428602 = r428601 * r428601;
        double r428603 = r428599 * r428602;
        double r428604 = fma(r428584, r428591, r428603);
        double r428605 = -r428595;
        double r428606 = r428593 * r428589;
        double r428607 = fma(r428586, r428605, r428606);
        double r428608 = r428607 * r428581;
        double r428609 = r428604 + r428608;
        double r428610 = 1.65647671617686e-46;
        bool r428611 = r428581 <= r428610;
        double r428612 = cbrt(r428584);
        double r428613 = -r428590;
        double r428614 = fma(r428586, r428585, r428613);
        double r428615 = r428612 * r428612;
        double r428616 = r428614 * r428615;
        double r428617 = r428612 * r428616;
        double r428618 = r428592 * r428600;
        double r428619 = r428617 + r428618;
        double r428620 = r428581 * r428589;
        double r428621 = r428593 * r428620;
        double r428622 = r428586 * r428581;
        double r428623 = r428622 * r428605;
        double r428624 = r428621 + r428623;
        double r428625 = r428619 + r428624;
        double r428626 = cbrt(r428592);
        double r428627 = r428597 * r428626;
        double r428628 = r428626 * r428627;
        double r428629 = r428628 * r428626;
        double r428630 = fma(r428584, r428591, r428629);
        double r428631 = r428630 + r428608;
        double r428632 = r428611 ? r428625 : r428631;
        double r428633 = r428583 ? r428609 : r428632;
        return r428633;
}

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.3
Target16.3
Herbie10.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 3 regimes
  2. if j < -9.58178917061948e+99

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

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

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

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

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

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

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

    if -9.58178917061948e+99 < j < 1.65647671617686e-46

    1. Initial program 14.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. Simplified14.5

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65647671617686e-46 < j

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

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

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

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

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

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

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

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

Reproduce

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