fix parser bug; use double-precision floats; add some math fns