DO j=1,n-1 DO i=j+1,n m = - A(i,j)/A(j,j) DO k=j+1,n A(i,k) = A(i,k) - m*A(j,k) END DO A(i,j) = m END DO END DOThe number of multiplications and divisions used is
For the backward substitution the algorithm that
b(n) = b(n)/A(n,n) DO j=n-1,1,-1 DO k=j+1,n b(j) = b(j) - A(j,k)*b(k) END DO b(j) = b(j)/A(j,j) END DO
The number of multiplications is about .