fprintf('    x   asin     chyba\n');
fprintf('----------------------\n');
for x = -0.9:0.2:0.9;
tol = 1e-16;

s = x;     % soucet n clenu
n = 1;     % index clenu 1, 2, 3, ...
m = 1;     % mocnina x^m, 3, 5, 7, ....
z = x;     % hodnota n-teho clenu
q = x*x;

while abs(z) > tol
    z = z * m;    % v citateli 1, 3, 5, ...
    m = m + 2;
    z = z * q;    % mocniny x3, x5, x7, ....
    z = z / 2;    % mocniny 2, 2^2, 2^3, ....
    z = z / n;    % ve jmenovateli n!
    n = n + 1;
    s = s + z/m;  % ve jmenovateli 3, 5, 7, ...
end;

fprintf('%6.1f %6.3f %8.2g\n', x, s, s-asin(x))
end