Module:Interval table: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
This is the final adjustment I will make hopefully.
Line 134: Line 134:
wikitext = wikitext .. '|'
wikitext = wikitext .. '|'
for j=1,#ratios_list do
for j=1,#ratios_list do
-- Go through all ratios, if they are mapped to the current step in the ET's patent val with <1/3 relative error, add to approximate ratios column
-- Go through all ratios, if they are mapped to the current step in the ET's patent val with <40% relative error, add to approximate ratios column
t = mapping(u.get_monzo(ratios_list[j][1], ratios_list[j][2]), patent_val)
t = mapping(u.get_monzo(ratios_list[j][1], ratios_list[j][2]), patent_val)
relative_error = math.abs(t - math.log(ratios_list[j][1]/ratios_list[j][2])/math.log(et.equave^(1/et.size)))
relative_error = math.abs(t - math.log(ratios_list[j][1]/ratios_list[j][2])/math.log(et.equave^(1/et.size)))
if t == i and relative_error < 1/2 then
if t == i and relative_error < 0.4 then
wikitext = wikitext .. '[[' .. ratios_list[j][1] .. '/' .. ratios_list[j][2] .. ']], '
wikitext = wikitext .. '[[' .. ratios_list[j][1] .. '/' .. ratios_list[j][2] .. ']], '
end
end