New math.h

First draft.
LOG templates