docs: public static double angleDense(NumberVector v1, NumberVector v2) {
      final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();
      final int mindim = (dim1 <= dim2) ? dim1 : dim2;
      // Essentially, we want to compute this:
      // v1.transposeTimes(v2) / (v1.euclideanLength() * v2.euclideanLength());
      // We can just compute all three in parallel.
      double cross = 0, l1 = 0, l2 = 0;
      for(int k = 0; k < mindim; k++) {
        final double r1 = v1.doubleValue(k);
        final double r2 = v2.doubleValue(k);
        cross += r1 * r2;
        l1 += r1 * r1;
        l2 += r2 * r2;
      }
      for(int k = mindim; k < dim1; k++) {
        final double r1 = v1.doubleValue(k);
        l1 += r1 * r1;
      }
      for(int k = mindim; k < dim2; k++) {
        final double r2 = v2.doubleValue(k);
        l2 += r2 * r2;
      }
      final double a = (cross == 0.) ? 0. : //
          (l1 == 0. || l2 == 0.) ? 1. : //
              FastMath.sqrt((cross / l1) * (cross / l2));
      return (a < 1.) ? a : 1.;
    }