Beruflich Dokumente
Kultur Dokumente
The order of truncation for any Taylor Expansion is O(x^(n+1)). Which means for Cos(x) that would
be 4th Order and for Sin(x) that would be 5th Order.
Taylor series approximation for sin(x) gets more inaccurate as x moves further from 0, hence we
can use the fact that:
b)
Division by a really small number (large numerator and small denominator) in g2 results
in rounding errors.
c)
function y = c3()
a = 2;
h = logspace(-20,1,10000);
b = a- 2.*h;
c = a - h;
d = a + h;
e = a + 2.*h;
f =(b.*exp(-b)-8*c.*exp(-c)+8*d.*exp(-d)-e.*exp(-e))./(12.*h);
dy = exp(-a) - a*exp(-a);
error = dy - f;
loglog(h,error);