Average Error: 15.7 → 8.8
Time: 3.7m
Precision: 64
Internal Precision: 384
\[\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}\;x \le -2.8672604767171556 \cdot 10^{+124}:\\ \;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(z \cdot c - i \cdot a\right) \cdot b\\ \mathbf{if}\;x \le 8.617752868103377 \cdot 10^{+126}:\\ \;\;\;\;\left(\left(x \cdot z\right) \cdot y + \left(t \cdot x\right) \cdot \left(-a\right)\right) - \left(\left(c \cdot z - i \cdot a\right) \cdot b - j \cdot \left(c \cdot t - y \cdot i\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

Target

Original15.7
Target19.2
Herbie8.8
\[\begin{array}{l} \mathbf{if}\;t \lt -8.120978919195912 \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{if}\;t \lt -4.712553818218485 \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{if}\;t \lt -7.633533346031584 \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{if}\;t \lt 1.0535888557455487 \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 x < -2.8672604767171556e+124 or 8.617752868103377e+126 < x

    1. Initial program 24.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 0 4.3

      \[\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 simplify4.3

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

    if -2.8672604767171556e+124 < x < 8.617752868103377e+126

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

      \[\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-in13.1

      \[\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. Taylor expanded around inf 11.8

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

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

Runtime

Time bar (total: 3.7m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z t a b c i j)
  :name "Linear.Matrix:det33 from linear-1.19.1.3"

  :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)))))