  A substantial part of the dark matter of the Universe could be in the form of
compact objects (MACHOs), detectable through gravitational microlensing effects
as they pass through the line of sight to background light sources. So far,
most attempts to model the effects of high-redshift microlensing by a
cosmologically distributed population of MACHOs have assumed the compact
objects to be randomly and uniformly distributed along the line of sight. Here,
we present a more realistic model, in which the MACHOs are assumed to follow
the spatial clustering of cold dark matter. Because of sightline-to-sightline
variations in surface mass density, this scenario leads to substantial scatter
in MACHO optical depths, which we quantify as a function of source redshift. We
find that while optical depth estimates based on a uniform line-of-sight
distribution are reasonable for the highest-redshift light sources, such
estimates can be incorrect by a factor of ~2 for the nearby (z~0.25) Universe.
Hence, attempts to derive the cosmological density of MACHOs from microlensing
observations of only a few independent sightlines can be subject to substantial
uncertainties. We also apply this model to the prediction of
microlensing-induced variability in quasars not subject to macrolensing, and
demonstrate that relaxing the assumption of randomly and uniformly distributed
MACHOs only has a modest impact on the predicted light curve amplitudes. This
implies that the previously reported problems with microlensing as the dominant
mechanism for the observed long-term optical variability of quasars cannot be
solved by taking the large-scale clustering of dark matter into account.
