Develop a subprogram to achieve the LU decomposition of a banded matrix with l sub diagonals and super diagonals with either the Crout or the Doolittle factorization. Simplify the subprogram for the cases of and a symmetric matrix.

To develop a subprogram for LU decomposition of a banded matrix with l sub-diagonals and super-diagonals, we can start by understanding the LU decomposition process and then adapt it for the specific case of a banded matrix.

1. LU Decomposition:
LU decomposition is a way to factorize a square matrix into the product of two triangular matrices, L and U, such that A = LU. L represents the lower triangular matrix, and U represents the upper triangular matrix.

The Crout and Doolittle factorizations are two popular methods for LU decomposition. Both methods have similar steps but differ in the way the diagonal elements of the L and U matrices are set.

2. Steps for LU Decomposition:
Here are the general steps for LU decomposition, which we will adapt for the banded matrix:

a. Initialize an n x n matrix A as the given input matrix.
b. Initialize an n x n matrix L as a lower triangular matrix with diagonal elements as 1 and other elements as 0.
c. Initialize an n x n matrix U as an upper triangular matrix with all elements as 0.
d. For each column k from 1 to n:
- Set the diagonal element U[k][k] as the k-th diagonal element of A.
- Update all elements in column k of U by solving the equations U[i][k] = A[i][k] - sum(L[i][j]*U[j][k] for j in range(k)).
- Update all elements in row k of L by solving the equations L[i][k] = (A[i][k] - sum(L[i][j]*U[j][k] for j in range(k))) / U[k][k].
e. The LU decomposition is complete when all the elements in L and U matrices are obtained.

3. Adaptation for Banded Matrix:
To adapt the LU decomposition for a banded matrix, follow these additional steps:

a. While performing the decomposition for column k (step 2d):
- Consider only the elements in the range max(1, k-l) to min(n, k+l) of both L and U matrices.
- Ignore or set elements outside this range as 0 since a banded matrix has non-zero elements only in a specific band around the diagonal.

4. Simplification for Symmetric Matrix:
For the special case of a symmetric matrix, you can simplify the LU decomposition process:

a. Use the Doolittle factorization since it is easier to implement.
b. In the decomposition (step 2d), only consider the lower triangular part (below or including the diagonal).
c. The upper triangular part is obtained by taking the transpose of the lower triangular part, as the matrix is symmetric.
d. Skip updating the upper triangular part in the U matrix.

Implementing the subprogram in a specific programming language will require further adaptations based on the language syntax and matrix representation.