Average Error: 11.5 → 7.2
Time: 2.2m
Precision: 64
Internal Precision: 320
\[\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 - y \cdot i\right) + \left(z \cdot \left(y \cdot x\right)\right))_* - (\left(c \cdot z - i \cdot a\right) \cdot b + \left(a \cdot \left(t \cdot x\right)\right))_* \le -5.756495905662775 \cdot 10^{+307}:\\ \;\;\;\;(t \cdot \left(j \cdot c - a \cdot x\right) + \left(x \cdot \left(y \cdot z\right)\right))_*\\ \mathbf{if}\;(j \cdot \left(t \cdot c - y \cdot i\right) + \left(z \cdot \left(y \cdot x\right)\right))_* - (\left(c \cdot z - i \cdot a\right) \cdot b + \left(a \cdot \left(t \cdot x\right)\right))_* \le 1.0118769089683686 \cdot 10^{+304}:\\ \;\;\;\;(j \cdot \left(t \cdot c - y \cdot i\right) + \left(z \cdot \left(y \cdot x\right)\right))_* - (\left(c \cdot z - i \cdot a\right) \cdot b + \left(a \cdot \left(t \cdot x\right)\right))_*\\ \mathbf{else}:\\ \;\;\;\;(t \cdot \left(j \cdot c - a \cdot x\right) + \left(x \cdot \left(y \cdot z\right)\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

Derivation

  1. Split input into 2 regimes
  2. if (- (fma j (- (* t c) (* y i)) (* z (* y x))) (fma (- (* c z) (* i a)) b (* a (* t x)))) < -5.756495905662775e+307 or 1.0118769089683686e+304 < (- (fma j (- (* t c) (* y i)) (* z (* y x))) (fma (- (* c z) (* i a)) b (* a (* t x))))

    1. Initial program 39.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. Taylor expanded around inf 32.8

      \[\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}{\left(j \cdot \left(c \cdot t\right) - y \cdot \left(j \cdot i\right)\right)}\]
    3. Applied simplify32.4

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

      \[\leadsto (\left(z \cdot y - a \cdot t\right) \cdot x + \left(\left(j \cdot c\right) \cdot t\right))_* - \color{blue}{0}\]
    5. Applied simplify33.9

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(\left(y \cdot z\right) \cdot x + \left(-t \cdot a\right) \cdot x\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.8

      \[\leadsto \color{blue}{\left(\left(y \cdot z\right) \cdot x + \left(\left(-t \cdot a\right) \cdot x - 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.8

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

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

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

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

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

Runtime

Time bar (total: 2.2m)Debug logProfile

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