Good day. Help is needed. Given the task:

Create a program in C ++ to calculate the value and error of the function for given values ​​of the arguments in a differential way. Implement software rounding results up to correct numbers.

Z= (a+b)/(b^2-3c) a=3,45 b=5.781 c=4.1 

Added.

The program is almost written, only the error string itself is needed ...

 // функция double function(double a, double b, double c) { return (a+b)/(pow(b,2)-3c); } // погрешность double dFunction(double a, double b, double c, double da, double db, double dc) { return *********** // - ЭТА СТРОКА, вместо звёзд. } 

    1 answer 1

    Chesslovo - I do not know. I suppose that one can go from simple relations d (a + b) = da + db d (a * b) / a * b = d (a) / a + d (b) / b, etc. (peeped in physics textbook for class)

    On the other hand, being quite sensible and logical, these formulas do not at all reflect the fact that the error is a probabilistic value. And then the calculations are complicated.

    Considering that the word “differential” is used in the method proposed to you, it is possible that here we must somehow calculate the derivative of the function.

    In any case, as soon as you get the formula for the error, it will not be the biggest problem to enter it into the program. So the task is not to programming as such, but rather to the assimilation of educational material.

    • one
      As far as I remember the course of mathematics, the derivative is the tangent of the angle between the graph of the function and the abscissa. From here, you can apply the differential method, but only for a linear function, where the derivative is constant. - 3JIoi_Hy6