Euclid and Diophantus and their role in algebra and geometry