Algorithm for approximating functions mapping into Riemannian manifolds using exponential and logarithmic methods.