Formatting thing: to match the code style in the rest of the project for long method signatures, please do

    def loop(
        low: Double,
        high: Double,
        acc: List[(Double, Double, DoubleMatrix)])
      : List[(Double, Double, DoubleMatrix)] =
    {
      ...
    }

Or if it fits in 100 chars it would also be OK to do:

    def loop(low: Double, high: Double, acc: List[(Double, Double, DoubleMatrix)])
      : List[(Double, Double, DoubleMatrix)] =
    {
      ...
    }