More efficient aggregations on long and double terms (similarly to the latest changes on string terms).