Back to foreknowledge. Five-point Calvinists believe that God's foreknowledge is based on His election. In other words, they believe He knows exactly what will happen in the actual world only because He will cause all those things to happen (determinism). I think there are a couple of problems with that scenario.
The first problem is in regard to the first sins of Adam and Satan. God knew exactly what they would do, but He didn't cause their first sins. If He had caused their sins, He would be the author of sin, which is unthinkable. The sins of Adam and Satan were self-caused. In their cases a bias toward evil was formed from a position of equipoise (neutrality).
The second problem is in regard to God's counterfactual knowledge. God knows exactly what will happen in non-actual circumstances even though He has not determined what will happen. An example in the Bible of this counterfactual knowledge where God knew with certainty both the actual future and the imagined future is 1 Samuel 23:9-13:
Now David knew that Saul was plotting evil against him; so he said to Abiathar the priest, “Bring the ephod here.” Then David said, “O LORD God of Israel, Thy servant has heard for certain that Saul is seeking to come to Keilah to destroy the city on my account. Will the men of Keilah surrender me into his hand? Will Saul come down just as Thy servant has heard? O LORD God of Israel, I pray, tell Thy servant.” And the LORD said, “He will come down.” Then David said, “Will the men of Keilah surrender me and my men into the hand of Saul?” And the LORD said, “They will surrender you.” Then David and his men, about six hundred, arose and departed from Keilah, and they went wherever they could go. When it was told Saul that David had escaped from Keilah, he gave up the pursuit.
God already knew the actual future; He knew that David and his men would leave Keilah before Saul could come there. God, however, also knew with certainty what the specific events in an imagined future would be if some events in the actual future were changed. David asked God what would happen if he stayed in Keilah (not an actual event). God told David what would happen if an actual event (leaving Keilah) were somehow changed. He said that the people of Keilah would surrender David to Saul. Of course, that surrender of David did not actually happen, but God knew with certainty it would happen if David stayed in Keilah. David had a choice to make, and God already knew what his choice would be. Thus, his choice did not interfere with God’s sovereignty.
Other examples of God’s counterfactual knowledge are found in 2 Kings 13:19, Jeremiah 23:22, 1 Corinthians 2:8, Jeremiah 38:17-20, and Acts 27:22-31.
Free will decisions, like those made by Adam and Satan, fit into God's sovereign plan. Humans can manufacture programmed robots, but only God is capable of creating a finite number of humans whose decisions (freewill and otherwise) fit perfectly into His sovereign plan. Out of an infinite number of imagined people and circumstances, God has always known which people and circumstances would most glorify Him, and He has always known that He would create the finite number of elect and non-elect people that would live in the actual world.