compress arithmetic expressions further (#3529)

This commit is contained in:
Alex Lam S.L
2019-10-27 03:07:07 +08:00
committed by GitHub
parent 85237b08d4
commit 50a578c1f6
3 changed files with 433 additions and 76 deletions

View File

@@ -96,7 +96,7 @@ asm_mixed: {
return +sum;
}
function geometricMean(start, end) {
return start |= 0, end |= 0, +exp(+logSum(start, end) / +(end - start | 0));
return start |= 0, end |= 0, +exp(logSum(start, end) / (end - start | 0));
}
var exp = stdlib.Math.exp, log = stdlib.Math.log, values = new stdlib.Float64Array(buffer);
return { geometricMean: geometricMean };