The history of medieval magic and witchcraft is more complex than the modern black legend has wanted to show.
Gerbert of Aurillac (later Pope Sylvester II) was a scholar who served as the bishop of Rome and ruled the Papal States from 999 to his death.
He promoted the study of arithmetic, mathematics, and astronomy, reintroducing the abacus, armillary sphere, and water organ to Europe while adopting the decimal numeral system using the Hindu-Arabic numeral system.
He read Virgil, Cicero, and Boethius, studied Porphyry and Aristotle's philosophy, and accurately classified the different disciplines of philosophy.
The black legend of him making deals with the devil grows from the works of the English monk William of Malmesbury and Cardinal Beno. They accused Aurillac of traveling to Spain to further his knowledge in the quadrivium, but also learning magical arts. It's said that he built a brazen head that, possessed by the demon Meridiana, answered his questions with “Yes” and “No”.