ENH: added rescale if the range is above 300

When the range is very large, this hugely increases memory and time
requirements of the implementation.