In matrix notation the equation Ax = b may generally be solved for vector x given matrix A and vector b. A is a square matrix and here a real tridiagonal matrix. A matrix A is tridiagonal just if |i−j|>1 → Aij = 0. In our Scheme code we represent a tridiagonal matrix by giving as lists the sub-diagonal, the diagonal and the super-diagonal. The sub-diagonal is thus given as (A1, 0, A2, 1, ... An−2, n−1). The diagonal is one longer than the other two. The routine ml computes b given A and x. The routine solve computes x given A and b. The routine pf takes a matrix, (aa, ab, ac), a vector, x and computes a vector b such that the solution to Ax = b is that x.

The recursive C code follows closely.