Double Precision Math port

Needs to be tested with double examples.