CM: add some simple math functions for testing