DOMAC: Differentiable Optimization for High-Speed Multipliers and Multiply-Accumulators