Module:Harmonic entropy: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
No edit summary
Line 15: Line 15:
ratios = ratios
ratios = ratios
or limits.integer_limit(200, function(ratio)
or limits.integer_limit(200, function(ratio)
if math.abs(ratio[1] * 2^(c / 1200)) > 3 * deviation then
if math.abs(rat.abs(ratio) * 2^(c / 1200)) > 3 * deviation then
return 1 / 0
return 1 / 0
end
end
Line 26: Line 26:


local function weighted_gaussian(ratio)
local function weighted_gaussian(ratio)
return gaussian(ratio[1] * 2^(c / 1200)) / norm(ratio)
return gaussian(rat.abs(ratio) * 2^(c / 1200)) / norm(ratio)
end
end