An efficient implementation of flux formulae in multidimensional relativistic hydrodynamical codes