Estimating a general function of a quadratic function