Taylor Series Approximation for Sine Function

In class, we went through the derivation of a procedure for estimating the value of sin(x) using a truncated Taylor's series. This led to the development of a program, in MATLAB, to evaluate this series. You can find the program here. (you can probably copy this to your own disk by clicking on that link while holding down the SHIFT key...)

Try to run that program now. Try different values for X and see what happens. In particular, try large values of X. Can you explain the behaviour?

There are two ways of fixing the program. Find at least one way to ensure that the program works for all values of X, regardless of size.