Similar Items: Automatic Modular Abstractions for Template Numerical Constraints