Toying with extreme values

Complete refactoring of the unit tests to enable sophisticated testing
of results with NaN and infinities.