# Error in numbering equations

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{gather}
\intertext{Removing the K factor, Eqn.  turn into the classical CORDIC Equations}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i] \\
\intertext{Considering the aim of the CORDIC algorithm is to rotate a vector V(x, y) to unit vector (1, 0), the direction of each rotation can be decided by $y_{i+1}$ or the angle accumulator, which is defined as $Z_{i+1}$.  Since $y_{i+1}$  would finally be 0, via Equ., the direction of rotation could be defined as:}
\end{gather}

$$\label{equ: 3.16} d_i = \left\{ \begin{array}{ll} +1 & \mbox{if } y_i < 0 \\ -1 & \mbox{if } y_i \geq 0 \end{array} \right.$$
\end{document}


For some unknown reason i am getting an extra equation number 3 in between as below:-

\intertext is for text between equations, but the next equation after the second \intertext is empty. The following example moves the last equation to the gather environment. Also environment cases is used instead of the manual array construct:

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{gather}
\intertext{Removing the $K$ factor, Eqn.\@ turn into the classical CORDIC
Equations}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i] \\
\intertext{Considering the aim of the CORDIC algorithm is to rotate a
vector $V(x, y)$ to unit vector $(1, 0)$, the direction of each rotation can be
decided by $y_{i+1}$ or the angle accumulator, which is defined as
$Z_{i+1}$.  Since $y_{i+1}$  would finally be 0, via Equ., the direction of
rotation could be defined as:}
\label{equ: 3.16}
d_i =
\begin{cases}
+1 & \mbox{if } y_i < 0  \\
-1 & \mbox{if } y_i \geq 0
\end{cases}
\end{gather}
\end{document}


• I would remove the first instance of \intertext, i.e., have the gather environment start after the opening sentence. If nothing else, doing so will give TeX to find another suitable page break, if need be. – Mico Sep 4 '15 at 17:19
• @Mico I had considered this, but I do not know, if this is out of context and the real document contains an equation before. Also preventing the page break before equation one might be on purpose. – Heiko Oberdiek Sep 4 '15 at 17:24
• There will never be a page break just before equation. – egreg Sep 4 '15 at 17:33
• @egreg Unless there is an empty line between the text and the equation. – Heiko Oberdiek Sep 4 '15 at 17:36
• @HeikoOberdiek That's an error. I'm talking of correct input. Your code makes a very big object that can't be split, which is wrong, in my opinion. There would be nothing bad in splitting the middle paragraph across pages. – egreg Sep 4 '15 at 17:39

You're misusing \intertext. There's no need whatsoever for it in this case, because its purpose is to have text between alignment displays, but neither gather nor equation do any sort of alignment: they just center the equations.

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}

Removing the $K$ factor, Eqn.  turn into the classical CORDIC Equations
\begin{gather}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i]
\end{gather}
Considering the aim of the CORDIC algorithm is to rotate a vector $V(x, y)$ to unit vector
$(1, 0)$, the direction of each rotation can be decided by $y_{i+1}$ or the angle
accumulator, which is defined as $Z_{i+1}$.  Since $y_{i+1}$ would finally be 0, via
Equ., the direction of rotation could be defined as:
$$\label{equ: 3.16} d_i = \begin{cases} +1 & \text{if y_i < 0} \\ -1 & \text{if y_i \geq 0} \end{cases}$$
\end{document}


Note also the use of cases and how math should always properly be segregated: for instance, it must be $V(x, y)$.

By the way, the wrong equation number follows from the \\ preceding \intertext. There should never be a trailing \\ in amsmath environment such as align. alignat, gather, multline.