Question: The math module includes a function exp which computes the exponential of a floating point number. Import this function, and note how many decimal places

The math module includes a function exp which computes the exponential of a floating point number. Import this function, and note how many decimal places are given in the evaluation of exp(1). Using Taylor series to approximate the exponential function, we could define the following function:
def exp_taylor (x, n):
exp_approx =0
for i in range(n):
exp_approx +=x**** i / factorial(i)
return exp_approx
which computes the value of n terms of the sum in equation (1.1) from the tutorial notes. How many terms are needed before this function offers no further increase in accuracy in the evaluation of exp(1)?
 The math module includes a function exp which computes the exponential

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!