A software library is presented for the polynomial expansion method (PEM) of the density of states (DOS) introduced in [Y. Motome, N. Furukawa, J. Phys. Soc. Japan 68 (1999) 3853; N. Furukawa, Y. Motome, H. Nakata, Comput. Phys. Comm. 142 (2001) 410]. The library provides all necessary functions for the use of the PEM and its truncated version (TPEM) in a model independent way. The PEM/TPEM replaces the exact diagonalization of the one electron sector in models for fermions coupled to classical fields. The computational cost of the algorithm is O ( N ) —with N the number of lattice sites—for the TPEM [N. Furukawa, Y. Motome, J. Phys. Soc. Japan 73 (2004) 1482] which should be contrasted with the computational cost of the diagonalization technique that scales as O ( N 4 ) . The method is applied for the first time to a double exchange model with finite Hund coupling and also to diluted spin–fermion models. Program summary Title of library:TPEM Catalogue identifier: ADVK Program summary URL: http://cpc.cs.qub.ac.uk/summaries/ADVK Program obtainable from: CPC Program Library, Queen's University of Belfast, N. Ireland No. of lines in distributed program, including test data, etc.: 1707 No. of bytes in distributed program, including test data, etc.: 13 644 Distribution format:tar.gz Operating system:Linux, UNIX Number of files:4 plus 1 test program Programming language used:C Computer:PC Nature of the physical problem:The study of correlated electrons coupled to classical fields appears in the treatment of many materials of much current interest in condensed matter theory, e.g., manganites, diluted magnetic semiconductors and high temperature superconductors among others. Method of solution: Typically an exact diagonalization of the electronic sector is performed in this type of models for each configuration of classical fields, which are integrated using a classical Monte Carlo algorithm. A polynomial expansion of the density of states is able to replace the exact diagonalization, decreasing the computational complexity of the problem from O ( N 4 ) to O ( N ) and allowing for the study of larger lattices and more complex and realistic systems.