  Modern astronomical potentials modeling galaxies or stellar systems can be
rather involved, and deriving their first derivatives (accelerations) and
second derivatives (variational equations) in order to compute orbits and their
chaoticity may be a formidable task. We present here a fully automated routine,
dubbed Smart, with which the accelerations and the variational equations of an
arbitrary potential that has been written in the Fortran 77 language can be
computed. Almost any Fortran 77 statement is admitted in the potential, and the
output are standard Fortran 77 routines ready to use. We validate our algorithm
with a set of potentials including time-dependent, velocity-dependent and very
complex potentials that even involve auxiliary routines. We also describe with
some detail a realistic seven-component Galactic potential, MilkyWayHydra,
which yields very involved derivatives, thus being a good test bed for Smart.
