Simplified the calculus of the sine wave
Optimized calculus and fixed  missing parenthesis range correction