caching sin/cos