General math functions for Haskell