# Relative error

The relative error of an interval in an edo is the error in cents approximating a targeted interval divided by the size of an edostep, or equivalently stated, the error in relative cents. The formula for closest mapping of any JI interval is

$e(n, r) = (\text{round} (n \log_2 r) - n \log_2 r) \times 100\%$

where n is the edo number and r is the targeted frequency ratio.

The unit of relative error is relative cent or percent.

With closest mapping, the relative error ranges from -50% to +50%. With patent val mapping, it can be farther from zero. To obtain the relative error in patent val mapping, first find that of relevant prime harmonics, and then apply the additive rule (see below).

There are two additivities of relative errors.

First, for the same edo, a ratio which is the product of some other ratios have their relative errors additive, that is, if r3 = r1r2 for n, then e (n, r3) = e (n, r1) + e (n, r2).

If the error exceeds the range -50% to +50%, it indicates that an inconsistency occurs, and there is a discrepancy in patent val mapping and closest mapping, so is the error. The patent val mapping error is unchanged, and that of closest mapping is the previous result reduced by an integer to fit it into the range.

For example, the errors of 2/1, 3/1 and 5/1 in 19-edo are 0, -11.43% and -11.66%, respectively. Since 6/5 = (2/1)(3/1) / (5/1), its error is 0 + (-11.43%) - (-11.66%) = 0.23%. That shows 19-edo has fairly flat fifths and major thirds, yet they cancel out when it comes to minor thirds and results in a very accurate approximation.

Second, for the same ratio, an edo which is the sum of some other edos have their relative errors additive, that is, if n3 = n1 + n2 for r, then e (n3, r) = e (n1, r) + e (n2, r). This also needs to be reduced by an integer to fit into the range. In special, if an edo duplicates itself, and if the mappings do not change, then the error also duplicates.

For example, the errors of 3/1 for 26-edo and 27-edo are -20.90% and +20.60%, repectively, and their sum -0.30% is the error of 3/1 for 53-edo.