Suppose $f(x)=x^{n+1}$ for some $n\in\mathbb{N}$, and define the divided difference $$f[a,b]=\frac{a^{n+1}-b^{n+1}}{a-b}.$$
I am wondering about the best way to numerically evaluate $f[a,b]$ to high precision, when
i) $n$ may be large
ii) $a,b\in(-1,1)$ or $a,b\in (0,1)$
iii) $a$ may be close to or even equal to $b$, with $f[a,b]$ replaced with $f'(b)=(n+1)b^n$ at $a=b$.
I know
$$f[a,b]=\sum_{k=0}^{n}a^{k}b^{n-k}$$
and this seems like it should be numerically stable but slow for large $n$. For $a$ moderately but not extremely close to $b$, it seems like replacing $f[a,b]$ with $f'(b)$ might lead to a large truncation error. I have also thought about using a Taylor expansion for the numerator of $f[a,b]$ and writing $f(a)=\sum_{k=0}^{m}f^{(k)}(b)(a-b)^{k}/k!+f^{(m+1)}(\xi)(a-b)^{m+1}/(m+1)!$ which would allow cancelling the $a-b$ in the denominator to get
$$f[a,b]=\sum_{k=1}^{m}f^{(k)}(b)(a-b)^{k-1}+\dbinom{n+1}{m+1}(\xi)^{n-m}(a-b)^{m}$$
but I'm not sure how to get a usable bound for the error term. If this problem has been studied before, a reference would also be appreciated.