Average Error: 12.1 → 11.0
Time: 30.7s
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}\;t \le -8.726925738034539270507380773704722857084 \cdot 10^{-133} \lor \neg \left(t \le 5.076318876201314174297201710312870570435 \cdot 10^{-117}\right):\\ \;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, b \cdot \left(i \cdot a - c \cdot z\right) + \left(\left(j \cdot c\right) \cdot t + \left(-y \cdot \left(i \cdot j\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\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}\;t \le -8.726925738034539270507380773704722857084 \cdot 10^{-133} \lor \neg \left(t \le 5.076318876201314174297201710312870570435 \cdot 10^{-117}\right):\\
\;\;\;\;\mathsf{fma}\left(x, y \cdot z - t \cdot a, b \cdot \left(i \cdot a - c \cdot z\right) + \left(\left(j \cdot c\right) \cdot t + \left(-y \cdot \left(i \cdot j\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot z - t \cdot a, x, \mathsf{fma}\left(b, i \cdot a - c \cdot z, j \cdot \left(c \cdot t - y \cdot i\right)\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 r496171 = x;
        double r496172 = y;
        double r496173 = z;
        double r496174 = r496172 * r496173;
        double r496175 = t;
        double r496176 = a;
        double r496177 = r496175 * r496176;
        double r496178 = r496174 - r496177;
        double r496179 = r496171 * r496178;
        double r496180 = b;
        double r496181 = c;
        double r496182 = r496181 * r496173;
        double r496183 = i;
        double r496184 = r496183 * r496176;
        double r496185 = r496182 - r496184;
        double r496186 = r496180 * r496185;
        double r496187 = r496179 - r496186;
        double r496188 = j;
        double r496189 = r496181 * r496175;
        double r496190 = r496183 * r496172;
        double r496191 = r496189 - r496190;
        double r496192 = r496188 * r496191;
        double r496193 = r496187 + r496192;
        return r496193;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
        double r496194 = t;
        double r496195 = -8.72692573803454e-133;
        bool r496196 = r496194 <= r496195;
        double r496197 = 5.076318876201314e-117;
        bool r496198 = r496194 <= r496197;
        double r496199 = !r496198;
        bool r496200 = r496196 || r496199;
        double r496201 = x;
        double r496202 = y;
        double r496203 = z;
        double r496204 = r496202 * r496203;
        double r496205 = a;
        double r496206 = r496194 * r496205;
        double r496207 = r496204 - r496206;
        double r496208 = b;
        double r496209 = i;
        double r496210 = r496209 * r496205;
        double r496211 = c;
        double r496212 = r496211 * r496203;
        double r496213 = r496210 - r496212;
        double r496214 = r496208 * r496213;
        double r496215 = j;
        double r496216 = r496215 * r496211;
        double r496217 = r496216 * r496194;
        double r496218 = r496209 * r496215;
        double r496219 = r496202 * r496218;
        double r496220 = -r496219;
        double r496221 = r496217 + r496220;
        double r496222 = r496214 + r496221;
        double r496223 = fma(r496201, r496207, r496222);
        double r496224 = r496211 * r496194;
        double r496225 = r496202 * r496209;
        double r496226 = r496224 - r496225;
        double r496227 = r496215 * r496226;
        double r496228 = fma(r496208, r496213, r496227);
        double r496229 = fma(r496207, r496201, r496228);
        double r496230 = cbrt(r496229);
        double r496231 = r496230 * r496230;
        double r496232 = r496231 * r496230;
        double r496233 = r496200 ? r496223 : r496232;
        return r496233;
}

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
Herbie11.0
\[\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 t < -8.72692573803454e-133 or 5.076318876201314e-117 < t

    1. Initial program 13.8

      \[\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. Simplified13.8

      \[\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 sub-neg13.8

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

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

      \[\leadsto \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\right) + \color{blue}{\left(-i \cdot y\right) \cdot j}\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*11.8

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \color{blue}{\left(j \cdot c\right) \cdot t} + \left(-i \cdot y\right) \cdot j\right)\right)\]
    9. Using strategy rm
    10. Applied distribute-lft-neg-out11.8

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

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

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

    if -8.72692573803454e-133 < t < 5.076318876201314e-117

    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. Simplified9.2

      \[\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 sub-neg9.2

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

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

      \[\leadsto \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\right) + \color{blue}{\left(-i \cdot y\right) \cdot j}\right)\right)\]
    7. Using strategy rm
    8. Applied associate-*r*13.1

      \[\leadsto \mathsf{fma}\left(x, y \cdot z - t \cdot a, \mathsf{fma}\left(b, i \cdot a - c \cdot z, \color{blue}{\left(j \cdot c\right) \cdot t} + \left(-i \cdot y\right) \cdot j\right)\right)\]
    9. Using strategy rm
    10. Applied distribute-lft-neg-out13.1

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

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

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

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

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

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

Reproduce

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