// safety checks
MathUtils.checkNotNull(lower);
MathUtils.checkNotNull(upper);
MathUtils.checkNotNull(scale);
if (lower.length != upper.length) {
throw new DimensionMismatchException(lower.length, upper.length);
}
if (lower.length != scale.length) {
throw new DimensionMismatchException(lower.length, scale.length);
}
for (int i = 0; i < lower.length; ++i) {
// note the following test is written in such a way it also fails for NaN
if (!(upper[i] >= lower[i])) {
throw new NumberIsTooSmallException(upper[i], lower[i], true);