13const double EPS = 1e-6;
15double f(
const double x)
17 return sin(x) - 0.5 * x ;
20double Bisect2(
const double a,
const double b);
27 cout <<
" Determine point of zero in [a,b] by bisection" << endl;
29 cout <<
" f(a) > 0, a : ";
31 cout <<
" f(b) < 0, b : ";
37 cout <<
" point of zero = " << x0 << endl;
49 double x0, fc, c = (
a +
b) / 2;
52 if ( std::abs(fc) <
EPS ) {
55 else if ( fc > 0.0 ) {
double Bisect2(const double a, const double b)
clf define function syms x f