  We present a recursive formula for the computation of the static effective
Hamiltonian of a system under a fast-oscillating drive. Our analytical result
is well-suited to symbolic calculations performed by a computer and can be
implemented to arbitrary order, thus overcoming limitations of existing
time-dependent perturbation methods and allowing computations that were
impossible before. We also provide a simple diagrammatic tool for calculation
and treat illustrative examples. By construction, our method applies directly
to both quantum and classical systems; the difference is left to a low-level
subroutine. This aspect sheds light on the relationship between seemingly
disconnected independently developed methods in the literature and has direct
applications in quantum engineering.
