diff --git a/computer_oriented_statistical_methods/successive_approximation.cpp b/computer_oriented_statistical_methods/successive_approximation.cpp index efbcc3bbf..338831464 100644 --- a/computer_oriented_statistical_methods/successive_approximation.cpp +++ b/computer_oriented_statistical_methods/successive_approximation.cpp @@ -1,9 +1,22 @@ +/** + * \file + * \brief Method of successive approximations using [fixed-point + * iteration](https://en.wikipedia.org/wiki/Fixed-point_iteration) method + */ #include #include +/** equation 1 + * \f[f(y) = 3y - \cos y -2\f] + */ static float eq(float y) { return ((3 * y) - (cos(y)) - 2); } + +/** equation 2 + * \f[f(y) = \frac{\cos y}{2} +2\f] + */ static float eqd(float y) { return ((0.5) * ((cos(y)) + 2)); } +/** Main function */ int main() { float y, x1, x2, x3, sum, s, a, f1, f2, gd; int i, n;