Function generation with two loop mechanisms using decomposition and correction method. (April 2017)