The Compleat Enchanter by L. Sprague De Camp
The Mathematics of Magic was probably the greatest discovery of the ages - at least Professor Harold Shea thought so. With the proper equations, he could instantly transport himself back in time to all the wondrous lands of ancient legend. But slips in time were a hazard, and Shea's magic did not always work - at least, not quite as he expected ...This omnibus volume of all of the Magical Misadventures of Harold Shea contains The Incomplete Enchanter, The Wall of Serpents and Castle of Iron