The vertical sea-level muon spectrum at energies above 1 GeV and the muon intensities at depths up to 18 km w.e. in different rocks and in water are calculated. The results are particularly collated with a great body of the ground-level, underground, and underwater muon data. In the hadron-cascade calculations, we take into account the logarithmic growth with energy of inelastic cross sections and pion, kaon, and nucleon generation in pion-nucleus collisions. For evaluating the prompt muon contribution to the muon flux, we apply the two phenomenological approaches to the charm production problem: the recombination quark-parton model and the quark-gluon string model. We give simple fitting formulas describing our numerical results. To solve the muon transport equation at large depths of a homogeneous medium, we use a semianalytical method, which allows the inclusion of an arbitrary (decreasing) muon spectrum at the medium boundary and real energy dependence of muon energy losses. Our analysis shows that at the depths up to 6-7 km w.e., essentially all underground data on the muon flux correlate with each other and with the predicted one for conventional (π, K)-muons, to within 10 %. However, the high-energy sea-level muon data as well as the data at high depths are contradictory and cannot be quantitatively described by a single nuclear-cascade model.