Using the current computing power, predicting eclipses is usually done iteratively. We determine the position of the Sun and the Moon at a time and calculate their elongation to determine if an eclipse happens. This same procedure is then repeated many times, each for a different time.
Flat-Earthers insist that nobody can predict eclipses from the position of the Sun and the Moon. They incorrectly believe NASA used the ancient Saros cycle to predict eclipses by calculating the interval between eclipses. A tiny Python script can easily debunk it.