Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python Exponential function. The exponential function may be approximated by Taylor polynomials e^x almostequalto P_N(x) = sigma^N_n = 0 x^n!. The sum may be

In Python image text in transcribed

Exponential function. The exponential function may be approximated by Taylor polynomials e^x almostequalto P_N(x) = sigma^N_n = 0 x^n!. The sum may be computed directly term by term using Algorithm I 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(x/2(1 + x/2(1 + x/3(1 + x/N - 1(1 + x/N)...))): Algorithm II 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 error of your numerical approximations, i.e., |P_N(50) - e^plusminus 50|, as the function of N. Values of N almostequalto 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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago