# approximate function such that the inverse of the approximation is “simple”

I have a smooth enough injective function $$f:[a, b]\to \mathbb{R}$$ which I want to approximate by something that can be computed quickly, e.g., a Padé approximant of low degree, $$\frac{\sum_{j=0}^m a_j x^j}{1 + \sum_{k=0}^n b_k x^k}.$$ At the same time, though, I also need the inverse of the approximating function to be computed quickly, so Padé will give me a hard time even with low degrees.

Any ideas?

• Why not approximate the inverse function itself ? You can also use this to get a good initial guess to find the true inverse of the forward function by some root finding technique. – cpraveen Sep 2 at 13:53
• @cpraveen I need both $F_{approx}$ and $F_{approx}^{-1}$. – Nico Schlömer Sep 2 at 16:39
• Is there a reason for computing $(F_{\mathrm{approx}})^{-1}$ instead of $(F^{-1})_{\mathrm{approx}}$? If the approximation is sufficiently good, the difference would be negligible anyway, no? – Kirill Sep 2 at 17:08
• @Kirill I'll have to evaluate the approximant and its inverse many times, and the inversion will have to be exact. I'd have to go into much detail to explain why, but I think this condition by itself is not too wild. – Nico Schlömer Sep 2 at 17:50
• @NicoSchlömer Would $(F^{-1})_{\mathrm{approx}}$ be accurate enough that it can be used as an initial guess for just one Newton iteration to get $(F_{\mathrm{approx}})^{-1}$? That seems like it would be cheap and produce an exact inversion, but also avoid inverting hard functions. – Kirill Sep 2 at 21:25

But when we're talking smooth functions which need to be evaluated quickly, I reach for B-splines. Create the pairs $$\{x_j, f(x_j)\}_{j=1}^{n}$$, and use (say) a cubic B-spline (here's an implementation for the equispaced case-many other implementations exist, say, in scipy), and then for the inverse function, just pass in $$\{f(x_j), x_j\}_{j=1}^n$$.