I know how to make a simple program for calculating the arithmetic mean, but how to make this incomprehensible
Use a 32-bit floating-point type (
float,single) to find the arithmetic average ofF(8+30)10,000 values.F(x)=sin(x)cos(x)To calculate, create a program in an arbitrary (any) programming language and perform the calculations:
- a) Add in a cycle 10,000 times the values of
F(8+1), divide the result by the number of terms 10,000, write the result.- b) Add 10,000 times the
F(8+1)/10000times in a loop, write the result.- c) Knowing the exact result of the arithmetic mean (the same numbers are added 10,000 times, and the result is divided by 10,000, therefore the result should be equal to the value of
F(N+1)), find the relative and absolute error of the calculations