Average Error: 12.1 → 4.5
Time: 3.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}\;(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\left(b \cdot c\right) \cdot \left(-z\right)\right))_* + (i \cdot \left(a \cdot b - j \cdot y\right) + \left(c \cdot \left(j \cdot t\right)\right))_* \le -8.979907515931086 \cdot 10^{+305}:\\ \;\;\;\;\left(y \cdot z\right) \cdot x + \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)\\ \mathbf{elif}\;(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\left(b \cdot c\right) \cdot \left(-z\right)\right))_* + (i \cdot \left(a \cdot b - j \cdot y\right) + \left(c \cdot \left(j \cdot t\right)\right))_* \le 1.0372426787578306 \cdot 10^{+308}:\\ \;\;\;\;(\left(y \cdot z - t \cdot a\right) \cdot x + \left(\left(b \cdot c\right) \cdot \left(-z\right)\right))_* + (i \cdot \left(a \cdot b - j \cdot y\right) + \left(c \cdot \left(j \cdot t\right)\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot z\right) \cdot x + \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)\\ \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 (- (* y z) (* t a)) x (* (* b c) (- z))) (fma i (- (* a b) (* j y)) (* c (* j t)))) < -8.979907515931086e+305 or 1.0372426787578306e+308 < (+ (fma (- (* y z) (* t a)) x (* (* b c) (- z))) (fma i (- (* a b) (* j y)) (* c (* j t))))

    1. Initial program 26.0

      \[\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-neg26.0

      \[\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-in26.0

      \[\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+26.0

      \[\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+26.0

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

      \[\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)}\]

    if -8.979907515931086e+305 < (+ (fma (- (* y z) (* t a)) x (* (* b c) (- z))) (fma i (- (* a b) (* j y)) (* c (* j t)))) < 1.0372426787578306e+308

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

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

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

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

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

Runtime

Time bar (total: 3.1m)Debug logProfile

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