An Equation of State for Low-Mass Stars and Giant Planets