Recall floating-point representation:
Suppose $f$ is a floating-point number then we can express f as, If $f$ is normal: $$(-1)^{s}\cdot2^{e-127}(1 + \sum\limits_{k=1}^{23} b_{23-k}\cdot 2^{-k})$$ If $f$ is denormal/subnormal: $(e = 0)$ $$(-1)^{s}\cdot2^{-126}(0 + \sum\limits_{k=1}^{23} b_{23-k}\cdot 2^{-k})$$
where
- $s$ is the sign of $f$.
- $e$ is the stored exponent of $f$. This means $e-127$ is the effective exponent of $f$.
- $b_k$ is the $k$-th bit of $f$ where $b_0$ is the LSB and $b_{22}$ is the MSB.
Let $f_1$ be a floating-point number with constants $s_1, e_1,$ and $b_{1k}$.
Let $f_2$ be a floating-point number with constants $s_2, e_2,$ and $b_{2k}$.
I'm trying to find out if the following statement is true: $e_1 > e_2 > 0$ and $s_1 = s_1$ then $f_1 > f_2$.
My initial strategy was to subtract $f_2$ from $f_1$ and show that it must be strictly greater than $0$.
What I have so far.
$ \begin{align*} f_1-f_2 &= 2^{e_1-127}(1 + \sum\limits_{k=1}^{23} b_{1,23-k}\cdot 2^{-k}) - 2^{e_2-127}(1 + \sum\limits_{k=1}^{23} b_{2,23-k}\cdot 2^{-k})\\ &= 2^{-127}(2^{e_1}(1 + \sum\limits_{k=1}^{23} b_{1,23-k}\cdot 2^{-k}) - 2^{e_2}(1 + \sum\limits_{k=1}^{23} b_{2,23-k}\cdot 2^{-k})) \\ &= 2^{-127}(2^{e_1} + \sum\limits_{k=1}^{23} b_{1,23-k}\cdot 2^{e_1-k} - 2^{e_2} - \sum\limits_{k=1}^{23} b_{2,23-k}\cdot 2^{e_2-k})\\ &=2^{-127}(2^{e_1} - 2^{e_2} + \sum\limits_{k=1}^{23} b_{1,23-k}\cdot 2^{e_1-k} - \sum\limits_{k=1}^{23} b_{2,23-k}\cdot 2^{e_2-k})\\ &=2^{-127}(2^{e_1} - 2^{e_2} + \sum\limits_{k=1}^{23}(b_{1,23-k}\cdot 2^{e_1-k}-b_{2,23-k}\cdot 2^{e_2-k})) \end{align*} $
Now since $e_1 > e_2 \iff e_1-e_2 > 0 \iff 2^{e_1}-2^{e_2} > 1$ we have that:
$ \begin{align*} f_1-f_2 & > 2^{-127}(1 + \sum\limits_{k=1}^{23}(b_{1,23-k}\cdot 2^{e_1-k}-b_{2,23-k}\cdot 2^{e_2-k})) \end{align*} $
In order for the above to always be greater than zero I require that $\sum\limits_{k=1}^{23}(b_{1,23-k}\cdot 2^{e_1-k}-b_{2,23-k}\cdot 2^{e_2-k}) > -1$.
However, I don't know how to formally show this. Any help/hints are much appreciated as inequalities are not my strong suit.