Calculate the functions
f(x) = (1 – x)8
g(x) = 1 – 8x + 28×2 -56×3+ 70×4 – 56×5 +28×6 – 8×7 + x8
for -0.01 ≤ x ≤ 0.01 in steps of 0.001.
Calculate all powers using a loop:
t = x // t will be x^n
for i = 2 to n do t = t * x
Print out a table of values, with 4 columns: x, f(x), g(x), andf(x) – g(x). Do this twice, once with floats and once with doubles.Note that f(x) and g(x) are mathematically equivalent, but maydiffer numerically, due to round-off error.
Expert Answer
An answer will be send to
PayPal Gateway not configured
PayPal Gateway not configured