Reduce number precision when using cos and sin
Sync with trunk svn
Fix precision