I'm looking for a general, clean and fast (i.e. using C++ routines) R package for simulating paths from a non-homogeneous nonlinear diffusion like (1) using the Euler-Maruyama scheme, the Milstein scheme (or any other). This is destined to be embedded into a larger estimation code and therefore deserves to be optimized.
$$dX_t = f(\theta, t, X_t)\, dt + g(\theta, t, X_t)\, dW_t, \tag{1}$$
with $W_t$ the standard Brownian motion.