Average Error: 11.6 → 8.3
Time: 2.1m
Precision: 64
Internal Precision: 576
\[\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 \cdot \left(t \cdot c - i \cdot y\right) + \left(\left(x \cdot z\right) \cdot y\right))_* - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(a \cdot x\right) \cdot t\right))_* = -\infty:\\ \;\;\;\;x \cdot \left(y \cdot z\right) + \left(\left(\sqrt[3]{j \cdot \left(c \cdot t - y \cdot i\right)} \cdot \sqrt[3]{j \cdot \left(c \cdot t - y \cdot i\right)}\right) \cdot \sqrt[3]{j \cdot \left(c \cdot t - y \cdot i\right)} - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(t \cdot x\right) \cdot a\right))_*\right)\\ \mathbf{if}\;(j \cdot \left(t \cdot c - i \cdot y\right) + \left(\left(x \cdot z\right) \cdot y\right))_* - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(a \cdot x\right) \cdot t\right))_* \le 1.2693902863837982 \cdot 10^{+304}:\\ \;\;\;\;(j \cdot \left(t \cdot c - i \cdot y\right) + \left(\left(x \cdot z\right) \cdot y\right))_* - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(a \cdot x\right) \cdot t\right))_*\\ \mathbf{else}:\\ \;\;\;\;(\left((c \cdot \left(-z\right) + \left(i \cdot a\right))_*\right) \cdot b + \left(\left(z \cdot y - a \cdot t\right) \cdot x\right))_*\\ \end{array}\]

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

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Derivation

  1. Split input into 3 regimes
  2. if (- (fma j (- (* t c) (* i y)) (* (* x z) y)) (fma b (- (* z c) (* a i)) (* (* a x) t))) < -inf.0

    1. Initial program 41.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. Using strategy rm
    3. Applied sub-neg41.5

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

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\right)\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Applied associate--l+41.5

      \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z\right) + \left(x \cdot \left(-t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\]
    6. Applied associate-+l+41.5

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + \left(\left(x \cdot \left(-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)\right)}\]
    7. Applied simplify42.6

      \[\leadsto x \cdot \left(y \cdot z\right) + \color{blue}{\left(j \cdot \left(c \cdot t - y \cdot i\right) - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(t \cdot x\right) \cdot a\right))_*\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt42.6

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

    if -inf.0 < (- (fma j (- (* t c) (* i y)) (* (* x z) y)) (fma b (- (* z c) (* a i)) (* (* a x) t))) < 1.2693902863837982e+304

    1. Initial program 4.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. Using strategy rm
    3. Applied sub-neg4.7

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

      \[\leadsto \left(\color{blue}{\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\right)\right)} - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    5. Applied associate--l+4.7

      \[\leadsto \color{blue}{\left(x \cdot \left(y \cdot z\right) + \left(x \cdot \left(-t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right)\right)} + j \cdot \left(c \cdot t - i \cdot y\right)\]
    6. Applied associate-+l+4.7

      \[\leadsto \color{blue}{x \cdot \left(y \cdot z\right) + \left(\left(x \cdot \left(-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)\right)}\]
    7. Applied simplify5.1

      \[\leadsto x \cdot \left(y \cdot z\right) + \color{blue}{\left(j \cdot \left(c \cdot t - y \cdot i\right) - (b \cdot \left(z \cdot c - a \cdot i\right) + \left(\left(t \cdot x\right) \cdot a\right))_*\right)}\]
    8. Taylor expanded around inf 5.1

      \[\leadsto x \cdot \left(y \cdot z\right) + \left(j \cdot \left(c \cdot t - y \cdot i\right) - (b \cdot \left(z \cdot c - a \cdot i\right) + \color{blue}{\left(a \cdot \left(t \cdot x\right)\right)})_*\right)\]
    9. Applied simplify0.8

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

    if 1.2693902863837982e+304 < (- (fma j (- (* t c) (* i y)) (* (* x z) y)) (fma b (- (* z c) (* a i)) (* (* a x) t)))

    1. Initial program 40.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. Taylor expanded around 0 37.1

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + \color{blue}{0}\]
    3. Applied simplify37.1

      \[\leadsto \color{blue}{(\left((c \cdot \left(-z\right) + \left(i \cdot a\right))_*\right) \cdot b + \left(\left(z \cdot y - a \cdot t\right) \cdot x\right))_*}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 2.1m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +o rules:numerics
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"
  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))