Page 1 of 1

7. In your Calculus course, you will see that an approximate formula for √1+r is: 5 4 √1+x=1+ 1 #include #incl

Posted: Mon Jul 11, 2022 9:57 am
by answerhappygod
7 In Your Calculus Course You Will See That An Approximate Formula For 1 R Is 5 4 1 X 1 1 Include Stdio H Incl 1
7 In Your Calculus Course You Will See That An Approximate Formula For 1 R Is 5 4 1 X 1 1 Include Stdio H Incl 1 (38.65 KiB) Viewed 26 times
USING C LANGUAGE ONLY!
7. In your Calculus course, you will see that an approximate formula for √1+r is: 5 4 √1+x=1+ 1 #include <stdio.h> #include <math.h> - Your program input/output should look like: Enter x 0.5 x=0.500000 approximate value = 1.224121 actual value = 1.224745 percent relative error = 0.050935% int main(void) { This formula will give a reasonable approximation provided | < 1. The approximiation improves as r gets smaller. 1 Write a program, approx.c to test the accuracy of this formula for various values of r. In your program make sure that you write the fractions as, for example, 5.0/128.0 rather than 5/128. Your program should compute the percent relative error: /* you fill in here / return 0; relative error in % = approximate value - actual value actual value + 16 128 For marking purposes, run your program for z = 0.5 and also for x = 0.99. /* File approx.c Approximate the function sqrt(1+x) Programmer: Date: x 100