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 Using Taylor series to approximate the exponential function, we could define the following function:
def exptaylor x n:
expapprox
for in range:
expapprox i factoriali
return expapprox
which computes the value of terms of the sum in equation from the tutorial notes. How many terms are needed before this function offers no further increase in accuracy in the evaluation of exp
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
