- {
- Real uniformity = fabs (ret.force_[i] - ret.force_[i-1]);
- ret.demerits_ += (ret.force_[i] * ret.force_[i]
- + uniformity * uniformity) * page_weighting;
- }
+ ret.demerits_ += ret.force_[i] * ret.force_[i] * page_weighting;
+
+ /* for a while we tried averaging page and line forces instead of summing
+ them, but it caused the following problem. If there is a single page
+ with a very bad page force (for example because of a forced page break),
+ the page breaker will put in a _lot_ of pages so that the bad force
+ becomes averaged out over many pages. */