kill (all);
A: matrix([1,1,3],[6,4,1],[-5,9,-1])$;
B: matrix([6],[1],[3])$;
X: matrix([0],[0],[0])$;
X0: matrix([x1],[x2],[x3])$;
n: length(A)$;
decimales:4$;
prec:10^decimales$;
detA:determinant(A)$;
AdjA:adjoint(A)$;
I:invert_by_adjoint(A)$; 
I2:invert(A)$;
XS:I.B$;
print(" Sistema = ",float(round(A*prec)/prec),X0,"=",float(B))$
print(" Determinante = ",float(detA))$
print(" Adjunta de A = ",float(AdjA))$
print(" Inversa por adjuntos = ",float(round(I*prec)/prec))$
print(" Inversa por factorización LU = ",float(round(I2*prec)/prec))$
print(" Solución = ",float(round(XS*prec)/prec))$