Avoiding overflow in computing the ratio of two large numbers
Yes, when $x\ge355$, computing $e^{2x}$ as a double-precision float in IEEE 754-1985 standard, leads to an overflow.

$$x + \frac{e^x-x}{e^{2x} + 1}= x + e^{-x} - \frac{x+e^{-x}}{e^{2x} + 1}\approx x+ e^{-x}$$

The difference between the two sides of the approximate sign is smaller than the minimal positive number in IEEE 754-1985 standard, $2^{−1022} \approx 2.225×10^{−308}$, when $x&gt;367.2$.

So, once $x&gt;367.2$, you can just use $x+e^{-x}$ instead.