Designing Accurate and Low-Cost Stochastic Circuits.