public static double LogSumExp(this double[] array) { double sum = Double.NegativeInfinity; for (int i = 0; i < array.Length; i++) { sum = Special.LogSum(array[i], sum); } return(sum); }
public static double LogSum(double[] values) { double logsum = Double.NegativeInfinity; for (int i = 0; i < values.Length; i++) { logsum = Special.LogSum(logsum, values[i]); } return(logsum); }