Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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-0Step 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