An Algorithm for Parallel Calculation of Trigonometric and Exponential Functions