Eos routines for tables and polytropes