Question: Start with the Cody template (reproduced below) Tip for using Cody: Be sure to test negative input and zero input in your MATLAB before submitting

 Start with the Cody template (reproduced below) Tip for using Cody:

Start with the Cody template (reproduced below) Tip for using Cody: Be sure to test negative input and zero input in your MATLAB before submitting on Cody function [x, ea] = mySqrt (a, es) %calculates squareroot by divide and average (chapra 3.13 & chapra 4.1) % %[x, ea] = mySqrt (a, es) %INPUT a: a scalar real number % es: error stopping criterion, % %OUTPUT x: squareroot of a % ea: the final error, % x = a: %replace this line with your code to solve for the squareroot of x end Compute the absolute error E_t and the relative error e_t for each the following pairs. Use your calculator for "true". true = pi, approximation = 3.14 true = sin(pi/4), approximation = pi/4 true = squareroot 17 approximation = 4.123 Instead of estimating sin(pi/4), use the Maclaurin series expansion of sin(x), shown below, to estimate sin(3 pi/16) accurate to at least 5 sig figs. Use your calculator and not MATLAB. Show the results in a table like the one in Example 4.1 in your book. sin x = sigma^infinity _n=0 (-1)^n/(2n + 1)! x^2n+1 = x - x^3/3! + x^5/5! - middot middot middot for all x

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!