I want to evaluate the following function as part of a computer program: $$f(x) = \frac{x^a - 1}{x^a (x - 1)}, x \in \mathbb{R}^+, a \in \mathbb{R}_0^+$$
Mathematically, this function is fairly well-behaved, with the singularity at $x = 1$ being a removable singularity. However, even though the singularity can be treated separately, the evaluation is numerically unstable in the neighborhood of $x = 1$ due to both the numerator and the denominator becoming very small.
Even though $x = 1$ is a root of the numerator, I have been unable to algebraically express the numerator as a product $(x - 1)r$ in order to cancel the linear factor $x - 1$ to remove the singularity. I know it is possible for $a \in \mathbb{N}$ via the formulas for the geometric progression, but the resulting polynomial is expensive to evaluate and in my case, $a$ can be an arbitrary nonnegative real number, so this does not apply anyways.
Is there a way to algebraically express a function that is $f$ but with the singularity removed? If not, is there a way to evaluate $f$ while avoiding the numerical instability around $x = 1$?

I want to highlight Lutz Lehmann's comment on the
expm1function which is ubiquitous. It's purpose is to efficiently compute $e^x -1$ for $x \approx 0$.Lutz gives the formula
which looks correct to me, and does indeed appear to be stable for $x \approx 1$. You must check for $x = 1$ to avoid division by zero.
I suspect that all the answers using Taylor series are essentially reinventing the wheel here.