Large-scale structure formation in cosmology with classical and tachyonic scalar fields