Optimal amplitude of an $m$-bit sinusoid
The phase of the sinusoid does not matter: A phase shift of a sinusoid is equivalent to shifting it in time, which results in a time shift of both the quantized sinusoid and the quantization error. The power spectrum is invariant to time shifts. We choose to work with sinusoid $A\cos(x)$. 

Optimality by def. 1

Equivalently to maximizing signal-to-noise ratio (SNR), we can minimize the root mean square quantization error relative to the root mean square $\sqrt{1/2}A$ of the sinusoid, $\mathrm{RRMSE}$ $=$ $\sqrt{1/\mathrm{SNR}}$. It is enough to do the analysis in the first quarter-period of the cosine wave, because the rest of both the cosine wave and the quantization error are identical to their first quarter-period up to a sign flip and/or time reversal. Let $x$ be in the first quarter of the cosine wave, $0 &lt; x &lt; \pi/2$. Along the lines of Eq. 2 of my answer to a related question, the quantized cosine wave attains an integer value $k \in 0\ldots\mathrm{round}(A)$ when:

$$\begin{align}0 &lt; x &lt; \mathrm{acos}\left(\frac{\mathrm{round}(A) - 0.5}{A}\right),\quad &amp;\text{if }k = \mathrm{round}(A),\\
\mathrm{acos}\left(\frac{k + 0.5}{A}\right) &lt; x &lt; \mathrm{acos}\left(\frac{k - 0.5}{A}\right),\quad &amp;\text{if }1 \le k \le \mathrm{round}(A) - 1,\\
\mathrm{acos}\left(\frac{0.5}{A}\right) &lt; x &lt;\frac{\pi}{2},\quad &amp;\text{if }k = 0.\end{align}\tag{1}$$

Each value of $k$ gives to the relative mean square error $\mathrm{RelMSE}$ an additive contribution of:

$$\frac{2\,\mathrm{MSE}_k}{A^2} = \frac{2}{A^2}\frac{1}{\pi/2}\int_{x_0}^{x_1}\big(A\cos(x)-k\big)^2dx = \frac{2\sin(x_1)\cos(x_1) - 2\sin(x_0)\cos(x_0)}{\pi} + \frac{8k\big(\sin(x_0) - \sin(x_1)\big)}{\pi A} + \frac{4k^2(x_1 - x_0)}{\pi A^2} + \frac{2x_1 - 2x_0}{\pi},\tag{2}$$

where $x_0$ and $x_1$ denote, as defined separately for each $k$, the bounds $x_0 &lt; x &lt; x_1$ given by Eq. 1. The total relative mean square quantization error is then:

$$\begin{gather}\mathrm{RelMSE} = \frac{2\,\mathrm{MSE}}{A^2} = \sum_{k=0}^{\mathrm{round}(A)}\frac{2\,\mathrm{MSE}_k}{A^2}\\
= \frac{2\,\mathrm{asin}\left(\frac{1}{2A}\right)}{\pi} - \frac{\sqrt{4A^2 - 1}}{2\pi A^2} - \frac{(2A^2 + 4\,\mathrm{round}(A)^2)\,\mathrm{asin}\left(\frac{2\,\mathrm{round}(A) - 1}{2A}\right)}{\pi A^2} - \frac{(6\,\mathrm{round}(A) + 1)\sqrt{4A^2 - (2\,\mathrm{round}(A) - 1)^2} - 2\pi(A^2 + 2\,\mathrm{round}(A)^2)}{2\pi A^2}\\{+\,\frac{1}{\pi A^2}\sum_{k=1}^{\mathrm{round}(A)-1}}\left(\left(2A^2 + 4k^2\right)\bigg(\mathrm{asin}\left(\tfrac{2k + 1}{2A}\right) - \mathrm{asin}\left(\tfrac{2k - 1}{2A}\right)\bigg) + \frac{(6k - 1)\sqrt{4A^2 - (2k + 1)^2} - (6k + 1)\sqrt{4A^2 - (2k - 1)^2}}{2}\right),\quad A &gt; 0.5.\end{gather}\tag{3}$$

For optimality by definition 1, the task is to find the value of $A$ that minimizes the relative root mean square quantization error RRMSE $= \sqrt{\mathrm{RelMSE}}$. under the constraint $A \le 2^{m-1}-0.5$. Eq. 3 can be evaluated in Python using the mpmath arbitrary precision library:

import mpmath as mp
def RelMSE(A):  # valid for A &gt;= 0.5
    A = mp.mpf(A)
    return 2*mp.asin(1/(2*A))/mp.pi - mp.sqrt(4*A**2-1)/(2*mp.pi*A**2) - (2*A**2 + 4*mp.floor(A + 0.5)**2)*mp.asin((2*mp.floor(A + 0.5) - 1)/(2*A))/(mp.pi*A**2) - ((6*mp.floor(A + 0.5) + 1)*mp.sqrt(4*A**2 - (2*mp.floor(A + 0.5) - 1)**2) - 2*mp.pi*(A**2 + 2*mp.floor(A + 0.5)**2))/(2*mp.pi*A**2) + mp.nsum(lambda k: (2*A**2 + 4*k**2)*(mp.asin((2*k+1)/(2*A)) - mp.asin((2*k-1)/(2*A))) + ((6*k-1)*mp.sqrt(4*A**2 - (2*k + 1)**2) - (6*k + 1)*mp.sqrt(4*A**2 - (2*k - 1)**2))/2, [1, mp.floor(A + 0.5)-1])/(mp.pi*A**2)


RRMSE appears to have a local minimum between each pair of successive integer $A$ (Fig. 1).


Figure 1. RRMSE (blue solid line and blue squares) and its approximation $\sqrt{1/6}/A$ (orange dashed line) based on the variance $1/12$ of a uniform distribution of width 1, for various ranges of $A$.

A selection of optimal $A$ are given in Table 1 together with the resulting RRMSE, also for some other common values of $A$. At larger $m$, RRMSE reduction by the optimal choice will be marginal. The table entries, which show only digits that are equal between two computations using different precision settings, can be generated by the following Python script (continued), the execution of which took days:

def approx_optimal_A(m):
    m = mp.mpf(m)
    return 2**(m-1) - 1 + mp.mpf("0.156936321399") + mp.exp(-1.2749819017 - 0.3464088917*m)  # Eq. 8
    # return 2**(m-1) - 1  # This less informed guess gives identical results but slower convergence

def to_max_digits(f, prec_1, prec_2, max_digits):  # return the at most max_digits digits of function f that are agreed about by both precision settings
    prec = mp.mp.prec
    mp.mp.prec = prec_1
    y_prec_1 = f()
    mp.mp.prec = prec_2
    y_prec_2 = f()
    digits = max_digits
    while mp.nstr(y_prec_1, digits, strip_zeros=False) != mp.nstr(y_prec_2, digits, strip_zeros=False):  # Beware: a possible infinite loop
        digits -= 1
    return mp.nstr(y_prec_2, digits, strip_zeros=False)
    prec = mp.mp.prec

double_digits = 15  # Print at most this many digits
dB_digits = 9

for m in range(2, 25):
    optimal_A = to_max_digits(lambda: mp.findroot(lambda A: mp.diff(RelMSE, A), approx_optimal_A(m)), 80, 100, double_digits)
    RelMSE_optimal = to_max_digits(lambda: 10*mp.log10(RelMSE(mp.mpf(optimal_A))), 80, 100, dB_digits)
    RelMSE_1 = to_max_digits(lambda: 10*mp.log10(RelMSE(2**(m-1)-1)), 80, 100, dB_digits)
    RelMSE_2 = to_max_digits(lambda: 10*mp.log10(RelMSE(2**(m-1)-0.5)), 80, 100, dB_digits)
    print(str(m)+"&amp;"+optimal_A+"&amp;"+RelMSE_optimal+"&amp;"+RelMSE_1+"&amp;"+RelMSE_2+"\\\\")


Table 1. Optimal $A$ by definition 1 for different $m\le24$ and the resulting RRMSE, with the RRMSE for some common choices of $A$ listed for comparison. $m=1$ has been left out because it cannot be handled by Eq. 3 and because a single bit does not represent any positive numbers as a two's complement representation. Note that RRMSE in dB is converted to SNR in dB by a sign flip, because $\mathrm{SNR}$ $=$ $1/\mathrm{RelMSE}$ $=$ $1/\mathrm{RRMSE}^2$.

$$\begin{array}{l|l|lll}m&amp;\text{optimal }A&amp;\rlap{\text{RRMSE (dB)}}&amp;&amp;\\
&amp;&amp;A=\text{optimal}&amp;2^{m-1}-1&amp;2^{m-1}-0.5\\
\hline
2&amp;1.26827949461530&amp;-11.1128053&amp;-8.92729805&amp;-10.1764645\\
3&amp;3.23800942121037&amp;-18.8206937&amp;-17.9588863&amp;-17.8882004\\
4&amp;7.21658597929407&amp;-25.5167673&amp;-25.0903048&amp;-24.7375654\\
5&amp;15.2007181331955&amp;-31.8127094&amp;-31.5775537&amp;-31.2013629\\
6&amp;31.1888756714257&amp;-37.9364880&amp;-37.7977883&amp;-37.4726954\\
7&amp;63.1800835394190&amp;-43.9858910&amp;-43.9001114&amp;-43.6414308\\
8&amp;127.173613625523&amp;-50.0049518&amp;-49.9500053&amp;-49.7527817\\
9&amp;255.168894736361&amp;-56.0134743&amp;-55.9773382&amp;-55.8307200\\
10&amp;511.165479188890&amp;-62.0200022&amp;-61.9957638&amp;-61.8884975\\
11&amp;1023.16302205377&amp;-68.0278661&amp;-68.0113689&amp;-67.9337180\\
12&amp;2047.16126264484&amp;-74.0380590&amp;-74.0267095&amp;-73.9708981\\
13&amp;4095.16000722516&amp;-80.0505958&amp;-80.0427267&amp;-80.0028089\\
14&amp;8191.15911371601&amp;-86.0651409&amp;-86.0596541&amp;-86.0312009\\
15&amp;16383.1584789666&amp;-92.0812822&amp;-92.0774410&amp;-92.0572079\\
16&amp;32767.1580286428&amp;-98.0986407&amp;-98.0959437&amp;-98.0815798\\
17&amp;65535.1577094659&amp;-104.116904&amp;-104.115007&amp;-104.104821\\
18&amp;131071.157483397&amp;-110.135830&amp;-110.134493&amp;-110.127276\\
19&amp;262143.157323352&amp;-116.155234&amp;-116.154291&amp;-116.149181\\
20&amp;524287.157210089&amp;-122.174984&amp;-122.174318&amp;-122.170701\\
21&amp;1048575.15712995&amp;-128.194979&amp;-128.194509&amp;-128.191950\\
22&amp;2097151.15707326&amp;-134.215150&amp;-134.214818&amp;-134.213008\\
23&amp;4194303.15703317&amp;-140.235446&amp;-140.23521&amp;-140.233931\\
24&amp;8388607.15700481&amp;-146.255831&amp;-146.2557&amp;-146.25476\end{array}$$

Optimality by def. 2

A periodic function such as a quantized sinusoid has a Fourier series; it is a sum of harmonic sinusoids, that is, sinusoids of harmonic frequencies of a fundamental frequency. Harmonic sinusoids are orthogonal. Therefore, the mean square of the periodic function equals the sum of the mean squares of the harmonic sinusoids. The mean square of the sum of the non-fundamental harmonics can then be calculated by subtracting the mean square of the fundamental from the mean square of the periodic function. For a quantized cosine wave $\mathrm{round}\big(A\cos(x)\big)$ this allows to calculate total harmonic distortion (THD) as:

$$\mathrm{THD} = \sqrt{\frac{\displaystyle\mathrm{MS} - a_1^2/2}{a_1^2/2}} = \sqrt{\frac{\mathrm{MS}}{a_1^2/2} - 1},\tag{4}$$

where MS is the mean square of the quantized cosine wave, $a_1^2/2$ is the mean square of the fundamental, and $a_1$ is the coefficient of the fundamental frequency cosine in the Fourier series of $\mathrm{round}\big(A\cos(x)\big)$, calculated using Eq. 3 of my answer to a related question and simplifying to:

$$a_1 = \frac{2}{\pi A}\left(\mathrm{round}(A)\sqrt{4A^2 - \big(2\,\mathrm{round}(A) - 1\big)^2} + \sum_{k=1}^{\mathrm{round}(A)-1}k\left(\sqrt{4A^2 - (2k - 1)^2} - \sqrt{4A^2 - (2k + 1)^2}\right)\right).\tag{5}$$

Mean square of the quantized cosine wave is calculated in its first quarter-period by:

$$\mathrm{MS} = \frac{1}{\pi/2}\int_0^{\pi/2}\mathrm{round}\big(A\cos(x)\big)^2dx = \frac{\mathrm{round}(A)^2}{\pi/2}\,\mathrm{acos}\left(\frac{\mathrm{round}(A) - 0.5}{A}\right) + {\frac{1}{\pi/2}\sum_{k=1}^{\mathrm{round}(A) - 1}}k^2\Bigg(\mathrm{acos}\left(\frac{k - 0.5}{A}\right) - \mathrm{acos}\left(\frac{k + 0.5}{A}\right)\Bigg)\tag{6}$$

THD is calculated and minimized by the following Python script (continued), using Eqs. 4, 5, and 6:

def a_1(A):
    A = mp.mpf(A)
    return 2*(mp.floor(A + 0.5)*mp.sqrt(4*A**2 - (2*mp.floor(A + 0.5) - 1)**2) + mp.nsum(lambda k: k*(mp.sqrt(4*A**2 - (2*k - 1)**2)-mp.sqrt(4*A**2 - (2*k + 1)**2)), [1, mp.floor(A + 0.5) - 1]))/(mp.pi*A)

def MS(A):
    A = mp.mpf(A)
    return mp.floor(A + 0.5)**2*mp.acos((mp.floor(A + 0.5)-0.5)/A)/(mp.pi/2) + mp.nsum(lambda k: k**2*(mp.acos((k - 0.5)/A) - mp.acos((k + 0.5)/A)), [1, mp.floor(A + 0.5) - 1])/(mp.pi/2)

def STHD(A):  # Square of THD
    MS_1 = a_1(A)**2/2
    return MS(A)/MS_1 - 1

for m in range(2, 25):
    optimal_A = to_max_digits(lambda: mp.findroot(lambda A: mp.diff(STHD, A), approx_optimal_A(m)), 80, 100, double_digits)
    B = to_max_digits(lambda: a_1(mp.mpf(optimal_A)), 80, 100, double_digits)
    THD_optimal = to_max_digits(lambda: 10*mp.log10(STHD(mp.mpf(optimal_A))), 80, 100, dB_digits)
    THD_1 = to_max_digits(lambda: 10*mp.log10(STHD(2**(m-1)-1)), 80, 100, dB_digits)
    THD_2 = to_max_digits(lambda: 10*mp.log10(STHD(2**(m-1)-0.5)), 80, 100, dB_digits)
    print(str(m)+"&amp;"+optimal_A+"&amp;"+B+"&amp;"+THD_optimal+"&amp;"+THD_1+"&amp;"+THD_2+"\\\\")


Figure 2. THD (dB) as function of unquantized amplitude $A$. The local maxima are at amplitudes that cause a narrow protrusion to poke out at the extrema of the quantized sinusoid.

Figure 3. Amplitude $a_1$ (blue solid line) of the fundamental frequency in the quantization of a cosine wave of amplitude $A$, with the identity line (orange dashed line) plotted for reference.

Table 2. Optimal $A$ by definition 2 for different $m\le24$ and the resulting THD, with the THD for some common choices of $A$ listed for comparison. Surprisingly, THD is minimized by the same $A$ that maximize SNR (Table 1), also when tested with much higher precision than what is shown here. If the signal is considered to be a sinusoid of amplitude $a_1$ instead of amplitude $A$, then SNR values are obtained by flipping the sign of the THD values.

$$\begin{array}{l|l|l|lll}m&amp;\text{optimal }A&amp;a_1&amp;\rlap{\text{THD (dB)}}&amp;&amp;\\
&amp;&amp;A=\text{optimal}&amp;A=\text{optimal}&amp;2^{m-1}-1&amp;2^{m-1}-0.5\\
\hline
2&amp;1.26827949461530&amp;1.17011951948679&amp;-10.7629578&amp;-10.1492078&amp;-10.5728562\\
3&amp;3.23800942121037&amp;3.19552705145171&amp;-18.7633376&amp;-18.2533980&amp;-18.3370094\\
4&amp;7.21658597929407&amp;7.19632525078776&amp;-25.5045573&amp;-25.1895549&amp;-25.0267366\\
5&amp;15.2007181331955&amp;15.1907044658090&amp;-31.8098475&amp;-31.6159563&amp;-31.3681507\\
6&amp;31.1888756714257&amp;31.1838597476996&amp;-37.9357894&amp;-37.8138122&amp;-37.5642711\\
7&amp;63.1800835394190&amp;63.1775601103885&amp;-43.9857175&amp;-43.9071306&amp;-43.6902709\\
8&amp;127.173613625523&amp;127.172343338577&amp;-50.0049084&amp;-49.9531877&amp;-49.7783344\\
9&amp;255.168894736361&amp;255.168255766598&amp;-56.0134634&amp;-55.9788184&amp;-55.8439127\\
10&amp;511.165479188890&amp;511.165158147298&amp;-62.0199994&amp;-61.9964656&amp;-61.8952456\\
11&amp;1023.16302205377&amp;1023.16286093052&amp;-68.0278654&amp;-68.0117064&amp;-67.9371468\\
12&amp;2047.16126264484&amp;2047.16118185697&amp;-74.0380588&amp;-74.0268736&amp;-73.9726322\\
13&amp;4095.16000722516&amp;4095.15996674788&amp;-80.0505958&amp;-80.0428071&amp;-80.0036830\\
14&amp;8191.15911371601&amp;8191.15909344706&amp;-86.0651409&amp;-86.0596937&amp;-86.0316405\\
15&amp;16383.1584789666&amp;16383.1584688212&amp;-92.0812822&amp;-92.0774606&amp;-92.0574286\\
16&amp;32767.1580286428&amp;32767.1580235662&amp;-98.0986407&amp;-98.0959534&amp;-98.0816905\\
17&amp;65535.1577094659&amp;65535.1577069262&amp;-104.116904&amp;-104.115011&amp;-104.104877\\
18&amp;131071.157483397&amp;131071.157482127&amp;-110.135830&amp;-110.134495&amp;-110.127304\\
19&amp;262143.157323352&amp;262143.157322717&amp;-116.155234&amp;-116.154293&amp;-116.149195\\
20&amp;524287.157210089&amp;524287.157209771&amp;-122.174984&amp;-122.174319&amp;-122.170708\\
21&amp;1048575.15712995&amp;1048575.15712979&amp;-128.194979&amp;-128.194509&amp;-128.191953\\
22&amp;2097151.15707326&amp;2097151.15707318&amp;-134.215150&amp;-134.21482&amp;-134.213010\\
23&amp;4194303.15703317&amp;4194303.15703313&amp;-140.235446&amp;-140.235212&amp;-140.233932\\
24&amp;8388607.15700481&amp;8388607.15700479&amp;-146.25583&amp;-146.25567&amp;-146.25476\end{array}$$

The equivalence of the two optimality definitions holds even when numerical precision is increased significantly, here with $m=4$ at least to 200 decimal places, in Python (continued):

m = 4
mp.mp.dps = 200
mp.findroot(lambda A: mp.diff(RelMSE, A), 2**(m-1)-1+0.157)
mp.findroot(lambda A: mp.diff(STHD, A), 2**(m-1)-1+0.157)


which outputs numerically identical optimal values for $A$ for the two optimality definitions:

mpf('7.21658597929406951556806247230383254685067097032105786583650636819627678717747461433940963299310318715204551609940031954265317274195597248077934451075855527')
mpf('7.21658597929406951556806247230383254685067097032105786583650636819627678717747461433940963299310318715204551609940031954265317274195597248077934451075855527')


Limit $m\to\infty$

At large $m$ it becomes difficult to directly optimize $m$ numerically, so another approach is desirable. A Taylor approximation of the sinusoid about its peak, where it most differs from a linear function, is a quadratic polynomial. This can be used to analyze the effects of quantization in the limit $m\to\infty$ $\Rightarrow$ $A\to\infty$. The difference between the MS quantization error of a sinusoid with an amplitude $A$ and the MS quantization error $1/12$ of a linear function is proportional to (Fig. 4):

$$\begin{gather}\mathrm{MS} - \frac{1}{12} \propto f(a) = \int_0^{\sqrt{4a + 2}/2}\left((x^2 - a)^2 - \frac{1}{12}\right)dx + {\sum_{k=1}^{\infty}\int_{\sqrt{4a + 4k - 2}/2}^{\sqrt{4a + 4k + 2}/2}\left((x^2 - a - k)^2 - \frac{1}{12}\right)dx}
= \frac{1}{60}\left(\frac{\sqrt{4a + 2}}{16a^2 - 4a - 1} + \sum_{k=1}^\infty\left(\sqrt{4a + 4k + 2}\left(16a^2 + 4a\,(8k - 1) + 16k^2 - 4k - 1\right)\\
- \sqrt{4a + 4k - 2}\left(16a^2 + 4a\,(8k + 1) + 16k^2 + 4k - 1\right)\right)\right),\end{gather}\tag{7}$$

when the amplitude $A$ is an integer $\to\infty$ plus a real number $-0.5 &lt; a \le 0.5$. The sum in Eq. 7 appears to converge, whereas leaving out the term $-\frac{1}{12}$ would result in the sequence of partial sums growing without bound, indicating that no matter which value of $a$ is chosen, $\left(\mathrm{MS} - \frac{1}{12}\right)/\mathrm{MS} \to 0$ and $\mathrm{MS} \to \frac{1}{12}$ as $m\to\infty$.

Figure 4. $f(a)$ and $f'(a)$ of Eq. 7. The shape of $f(a)$ looks identical to the shape of RRMSE for large $m$ in Fig. 1.

By symbolically differentiating $f(a)$ defined in Eq. 7 with respect to $a$ (Fig. 4) and by finding the zero of $f'(a)$ near $a = 0.157$, the optimal $a$ at $m\to\infty$ can be computed to quite a bit of precision, in Python (continued):

def f(a):
    a = mp.mpf(a)
    return (mp.sqrt(4*a + 2)*(16*a**2 - 4*a - 1) + mp.nsum(lambda k: (mp.sqrt(4*a + 4*k + 2)*(16*a**2 + 4*a*(8*k - 1) + 16*k**2 - 4*k - 1) - mp.sqrt(4*a + 4*k - 2)*(16*a**2 + 4*a*(8*k + 1) + 16*k**2 + 4*k - 1)), [1, mp.inf]))/60

def Df(a):  # Derivative of f(a)
    a = mp.mpf(a)
    return mp.sqrt(2)*(16*a**2 + 4*a - 1)/(12*mp.sqrt(2*a + 1)) + mp.nsum(lambda k: (mp.sqrt(4*a + 4*k - 2)*(16*a**2 + 4*a*(8*k + 1) + 16*k**2 + 4*k - 1) - mp.sqrt(4*a + 4*k + 2)*(16*a**2 + 4*a*(8*k - 1) + 16*k**2 - 4*k - 1))/(12*mp.sqrt(2*a + 2*k + 1)*mp.sqrt(2*a + 2*k - 1)), [1, mp.inf])    

to_max_digits(lambda: mp.findroot(lambda a: Df(a), 0.157), 63, 83, double_digits)


which gives $a \approx 0.156936321399$. This can be used to create an approximation of the optimal $A$ as function of $m$, intended for large $m \ge 20$:

$A \approx 2^{m-1} - 1 + 0.156936321399 + e^{-1.2749819017
 - 0.3464088917 m},\tag{8}$

where the coefficients in the exponent were calculated by a linear fit at $m \in \{21, 22\}$ to a linearization of optimal $A$ values of Table 1 or equivalently Table 2. The error from using the approximation is shown in Fig. 5.

Figure 5: Absolute error in the approximation of optimal $A$ by Eq. 8 as function of $m$. For $m \in \{21, 22\}$, which were used for fitting, and for $m \in \{23, 24\}$, the absolute approximation error was less than $10^{-8}$.

Out of curiosity, I also computed the worst-case $a$ that gives the largest MS quantization error as $m\to\infty$, by finding the zero of $f'(a)$ near $a = -0.43$, which turned out to be at $a \approx -0.433510875868$.

Conclusion

The two definitions of optimality appear to be equivalent, to convincing numerical precision. As $m\to\infty$, the optimal value of $A$ approaches approximately $2^{m-1}-1+0.156936321399$ (or more accurately for large finite $m$ the approximation of Eq. 8) and the quantization error reduction (by def. 1 SNR or def. 2 THD) in dB from choosing the optimal value approaches zero, compared to choosing another large value such as $A = 2^{m-1}-1$ or the nearly worst-case choice $A = 2^{m-1}-0.5$.

At the optimal amplitude $A$, the least squares (LS) sinusoid is of the same frequency and phase as the sinusoid being quantized, but has a somewhat lower amplitude $a_1$ given in Table 2. This is somewhat counterintuitive. To minimize THD (or to maximize SNR with the sinusoid being approximated as the signal) of approximating a sinusoid of amplitude $a_1$ using a waveform of $m$-bit numbers with values in range $-2^{m-1} \ldots 2^{m-1}-1$ that is constructed by quantizing (by rounding to the nearest integer) a sinusoid of amplitude $A$, one must choose optimal $a_1$ and $A$ that are not equal.

The results are applicable to continuous time without sampling, or to sampling in the limit $f\to f_s$, where $f$ is the sinusoid frequency and $f_s$ is the sampling frequency. In general, optimality is not preserved by sampling. Random sampling with random times of the samples will preserve definition 1 SNR optimality, if the distribution of the sinusoid phase (modulo $2\pi$) at the samples is uniform. Also, for irrational $f/f_s$, the same optimality is preserved for the same reason, see equidistribution theorem. Definition 1 SNR optimality vanishes with rational $f/f_s$, because the distribution of sinusoid phases will not be uniform.