Question: I know that is truncation error but I do not know the b) question, how to improve it. please tell me. function [sum, error]-mysin(x, N)

 I know that is truncation error but I do not knowthe b) question, how to improve it. please tell me. function [sum,error]-mysin(x, N) sun-1:%initialize the value sum % % % for 1-1: N%create for loop to do the hyperbolic sin sur sum+ (-1)^ (i)t(x^

I know that is truncation error but I do not know the b) question, how to improve it. please tell me.

function [sum, error]-mysin(x, N) sun-1:%initialize the value sum % % % for 1-1: N %create for loop to do the hyperbolic sin sur sum+ (-1)^ (i)t(x^ (2#1+1) ) /factorial (2*i+1); end error (sin(x)-sun) /sin(x) ;%culculate the relative error end I-[10 18 251: % give all value x=17; format long % to do the format long for 1-1: length (N) % to do the for loop calculate the sun and error when N is 10 18 25 10 12 13- 14 - sun, error-mys in (x,NG));% use the sin function sprintf ('For N=%d the true value is %d and the true relative error is %d,,n(1), sum, error) end Problem 4 (5 points) (Core Course Outcome 2) a) Is the dominant (largest) error when evaluating sin(17) using your function for N 10 due to round-off error or truncation error? b) How can the result for sin (17) be improved without increasing N or changing the approximation formula? Hint: examine the plot of problem 3 for N-10 and make use of a basic property of the sine function concerning the argument r that will not change the exact answer. Problem 4 required suomzsston: Handwritten (OT pTnted) answeTs OS) 2n+1 sin(x) 2(-1)n (2n + 1)! = x-3! + 5! , 2n+1 sin(x) (-1)" (2n + 1)! n-0

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!