132static void test(std::int32_t N,
double h,
double a,
double b,
133 bool used_argv_parameters) {
135 double result_f = numerical_methods::simpson_method::evaluate_by_simpson(
136 N,
h, a, numerical_methods::simpson_method::f);
137 assert((used_argv_parameters || (result_f >= 4.09 && result_f <= 4.10)) &&
138 "The result of f(x) is wrong");
139 std::cout <<
"The result of integral f(x) on interval [" << a <<
", " << b
140 <<
"] is equal to: " << result_f << std::endl;
142 double result_g = numerical_methods::simpson_method::evaluate_by_simpson(
143 N,
h, a, numerical_methods::simpson_method::g);
144 assert((used_argv_parameters || (result_g >= 0.27 && result_g <= 0.28)) &&
145 "The result of g(x) is wrong");
146 std::cout <<
"The result of integral g(x) on interval [" << a <<
", " << b
147 <<
"] is equal to: " << result_g << std::endl;
149 double result_k = numerical_methods::simpson_method::evaluate_by_simpson(
150 N,
h, a, numerical_methods::simpson_method::k);
151 assert((used_argv_parameters || (result_k >= 9.06 && result_k <= 9.07)) &&
152 "The result of k(x) is wrong");
153 std::cout <<
"The result of integral k(x) on interval [" << a <<
", " << b
154 <<
"] is equal to: " << result_k << std::endl;
156 double result_l = numerical_methods::simpson_method::evaluate_by_simpson(
157 N,
h, a, numerical_methods::simpson_method::l);
158 assert((used_argv_parameters || (result_l >= 7.16 && result_l <= 7.17)) &&
159 "The result of l(x) is wrong");
160 std::cout <<
"The result of integral l(x) on interval [" << a <<
", " << b
161 <<
"] is equal to: " << result_l << std::endl;