Solution (source code)

= Solution

Let $r=\|x\|>0$. Choose $c=-r$ if $x_1\geq0$ and $c=r$ if $x_1<0$, and set $v=x-ce_1$. This opposite-sign choice ensures $v\ne0$. Because $c^2=r^2$,
$$
v^Tx=r^2-cx_1,\qquad v^Tv=2(r^2-cx_1).
$$
Therefore
$$
\boxed{H_vx=x-2v\frac{v^Tx}{v^Tv}=x-v=ce_1}.
$$
The denominator is positive, including when $x$ already lies on the first coordinate axis.