Fixing problem caused by overflow in expanded ensemble.

Basic problem: logic was failing for single precision because of round off errors.
Solution: convert some of the intermediate arrays into double.

Fixes redmine #1314

Change-Id: Id7e3771d257bbeebeed2f340593b817015a0cd4c