SMS dit: Discrete circuit optimization