Function bracketRoots

Divides the interval [a,b] into the given number of equal-sized subintervals, checks whether any of the subintervals bracket a root, and returns the ones that do, together with the function values at those points.

RootBracket!(T,ReturnType!Func)[] bracketRoots(T, Func) (
  scope Func f,
  T a,
  T b,
  uint nIntervals,
  RootBracket!(T,ReturnType!Func)[] buffer = null
);

A buffer of length at least nIntervals+1, for storing the brackets, may optionally be provided. If not, one will be allocated.