Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use C coding only! 2 Approximating tan(x) Given an angle in degrees, we can approximate the tan function as follows (2)4 180(2)3 + 32400(2) 2
use C coding only!
2 Approximating tan(x) Given an angle in degrees, we can approximate the tan function as follows (2)4 180(2)3 + 32400(2) 2 - 58320002 tan (x) (2)4 - 180(20)3 + 32400(2)2 + 1458000.x 328050000 Write a C function that implements the above equation. Use the following function prototype: double tan_approx (double x_deg); The above approximation is only valid for a certain range of c. We wish to determine the range of values of z where the approximation is valid. Compare the output of the above function to the output of the function given below //You must include math.h for this function to work double tand (double x_deg) { double pi, y; pi = Pi_value (10); y = tan (x_deg * pi / 180.); return(y); Note: Your program should call the function Pi.value from problem 1 for the calculation of T. Your main code should use the following steps Loop across values of x from -45 to 100 in steps of 1 degree Calculate Y1 = tan approx(x); Calculate Y2 = tand(x); Calculate the error between the two. err = |Y1-Y2|| If err is small (say less than 0.0022) then approximation of tan is valid Report the range of x such that the approximation is a valid approximationStep 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