Function findRoots

Uses bracketRoots() to divide the interval [a,b] into subintervals and check which ones bracket roots. Then, findRoot() is applied to each bracketing interval, and an array containing the roots is returned.

T[] findRoots(T, Func) (
  scope Func f,
  T a,
  T b,
  uint nIntervals,
  T[] buffer = null
);

A buffer of length at least nIntervals+1, for storing the roots, may optionally be provided.