Implements selection of math method using appropriate type parameters.
Cleans up unit tests.