ported rk45 adaptive from lua to js