implicitEuler with double