Add a faster version of XYZ_to_lbd