Skip to content

Commit

Permalink
Update compositemidpoint.m
Browse files Browse the repository at this point in the history
  • Loading branch information
kwyip authored Jul 3, 2017
1 parent 6cc68d1 commit 8d34e0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compositemidpoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
m = a + 0.5*h;
for i = 1:n
midpoint = midpoint + h*f(m);
m = m + h;
m = a + 0.5*h + i*h; %to avoid accumulation of roundoff error
end

0 comments on commit 8d34e0b

Please sign in to comment.