What is a bit-shifting standard C function for calculating $f(x) = \frac{(2^{16}- 1)}{(2^{32} - 1)}\cdot x$ I need to take 32-bit unsigned integers and scale them to 16-bit unsigned integers "evenly" so that $0 \mapsto 0$ and 0xFFFFFFFF $\mapsto$ 0xFFFF.  I also want to do this without using a 64-bit unsigned integer built-in type.
To give you an idea, going in the opposite direction, the formula for 16-bit to 32-bit scaling is:
U16 y = 0x3290;   // example input
U32 x = ((U32)y << 16) + y;      // formula implementation

To arrive at the formula in the title, I simply took two points on the line that is the graph of $f$, and calculated the slope and y-intercept, like in Alg 1. 
Those are the rules.  Good luck!

Intuitively it seems like each 2-bits in the U32 correspond to each 1-bit in the U32 in the natural order.  Take the first two values: 00, 01 to be 0, and the second two 10, 11 to be 1.  So $\{00, 01, 10, 11\} \to \{0, 1\}$ with division by 2 and flooring.
There is no formula!!!!!!!!! ahhhhh 
Resorting to dividing by $(2^{16} + 1)$ with U32 arithmetic division.
I've tried another approach too and that didn't help either.  There might be something about dividing by $2^{16}$ first and deducing that it equals division by $2^{16} + 1$ on certain inputs that are within the range of a U32.  Still accepting answers if you find a method.
