Optimized fork of parcycle using approximations to trig functions and inlining of some static function calls.