Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Post in C language. pi = sqrt(12) * (1 (1/(3 3^1)) + (1/(5 3^2)) - (1/(7 3^3)) + (1/9 3^4)) ) 16.28 Lab 4, P3(T):
Post in C language. pi = sqrt(12) * (1 (1/(3 3^1)) + (1/(5 3^2)) - (1/(7 3^3)) + (1/9 3^4)) )
16.28 Lab 4, P3(T): Pi approximation This lab will be available until February 11th, 2:00 PM MST The value of n can be approximated using the Madhava formula pi = sqrt (1 -(1/(3-3-1)) + (1/(5 - 3^2)) - (1/(7.343)) + (1/9. 3^4))...) Write a C program that calculates the value of pi with a variable level of accuracy. For instance, if the desired accuracy is 10^-6, the absolute difference between the true value of n (see below) and the approximation from your function is less than 10^-6 Develop a function called pivalue that receive as input the numerical accuracy (in number of digits) and returns the calculated pi value. double pivalue (int numAccuracy); Sample Output: To what precision do you wish to calculate Pi? 4 pi = 3.14167431, within accuracy of 1E-4. Error = 0.00008166 301608.1764500 LAB ACTIVITY 16.28.1: Lab 4, P3(T): Pi approximation 0/4 main.c Load default template... 1 #includeStep 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