Add a few mathematical routines