Well-Behaved Programs for DSP Computation