I must be missing something: the following program doesn't seem to find the right minimum (boost 1.47.0).

double f(double x) { return x * cos(x); }

int main(int argc, char** argv)
{
  cout << brent_find_minima(f, 3.0, 4.0, 1e-8) << endl;
  return 0;
}

I get: 4 -2.61457

But I think the minimum is -3.28837 at x = 3.42562.

Did I miss something in calling brent_find_minima??

Also, this function should be called "brent_find_minimum" since it finds a single minimum, IMHO. The singular is minimum in Latin, minima is the plural. Or can the function be called repetitively and each time return a different minimum??

Frank
fastier@yahoo.com