Update libreg/src/rst.c to add calculation of AxS + BxR