Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 approximation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago

Question

What is job enlargement ?

Answered: 1 week ago

Question

what is the most common cause of preterm birth in twin pregnancies?

Answered: 1 week ago