Energy loss of cosmic ray muons in the range 5-40 GeV/c