Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedExponential 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions