\documentclass[twoside, a4paper,12pt,openany]{book}
\makeatletter
\@ifundefined{Umathcode}{\let\Umathcode\XeTeXmathcode}{}
\@ifundefined{Umathchardef}{\let\Umathchardef\XeTeXmathchardef}{}
\makeatother

\usepackage{nameref}
\usepackage{wrapfig}
\usepackage{verbatim}
\usepackage{url}
\usepackage{supertabular}
\usepackage{array}
\usepackage[nopar]{lipsum}
\usepackage{colortbl}
\usepackage{color}
\usepackage{hyperref}
%\hypersetup{
%    colorlinks=true,
%    linkcolor=blue,
%    citecolor=red,}
\usepackage[noadjust]{cite}
\usepackage{filecontents} %%%/  برای اینکه بتونم در فصل مقدمه چند مرجع را پشت سر هم بدهم
%\usepackage{cite}
\usepackage{cancel}
\usepackage{dsfont}
\usepackage{multirow}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage[margin=20mm,font={footnotesize},labelfont={footnotesize}]{caption}
\usepackage{multirow}
\usepackage{stmaryrd}
\usepackage[xindy]{glossaries}
\usepackage[T1]{fontenc}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage{xecolor}
\usepackage{pifont}
\usepackage{enumitem}
\usepackage{nomencl}
\usepackage{mathrsfs}
\usepackage{relsize}

%%%---------my added packages--------------
\usepackage{tabularx}
%\usepackage{algorithmic}
\usepackage{setspace}
%%\usepackage{algorithm}
%\usepackage{algpseudocode}
\usepackage{pifont}
\usepackage{subfigure}

\usepackage{xepersian}
\begin{document}
	\settextfont[Scale=1.2]{BNazanin}
	سلام
\begin{algorithm}[t]
	\onehalfspacing
\caption{تست}
\label{dinkelbachAlgorithm}
\begin{algorithmic}[1]
\STATE  تست
\REPEAT
\STATE تست
	\IF تست 
		\STATE تست
		\STATE \RETURN تست
	\ELSE
		\STATE تست
	\ENDIF
\UNTIL{ تست}
\end{algorithmic}
%%%\end{algorithm}

\end{document}
