This article presents an efficient recursive computation of the inverse dynamics of flexible manipulators. The algorithm is equivalent to the nonlinear computed torque law of flexible manipulators. The computation method is based on the generalized Newton-Euler model of flexible manipulators and can be considered as a generalization of the computed torque control algorithm of rigid robots proposed by Luh, Walker, and Paul for executing joint trajectories. The given algorithm is programmed using Mathematica to get automatically an efficient customized symbolic model with a reduced number of operations.