dimod -> modf; 3x speedup
reached limit of obvious optimisations, retest