  We introduce a mathematical framework for quantifying fine-tuning in general
physical settings. In particular, we identify two distinct perspectives on
fine-tuning, namely, a local and a global perspective --- and develop
corresponding measures. These measures apply broadly to settings characterized
by an arbitrary number of observables whose values are dependent on an
arbitrary number of parameters. We illustrate our formalism by quantifying
fine-tuning as it arises in two pertinent astrophysical settings: (i) in models
where a significant fraction of the dark matter in the universe is in the form
of primordial black holes, and (ii) in scenarios that derive the fraction of
protons in habitable dark-matter halos from underlying models of cosmic
inflation.
