Move some math calculations to Obj-C (really C macros) and force primiti...

...ve types for constants.
just add this when you are profiling