% script sin2.m % Loss of significance example x - sin(x) % Evaluation of x - sin(x) to lose one binary digit % using loss of significance theorem % We can use the loss of significance theorem to % determine an x such that we lose at most 1 % significant binary digit. We must find an x such that % the function 1 - sin(x)/x -1/2 is positive. % Graph the function to do this y = @(x) 1 - sin(x)/x - 1/2; fplot(y, [1.8, 2.0]) grid on; % The graph shows that x = 1.9 is a suitable value % we need to evaluate Taylor series for x - sin(x) % to order 21 to get required accuracy since % 1.9^23/23! (first term omitted) is about 0.997E-16