Compute the sum of binary logarithms of the input range r. The error of this method is much smaller than with a naive sum of log.
import mir.math: LN2, approxEqual; assert([ 0.25, 0.25, 0.25, 0.125 ].sumOfLogs.approxEqual(-9 * double(LN2)));
See Implementation
Compute the sum of binary logarithms of the input range r. The error of this method is much smaller than with a naive sum of log.