Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program 3.3 Building a sin calculator key, attempt #1 %Approximates sin curve with degree 3 polynomial (Caution: do not use to build bridges at least
Program 3.3 Building a sin calculator key, attempt #1 %Approximates sin curve with degree 3 polynomial (Caution: do not use to build bridges at least until we have discussed accuracy.) Input : Output: approximation for sin (x) function y=sin1 (x) %First calculate the interpolating polynomial and store coefficients b-pi* (0:3)/6.yb sin(b); b holds base points c-newtdd (b,yb, 4) %For each input x, move x to the fundamental domain and evaluate the interpolating polynomial &Correct the sign of sin x1-mod (x,2*pi) if xl>p.i x12 pi-xl end if xl > pi/2 xl -pi-xl; end ys*nest (3,c, xl,b) Program 3.3 Building a sin calculator key, attempt #1 %Approximates sin curve with degree 3 polynomial (Caution: do not use to build bridges at least until we have discussed accuracy.) Input : Output: approximation for sin (x) function y=sin1 (x) %First calculate the interpolating polynomial and store coefficients b-pi* (0:3)/6.yb sin(b); b holds base points c-newtdd (b,yb, 4) %For each input x, move x to the fundamental domain and evaluate the interpolating polynomial &Correct the sign of sin x1-mod (x,2*pi) if xl>p.i x12 pi-xl end if xl > pi/2 xl -pi-xl; end ys*nest (3,c, xl,b)
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