Average Error: 11.6 → 5.9
Time: 2.6m
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(x \cdot y\right) \cdot z + \left(j \cdot \left(c \cdot t - y \cdot i\right) + \left(\left(a \cdot \left(i \cdot b\right) + a \cdot \left(-x \cdot t\right)\right) - z \cdot \left(c \cdot b\right)\right)\right) = -\infty:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left(\left(c \cdot z\right) \cdot \left(c \cdot z\right) - \left(i \cdot a\right) \cdot \left(i \cdot a\right)\right)}{c \cdot z + i \cdot a}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\ \mathbf{if}\;\left(x \cdot y\right) \cdot z + \left(j \cdot \left(c \cdot t - y \cdot i\right) + \left(\left(a \cdot \left(i \cdot b\right) + a \cdot \left(-x \cdot t\right)\right) - z \cdot \left(c \cdot b\right)\right)\right) \le 1.2693902863837982 \cdot 10^{+304}:\\ \;\;\;\;\left(x \cdot y\right) \cdot z + \left(j \cdot \left(c \cdot t - y \cdot i\right) + \left(\left(a \cdot \left(i \cdot b\right) + a \cdot \left(-x \cdot t\right)\right) - z \cdot \left(c \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(z \cdot c - i \cdot a\right) \cdot b\\ \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 3 regimes
  2. if (+ (* (* x y) z) (+ (* j (- (* c t) (* y i))) (- (+ (* a (* i b)) (* a (- (* x t)))) (* z (* c b))))) < -inf.0

    1. Initial program 22.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. Using strategy rm
    3. Applied flip--27.4

      \[\leadsto \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \color{blue}{\frac{\left(c \cdot z\right) \cdot \left(c \cdot z\right) - \left(i \cdot a\right) \cdot \left(i \cdot a\right)}{c \cdot z + i \cdot a}}\right) + j \cdot \left(c \cdot t - i \cdot y\right)\]
    4. Applied associate-*r/31.2

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

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

    1. Initial program 8.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-neg8.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-lft-in8.8

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot z} + \left(\left(j \cdot \left(c \cdot t - y \cdot i\right) - \left(t \cdot x\right) \cdot a\right) - b \cdot \left(z \cdot c - a \cdot i\right)\right)\]
    10. Using strategy rm
    11. Applied sub-neg5.0

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

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

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

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

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

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

    1. Initial program 25.1

      \[\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 24.4

      \[\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 simplify24.4

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

Runtime

Time bar (total: 2.6m)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' 
(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)))))