Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The function sin(x) can be approximated by summing the first n terms of the infinite series sin(x)=x-x/3! + x/5! - x/7! + ...
1. The function sin(x) can be approximated by summing the first n terms of the infinite series sin(x)=x-x/3! + x/5! - x/7! + ... where x is expressed in radians (Note: radians = 180). Write a C program that can be used to answer the following questions during the lab: a) For a value of x = 0.1, how many terms do you need in the power series so that the result from the series equals the result from the sin(x) library function up to the 6 decimal place. b) For a value of x = 1.3, how many terms do you need for achieving the same accuracy as in (a)? Assume that there exists a function double fact(int n) that returns the factorial value of an integer as a double. This function will be given to you. There is a standard C function double pow(double x, double y) that returns the result of x to the power y as a double type. You will need to include math.h to use this function (#include ).
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