Question: Exponential Function The exponential function may be approximated by Taylor polynomials: e^x P_N (x) = sigma^N _n = 0 x^n!. The sum may be computed

Exponential Function The exponential function may be approximated by Taylor polynomials: e^xExponential Function

The exponential function may be approximated by Taylor polynomials: e^x P_N (x) = sigma^N _n = 0 x^n!. The sum may be computed directly term by term using input: x s=1.0 t=x for n=1 to N { s=s + t t=t*x } return s Or using the identity, P_N (x) = 1 + x (1 + x/2 (1 + x/3 (1 + middot middot middot x/N - 1 (1 + x/N) middot middot middot))): input: x s=1.0 for n=N to 1 { s=s*x + 1 } return s Use these algorithms to compute e^50 and e^-50. Assume that the built-in function in your environment (likely called "exp()") provides the exact value and plot the the error of your numerical approximations, i.e., |P_N(50) - e^plusminus 50|, as the function of N. Values of N 200 are probably as far as you need to go. (You should use the logarithmic plot to be able to display the entire range of error values in one figure, i.e., plot the logarithm of the error rather than the error itself.) If your environment uses very high precision arithmetic, you may not notice any significant difference between the algorithms, the error should become more noticeable if you use just single precision (32 bit) arithmetic. Discuss your findings

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!