Average Error: 12.2 → 10.9
Time: 10.6s
Precision: binary64
\[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.80999127503398181 \cdot 10^{125}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + b \cdot \left(t \cdot \left(-i\right)\right)\right)\right) + \left(j \cdot \left(a \cdot c\right) + y \cdot \left(i \cdot \left(-j\right)\right)\right)\\ \mathbf{elif}\;z \le -4.52108151681044006 \cdot 10^{-185}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \left(y \cdot \left(i \cdot \left(-j\right)\right) + c \cdot \left(a \cdot j\right)\right)\\ \mathbf{elif}\;z \le 6.0021770828057849 \cdot 10^{-198}:\\ \;\;\;\;\left(x \cdot \left(z \cdot y - t \cdot a\right) - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\left(z \cdot c - t \cdot i\right) \cdot \sqrt[3]{b}\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;z \le 1.0430332099538765 \cdot 10^{62}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \left(y \cdot \left(i \cdot \left(-j\right)\right) + c \cdot \left(a \cdot j\right)\right)\\ \mathbf{elif}\;z \le 4.87238338170195485 \cdot 10^{109}:\\ \;\;\;\;\left(x \cdot \left(z \cdot y - t \cdot a\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)} \cdot \left(\sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)} \cdot \sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + i \cdot \left(t \cdot \left(-b\right)\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

Target

Original12.2
Target20.3
Herbie10.9
\[\begin{array}{l} \mathbf{if}\;x \lt -1.46969429677770502 \cdot 10^{-64}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \mathbf{elif}\;x \lt 3.2113527362226803 \cdot 10^{-147}:\\ \;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - j \cdot \left(c \cdot a - y \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\ \end{array}\]

Derivation

  1. Split input into 5 regimes
  2. if z < -5.80999127503398181e125

    1. Initial program 22.1

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Using strategy rm
    3. Applied sub-neg22.1

      \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot z + \left(-t \cdot a\right)\right)} - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    4. Applied distribute-lft-in22.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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified16.6

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

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

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

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

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

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

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

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

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

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

    if -5.80999127503398181e125 < z < -4.52108151681044006e-185 or 6.0021770828057849e-198 < z < 1.0430332099538765e62

    1. Initial program 9.6

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Using strategy rm
    3. Applied sub-neg9.6

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified11.0

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

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

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

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

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

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

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

    if -4.52108151681044006e-185 < z < 6.0021770828057849e-198

    1. Initial program 9.7

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt9.9

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

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

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

    if 1.0430332099538765e62 < z < 4.87238338170195485e109

    1. Initial program 13.4

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt13.6

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

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

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

    if 4.87238338170195485e109 < z

    1. Initial program 21.6

      \[\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    2. Using strategy rm
    3. Applied sub-neg21.6

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

      \[\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 - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\]
    5. Simplified16.5

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.80999127503398181 \cdot 10^{125}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + b \cdot \left(t \cdot \left(-i\right)\right)\right)\right) + \left(j \cdot \left(a \cdot c\right) + y \cdot \left(i \cdot \left(-j\right)\right)\right)\\ \mathbf{elif}\;z \le -4.52108151681044006 \cdot 10^{-185}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \left(y \cdot \left(i \cdot \left(-j\right)\right) + c \cdot \left(a \cdot j\right)\right)\\ \mathbf{elif}\;z \le 6.0021770828057849 \cdot 10^{-198}:\\ \;\;\;\;\left(x \cdot \left(z \cdot y - t \cdot a\right) - \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\left(z \cdot c - t \cdot i\right) \cdot \sqrt[3]{b}\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\ \mathbf{elif}\;z \le 1.0430332099538765 \cdot 10^{62}:\\ \;\;\;\;\left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \left(y \cdot \left(i \cdot \left(-j\right)\right) + c \cdot \left(a \cdot j\right)\right)\\ \mathbf{elif}\;z \le 4.87238338170195485 \cdot 10^{109}:\\ \;\;\;\;\left(x \cdot \left(z \cdot y - t \cdot a\right) - b \cdot \left(z \cdot c - t \cdot i\right)\right) + \sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)} \cdot \left(\sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)} \cdot \sqrt[3]{j \cdot \left(a \cdot c - y \cdot i\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(\left(z \cdot x\right) \cdot y + t \cdot \left(x \cdot \left(-a\right)\right)\right) - \left(z \cdot \left(b \cdot c\right) + i \cdot \left(t \cdot \left(-b\right)\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z t a b c i j)
  :name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
  :precision binary64

  :herbie-target
  (if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))

  (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))