Print errors to stderr instead of stdout
Add math functions