public static Partition of(final Interval interval, final int parts) {
			if (!Double.isFinite(interval.min()) || !Double.isFinite(interval.max())) {
				throw new IllegalArgumentException(
					"Open ranges can't be split: %s.".formatted(interval)
				);
			}
			if (parts < 1) {
				throw new IllegalArgumentException(
					"Number of parts must at least one: %d."
						.formatted(parts)
				);
			}
			final long size = interval.elements();
			if (size < parts) {
				throw new IllegalArgumentException("""
					%s can hold only %d distinct double values. \
					"Can't split it into %d parts.
					""".formatted(interval, size, parts)
				);
			}

			if (parts == 1) {
				return new Partition(interval);
			}

			final var stride = (interval.max() - interval.min())/parts;
			assert stride > 0.0;

			final var separators = new double[parts - 1];
			separators[0] = interval.min() + stride;
			for (int i = 1; i < separators.length; ++i) {
				separators[i] = separators[i - 1] + stride;
			}

			return new Partition(interval, separators);
		}
Create a partition from the given {@code interval} by splitting it
into the given number of {@code parts}.

@param interval the interval to partition
@param parts the number of subintervals
@return a new partition
jenetics.incubator/src/main/java/io/jenetics/incubator/stat/Histogram.java