Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pl. Let us remember that the exponential function can be written by the series i! i=0 In the present problem we will approach the concept
Pl. Let us remember that the exponential function can be written by the series i! i=0 In the present problem we will approach the concept of cancellation using as a case study the function ex. a. Write a python program that calculates the exponential function using the series given above. b. Assuming it is added in the order given, what stopping criterion should be used? c. Test your program for the numbers: x = 1,5,10,15,20 and also for x=-1, -5, -10, -15, -20. and compare your results for the python function numpy.exp (x). d. As you have just seen in the previous point, the written function can have undesirable effects when work with negative numbers. Use the relation e- x= 1/ex and compare the results. I What happens to the reliability of the function implemented in part a) when the terms of the sum are regrouped into even and odd numbers? Implement this new version of your program and Compare the results for the case of negative numbers
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started