  We generalize the derivation of viscous anisotropic hydrodynamics from
kinetic theory to allow for non-zero particle masses. The macroscopic theory is
obtained by taking moments of the Boltzmann equation after expanding the
distribution function around a spheroidally deformed local momentum
distribution whose form has been generalized by the addition of a scalar field
that accounts non-perturbatively (i.e. already at leading order) for bulk
viscous effects. Hydrodynamic equations for the parameters of the leading-order
distribution function and for the residual (next-to-leading order) dissipative
flows are obtained from the three lowest moments of the Boltzmann equation. The
approach is tested for a system undergoing (0+1)-dimensional boost-invariant
expansion for which the exact solution of the Boltzmann equation in relaxation
time approximation is known. Nonconformal viscous anisotropic hydrodynamics is
shown to approximate this exact solution more accurately than any other known
hydrodynamic approximation.
