calculating exp ndev rexp