public static double[] normalize(final double[] values) {
		final double sum = 1.0/DoubleAdder.sum(values);
		for (int i = values.length; --i >= 0;) {
			values[i] = values[i]*sum;
		}

		return values;
	}
Normalize the given double array, so that it sums to one. The
normalization is performed in place and the same {@code values} are
returned.

@param values the values to normalize.
@return the {@code values} array.
@throws NullPointerException if the given double array is {@code null}.
jenetics/src/main/java/io/jenetics/internal/math/Basics.java