Skip to content

Commit

Permalink
Changing back to a tolerance of 1e-14 in bisection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajt60gaibb committed Jul 2, 2013
1 parent e68ed14 commit e482658
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions sample.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@

% bisection method
a = -ones(N,1); b = ones(N,1);
% while norm(b-a,inf) > eps
for iter = 1:(-log2(eps)+1)
while norm(b-a,inf) > 1e-14
vals = Clenshaw_evaluate(c,(a+b)/2);
I1 = ((vals-r)<=-1e-14); I2 = ((vals-r)>=1e-14); I3 = ~I1 & ~I2;
a = I1.*(a+b)/2 + I2.*a + I3.*(a+b)/2;
Expand Down
4 changes: 3 additions & 1 deletion test.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@
contour(g,.01:.1:max2(g)), hold on,
plot(X,Y,'.','markersize',6),
axis([dom1 dom2])
pause(.3)
else
X = sample(f,dom1,100);
g = chebfun(f,dom1);
plot(g), hold on, plot(X,0*X,'.')
xlim([dom1])
pause(1)
end
pause(.3), hold off
hold off
end

0 comments on commit e482658

Please sign in to comment.