Optimisation of automatic constant generation for ACE