% bisectionFtest.m
clear all; format short e;
fcn = @(x) x.*x-4*sin(x);  % define function as an anonymous function
%fcn = inline('x.*(x.*x-2)-5');
a = 1; b = 3; 
% In class, the version of script file that I ran had a = 2.
% The given functiion does not change sign within that interval!
% The root is located at 1.933...
% That was the problem. The bisection function works.
tol = 1e-6; %disp(log2((b-a)/tol));

result = bisectionF(fcn,a,b,tol);
disp(result);
