We have developed a one-dimensional code to solve ultrarelativistic hy
drodynamic problems, using the Glimm method for an accurate treatment
of shocks and contact discontinuities. The implementation of the Glimm
method is based on an exact Riemann solver and van der Corput samplin
g sequence. In order to improve computational efficiency, the Glimm me
thod is replaced by a finite differencing scheme in those regions wher
e the fluid flow is sufficiently smooth. The accuracy and convergence
of this hybrid method is investigated in tests involving planar, cylin
drically, and spherically symmetric flows that exhibit strong shocks a
nd Lorentz factors of up to similar to 2000. This hybrid code has prov
en to be successful in simulating the interaction between a thin, ultr
arelativistic, spherical shell and a low-density stationary medium, wh
ich is a situation likely to arise in gamma-ray bursters, supernovae e
xplosions, pulsar winds, and active galactic nuclei.