3. Given the function $f(x)=\log _{a}\left(a x^{2}-x+\frac{1}{2}\right)$ is always positive on $[1,2]$, then the range of the real number $a$ is ( )
A. $\left(\frac{1}{2},+\infty\right)$
B. $\left(\frac{1}{2}, \frac{5}{8}\right) \cup(1,+\infty)$
C. $\left(\frac{1}{2}, 1\right) \cup\left(\frac{3}{2},+\infty\right)$
D. $\left(\frac{1}{2}, \frac{5}{8}\right) \cup\left(\frac{3}{2},+\infty\right)$
3. $\mathrm{D}$