  Modified gravity provides a possible explanation for the currently observed
cosmic accelaration. In this paper, we study general classes of modified
gravity models. The Einstein-Hilbert action is modified by using general
functions of the Ricci and the Gauss-Bonnet scalars, both in the metric and in
the Palatini formalisms. We do not use an explicit form for the functions, but
a general form with a valid Taylor expansion up to second order about redshift
zero in the Riemann-scalars. The coefficients of this expansion are then
reconstructed via the cosmic expansion history measured using current
cosmological observations. These are the quantities of interest for theoretical
considerations relating to ghosts and instabilities. We find that current data
provide interesting constraints on the coefficients. The next-generation dark
energy surveys should shrink the allowed parameter space for modifed gravity
models quite dramatically.
