%COS_DEMO
% Script to demonstrate the difficulty in evaluating (1-cos(x))/sin(x).^2

E1 = @(x) (1-cos(x))./sin(x).^2;
E2 = @(x) 1./(1+cos(x));

for k = 0:-1:-16
    x = 10^k;
    fprintf('%16.16f \t %16.16f \t %16.16f \n', x, E1(x), E2(x))
end

