use array for small n
separate fp_util.hpp from fp.hpp