Dynamic programming and value-function approximation in sequential decision problems: Error analysis and numerical results