  Herschel-PACS measurements of the rotational R(0) and R(1) HD lines in the
atmospheres of Uranus and Neptune are analyzed in order to derive a D/H ratio
with improved precision for both planets. The derivation of the D/H ratio
includes also previous measurements of the R(2) line by the Short Wavelength
Spectrometer on board the Infrared Space Observatory (ISO). The available
spectroscopic line information of the three rotational transitions is discussed
and applied in the radiative transfer calculations. The best simultaneous fit
of all three lines requires only a minor departure from the Spitzer temperature
profile of Uranus and a departure limited to 2K from the Voyager temperature
profile of Neptune (both around the tropopause). The resulting and remarkably
similar D/H ratios for Uranus and Neptune are found to be
(4.4$\pm$0.4)$\times10^{-5}$ and (4.1$\pm$0.4)$\times10^{-5}$ respectively.
Although the deuterium enrichment in both atmospheres compared to the
protosolar value is confirmed, it is found to be lower compared to previous
analysis. Using the interior models of Podolak et al. (1995), Helled et al.
(2011) and Nettelmann et al. (2013), and assuming that complete mixing of the
atmosphere and interior occured during the planets history, we derive a D/H in
protoplanetary ices between (5.75--7.0)$\times10^{-5}$ for Uranus and between
(5.1--7.7)$\times10^{-5}$ for Neptune. Conversely, adopting a cometary D/H for
the protoplanetary ices between (15-30)$\times10^{-5}$, we constrain the
interior models of both planets to have an ice mass fraction of 14-32%, i.e.
that the two planets are rock-dominated.
