The chapter leading up to the first code snippet describes finding the next x-position using classic Verlet, but the code snippet (which implements a function simply called 'verlet' in many of the languages) does not return the next x-position, but actually demonstrates a time-of-flight algorithm without any context for it up to that point.
One would have to read all the way to the end of the chapter (or have watched the video) to understand what problem the code is actually solving.
The chapter leading up to the first code snippet describes finding the next x-position using classic Verlet, but the code snippet (which implements a function simply called 'verlet' in many of the languages) does not return the next x-position, but actually demonstrates a time-of-flight algorithm without any context for it up to that point.
One would have to read all the way to the end of the chapter (or have watched the video) to understand what problem the code is actually solving.