Question: 33. Implement exp The function exp in module func has two values: x and the acceptable error err. The latter is used to guarantee so
33. Implement exp The function exp in module func has two values: x and the acceptable error err. The latter is used to guarantee so many decimal places of precision. The Taylor Series of exp(x) gives us a bound on how bad the error can be at any time: no worse than the absolute value of the next term. This suggests a strategy for approximating exp(x): Loop through the terms of the Taylor Series expansion At each step, look at the absolute value of the term a. If it less than the acceptable error, stop b. Otherwise add the term to the accumulator and continue Use this strategy to implement the function exp. Check your answer with the test script. If your implementation is correct, you should pass all tests
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
