For a point in a two-dimensional grid, this will require the computation of 4 distance vectors and dot products, while in three dimensions 8 distance vectors and 8 dot products are needed.
f(x) = a_0 + \operatorname{smoothstep}(x)\cdot(a_1-a_0) \ \ \text{for }0\leq x\leq 1 .