Please help with the assignment: Develop an algorithm and compile a program for calculating the values of the sum S of a given series for different values of the argument X: in the internal loop for a fixed value of X, alternately sum up the terms of the series as long as their absolute value exceeds the specified accuracy eps. The calculation of the next member of the series is carried out using a recurrent formula. In the outer loop, argument X changes from 0.5 to 0.75 in increments of 0.05.
Row:
x*(3+x)/3! - x^3*(5+x)/5! + ... + (-1)^(n-1)*(x^(2n-1)*(2n+1+x))/((2n+1)!)
Where did she screw up?
float Summ(float x, float eps) { float elem,summ; int n=1; summ=elem=(x*(3+x))/6; while (x*(2*n+1+x)*(2*n+2)*(2*n+3)/(2*n+x)<eps) { elem*=-(x*(2*n+1+x)*(2*n+2)*(2*n+3))/(2*n+x); summ+=elem; n++; } return summ; }
n
? Why inelem*= -...
in the last bracketx
in the denominator? - andrybak