Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double n = 1;
- double h = (b - a) / n;
- double ih = 1;
- double previous = 0;
- while (Math.Abs(ih - previous) >= 3 * epsilon) {
- previous = ih;
- double sum = 0;
- for (int i = 1; i < n; ++i) {
- sum += 2 * Function1(i * h + a);
- }
- ih = (sum + Function1(a) + Function1(b)) * h / 2;
- n *= 2;
- h /= 2;
- }
- return ih;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement